Skip to content

Instantly share code, notes, and snippets.

View luhenry's full-sized avatar

Ludovic Henry luhenry

View GitHub Profile
@luhenry
luhenry / BenchmarkSupport.java
Last active September 26, 2022 18:53
DotProduct
package dev.ludovic.presentation;
import java.util.Random;
public class BenchmarkSupport {
private static final Random rand = new Random(0);
static double[] randomDoubleArray(int n) {
double[] res = new double[n];
[{"ddsource":"crashtracker","ddtags":"library_version:0.107.0-SNAPSHOT~4dab1e16f,process_id:81658,service:luhenry-experiment,host:COMP-C02DV0W0ML87,runtime-id:9e3fba8a-448e-4ff4-977a-e0edb9a116cf,language:jvm,env:dev","hostname":"COMP-C02DV0W0ML87","message":"#\n# A fatal error has been detected by the Java Runtime Environment:\n#\n# SIGILL (0x4) at pc=0x00007fff207d22aa, pid=30417, tid=259\n#\n# JRE version: OpenJDK Runtime Environment Temurin-17.0.3+7 (17.0.3+7) (build 17.0.3+7)\n# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (17.0.3+7, mixed mode, tiered, compressed oops, compressed class ptrs, parallel gc, bsd-amd64)\n# Problematic frame:\n# C [libsystem_kernel.dylib+0x12aa] mach_msg_trap+0xa\n#\n# No core dump will be written. Core dumps have been disabled. To enable core dumping, try \"ulimit -c unlimited\" before starting Java again\n#\n# If you would like to submit a bug report, please visit:\n# https://github.com/adoptium/adoptium-support/issues\n#\n\n--------------- S U M M A R Y -------
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/root/jdk17u/src/hotspot/cpu/x86/frame_x86.cpp:407), pid=88936, tid=89429
# assert(nm->insts_contains_inclusive(original_pc)) failed: original PC must be in the main code section of the the compiled method (or must be immediately following it)
#
# JRE version: OpenJDK Runtime Environment (17.0.3) (fastdebug build 17.0.3-internal+0-adhoc..jdk17u)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 17.0.3-internal+0-adhoc..jdk17u, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, parallel gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xc0d809] frame::verify_deopt_original_pc(CompiledMethod*, long*)+0xa9
cat: '/var/datadog/dumps/java-error-prof-analyzer-hotdog-ludovic-99df8d6c-z6p6v_88936.log^C': No such file or directory
import java.nio.file.Paths;
import java.util.*;
import java.util.zip.GZIPOutputStream;
import java.time.*;
import java.io.*;
import jdk.jfr.*;
import jdk.jfr.consumer.*;
class IntervalBuilder {

Keybase proof

I hereby claim:

  • I am luhenry on github.
  • I am luhenry (https://keybase.io/luhenry) on keybase.
  • I have a public key ASClHVTuQBUNcRSJTwUV9xP2C-5eTD0lif6OFFYHXTNMqgo

To claim this, I am signing this object:

diff --git a/dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java b/dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java
index 631425973..fb75d53dc 100644
--- a/dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java
+++ b/dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java
@@ -16,6 +16,8 @@ import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import javax.annotation.Nonnull;
+import jdk.jfr.RecordingContext;
+import jdk.jfr.RecordingContextEntry;
docker run --rm -v ~/git:/backup --mount source=git,destination=/workspace,readonly ubuntu bash -cxe 'apt-get update -y; apt-get install -y rsync; rsync -arv /workspace/* /backup'
a.out: main.c
gcc $< -o $@ -ldl
libhijack.so: hijack.c
gcc $< -shared -o $@
libhelper.so: helper.c
gcc $< -shared -o $@
run: a.out libhijack.so libhelper.so
[info] OpenJDK 64-Bit Server VM 11.0.11+9-LTS on Linux 5.8.0-50-generic
[info] Intel(R) Xeon(R) E-2276G CPU @ 3.80GHz
[info]
[info] f2jBLAS = dev.ludovic.netlib.blas.NetlibF2jBLAS
[info] javaBLAS = dev.ludovic.netlib.blas.Java11BLAS
[info] nativeBLAS = dev.ludovic.netlib.blas.JNIBLAS
[info]
[info] daxpy: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
[info] ------------------------------------------------------------------------------------------------------------------------
[info] f2j 195 201 5 512.9 1.9 1.0X