Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault in libj9jit29.so when building jzenith using openjdk14 #10004

Closed
mayshukla opened this issue Jun 24, 2020 · 3 comments
Closed

Segfault in libj9jit29.so when building jzenith using openjdk14 #10004

mayshukla opened this issue Jun 24, 2020 · 3 comments

Comments

@mayshukla
Copy link
Contributor

Java -version output

I have encountered the segfault with a nightly build from adoptopenjdk and also with the jdk-14.0.1+7 release.

Nightly version info:

openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 14.0.1+7-202006212030)
Eclipse OpenJ9 VM AdoptOpenJDK (build master-89b56ca9e, JRE 14 Linux amd64-64-Bit Compressed References 20200621_123 (JIT enabled, AOT enabled)
OpenJ9   - 89b56ca9e
OMR      - 2564a0890
JCL      - 8cc2367838 based on jdk-14.0.1+7)

Release version info:

openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 14.0.1+7)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.20.0, JRE 14 Linux amd64-64-Bit Compressed References 20200416_44 (JIT enabled, AOT enabled)
OpenJ9   - 05fa2d361
OMR      - d4365f371
JCL      - 5757187cae based on jdk-14.0.1+7)

Summary of problem

I am running into a segfault in javac when trying to build jzenith (https://github.com/marcust/jzenith) using openjdk14 with openj9. I encountered the segfault when using a nightly from adoptopenjdk and also the jdk-14.0.1+7 release. The segfault does not occur when I build using hotspot.

Steps to reproduce:

git clone https://github.com/marcust/jzenith.git
cd jzenith
export JAVA_HOME=<path to jdk>
mvn clean install

Console output:

[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jzenith-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to /root/jzenith-stuff/jzenith/jzenith-core/target/classes
Unhandled exception
Type=Segmentation error vmState=0x00000000
J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001
Handler1=00007F7395AFB0D0 Handler2=00007F73953EAA60 InaccessibleAddress=0000000000000001
RDI=0000000000014E00 RSI=0000000000000001 RAX=00000000FFFA5D48 RBX=00000000FFFA5D48
RCX=0000000000093400 RDX=0000000000093400 R8=0000000000000002 R9=00000000C3D36118
R10=00000000000AA700 R11=0000000000000000 R12=0000000000000001 R13=0000000000000002
R14=00000000FFA97C48 R15=00000000C4008F50
RIP=00007F738FB33069 GS=0000 FS=0000 RSP=000000000059BDD8
EFlags=0000000000010202 CS=0033 RBP=0000000000014E00 ERR=0000000000000004
TRAPNO=000000000000000E OLDMASK=0000000000000000 CR2=0000000000000001
xmm0 0000000000000005 (f: 5.000000, d: 2.470328e-323)
xmm1 7373656363416b63 (f: 1665231744.000000, d: 1.356156e+248)
xmm2 00007f7396a37670 (f: 2527294976.000000, d: 6.923561e-310)
xmm3 0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm4 43e0000000000000 (f: 0.000000, d: 9.223372e+18)
xmm5 000000003e000317 (f: 1040188160.000000, d: 5.139212e-315)
xmm6 0000000049d45920 (f: 1238653184.000000, d: 6.119760e-315)
xmm7 0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm8 000000000001b6a8 (f: 112296.000000, d: 5.548160e-319)
xmm9 000000000001b6a7 (f: 112295.000000, d: 5.548110e-319)
xmm10 3f8eb851eb851eb9 (f: 3951369984.000000, d: 1.500000e-02)
xmm11 0000000044c00000 (f: 1153433600.000000, d: 5.698719e-315)
xmm12 000000004119b2a7 (f: 1092203136.000000, d: 5.396201e-315)
xmm13 0000000048000000 (f: 1207959552.000000, d: 5.968113e-315)
xmm14 0000000042400000 (f: 1111490560.000000, d: 5.491493e-315)
xmm15 00000000486600e0 (f: 1214644480.000000, d: 6.001141e-315)
Module=/root/jzenith-stuff/jdks/jdk14-openj9/lib/compressedrefs/libj9jit29.so
Module_base_address=00007F738F1E2000
Target=2_90_20200621_123 (Linux 4.15.0-66-generic)
CPU=amd64 (2 logical CPUs) (0xf68f3000 RAM)
----------- Stack Backtrace -----------
(0x00007F739541B092 [libj9prt29.so+0x4b092])
(0x00007F73953EB7C3 [libj9prt29.so+0x1b7c3])
(0x00007F739541B10E [libj9prt29.so+0x4b10e])
(0x00007F739541B204 [libj9prt29.so+0x4b204])
(0x00007F73953EB7C3 [libj9prt29.so+0x1b7c3])
(0x00007F739541AF6B [libj9prt29.so+0x4af6b])
(0x00007F7395AFAC14 [libj9vm29.so+0x93c14])
(0x00007F73953EB7C3 [libj9prt29.so+0x1b7c3])
(0x00007F7395AFAE85 [libj9vm29.so+0x93e85])
(0x00007F7395B283C5 [libj9vm29.so+0xc13c5])
---------------------------------------

Diagnostic files

I have attached a javacore and jitdump. I also have a core dump but it is too large to upload to github.

javacore-and-jitdump.tar.gz

Here is a backtrace from the javacore:

1XMCURTHDINFO  Current thread
3XMTHREADINFO      "main" J9VMThread:0x0000000000014E00, omrthread_t:0x00007FA7CC007050, java/lang/Thread:0x00000000C2643278, state:R, prio=5
3XMJAVALTHREAD            (java/lang/Thread getId:0x1, isDaemon:false)
3XMTHREADINFO1            (native thread ID:0x4B08, native priority:0x5, native policy:UNKNOWN, vmstate:R, vm thread flags:0x00000020)
3XMTHREADINFO2            (native stack address range from:0x00007FA7D3820000, to:0x00007FA7D4021000, size:0x801000)
3XMCPUTIME               CPU usage total: 19.581562103 secs, current category="Application"
3XMHEAPALLOC             Heap bytes allocated since last GC cycle=446400 (0x6CFC0)
3XMTHREADINFO3           Java callstack:
4XESTACKTRACE                at java/lang/reflect/Field.checkAccess(Field.java:1073)
4XESTACKTRACE                at java/lang/reflect/Field.get(Field.java:414(Compiled Code))
4XESTACKTRACE                at lombok/javac/apt/LombokProcessor.stopJavacProcessingEnvironmentFromClosingOurClassloader(LombokProcessor.java:276)
4XESTACKTRACE                at lombok/javac/apt/LombokProcessor.placePostCompileAndDontMakeForceRoundDummiesHook(LombokProcessor.java:150)
4XESTACKTRACE                at lombok/javac/apt/LombokProcessor.init(LombokProcessor.java:93)
4XESTACKTRACE                at lombok/core/AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:124)
4XESTACKTRACE                at lombok/core/AnnotationProcessor.init(AnnotationProcessor.java:177)
4XESTACKTRACE                at lombok/launch/AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:73)
4XESTACKTRACE                at com/sun/tools/javac/processing/JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:702)
4XESTACKTRACE                at com/sun/tools/javac/processing/JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:830)
4XESTACKTRACE                at com/sun/tools/javac/processing/JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:926)
4XESTACKTRACE                at com/sun/tools/javac/processing/JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1270)
4XESTACKTRACE                at com/sun/tools/javac/processing/JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1384)
4XESTACKTRACE                at com/sun/tools/javac/main/JavaCompiler.processAnnotations(JavaCompiler.java:1263)
4XESTACKTRACE                at com/sun/tools/javac/main/JavaCompiler.compile(JavaCompiler.java:935)
4XESTACKTRACE                at com/sun/tools/javac/api/JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
4XESTACKTRACE                at com/sun/tools/javac/api/JavacTaskImpl$$Lambda$75/0000000000000000.call(Bytecode PC:4)
4XESTACKTRACE                at com/sun/tools/javac/api/JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147)
4XESTACKTRACE                at com/sun/tools/javac/api/JavacTaskImpl.doCall(JavacTaskImpl.java:100)
4XESTACKTRACE                at com/sun/tools/javac/api/JavacTaskImpl.call(JavacTaskImpl.java:94)
4XESTACKTRACE                at org/codehaus/plexus/compiler/javac/JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
4XESTACKTRACE                at org/codehaus/plexus/compiler/javac/JavacCompiler.performCompile(JavacCompiler.java:174)
4XESTACKTRACE                at org/apache/maven/plugin/compiler/AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1134)
4XESTACKTRACE                at org/apache/maven/plugin/compiler/CompilerMojo.execute(CompilerMojo.java:187)
4XESTACKTRACE                at org/apache/maven/plugin/DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
4XESTACKTRACE                at org/apache/maven/lifecycle/internal/MojoExecutor.execute(MojoExecutor.java:210)
4XESTACKTRACE                at org/apache/maven/lifecycle/internal/MojoExecutor.execute(MojoExecutor.java:156)
4XESTACKTRACE                at org/apache/maven/lifecycle/internal/MojoExecutor.execute(MojoExecutor.java:148)
4XESTACKTRACE                at org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
4XESTACKTRACE                at org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
4XESTACKTRACE                at org/apache/maven/lifecycle/internal/builder/singlethreaded/SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
4XESTACKTRACE                at org/apache/maven/lifecycle/internal/LifecycleStarter.execute(LifecycleStarter.java:128)
4XESTACKTRACE                at org/apache/maven/DefaultMaven.doExecute(DefaultMaven.java:305)
4XESTACKTRACE                at org/apache/maven/DefaultMaven.doExecute(DefaultMaven.java:192)
4XESTACKTRACE                at org/apache/maven/DefaultMaven.execute(DefaultMaven.java:105)
4XESTACKTRACE                at org/apache/maven/cli/MavenCli.execute(MavenCli.java:956)
4XESTACKTRACE                at org/apache/maven/cli/MavenCli.doMain(MavenCli.java:288)
4XESTACKTRACE                at org/apache/maven/cli/MavenCli.main(MavenCli.java:192)
4XESTACKTRACE                at jdk/internal/reflect/NativeMethodAccessorImpl.invoke0(Native Method)
4XESTACKTRACE                at jdk/internal/reflect/NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
4XESTACKTRACE                at jdk/internal/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
4XESTACKTRACE                at java/lang/reflect/Method.invoke(Method.java:564)
4XESTACKTRACE                at org/codehaus/plexus/classworlds/launcher/Launcher.launchEnhanced(Launcher.java:289)
4XESTACKTRACE                at org/codehaus/plexus/classworlds/launcher/Launcher.launch(Launcher.java:229)
4XESTACKTRACE                at org/codehaus/plexus/classworlds/launcher/Launcher.mainWithExitCode(Launcher.java:415)
4XESTACKTRACE                at org/codehaus/plexus/classworlds/launcher/Launcher.main(Launcher.java:356)
@DanHeidinga
Copy link
Member

This looks very similar to an issue with Lombok that was fixed recently: #6933 / projectlombok/lombok#2437

Are you able to test with a newer version of Lombok? I don't know if this fix has made it into a release yet so it may need to be built from scratch

@mayshukla
Copy link
Contributor Author

Following the instructions here https://projectlombok.org/download-edge, I changed the main pom.xml file in jzenith so that maven would install an edge release of Lombok.

I am no longer seeing the segfault but I'm getting this error:

[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jzenith-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to /root/jzenith-stuff/jzenith/jzenith-core/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /root/jzenith-stuff/jzenith/jzenith-core/src/main/java/org/jzenith/core/metrics/JvmOptionMetrics.java:[19,26] cannot find symbol
  symbol:   class VMOption
  location: package com.sun.management
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for jZenith Root Pom 0.2-SNAPSHOT:
[INFO]
[INFO] jZenith Root Pom ................................... SUCCESS [  5.543 s]
[INFO] jZenith Core ....................................... FAILURE [  6.166 s]
[INFO] jZenith REST Plugin ................................ SKIPPED
[INFO] jZenith PostgreSQL Plugin .......................... SKIPPED
[INFO] jZenith JDBC Plugin ................................ SKIPPED
[INFO] jZenith Redis Plugin ............................... SKIPPED
[INFO] jZenith MongoDB Plugin ............................. SKIPPED
[INFO] jZenith Kafka Plugin ............................... SKIPPED
[INFO] jZenith GraalVM Extras ............................. SKIPPED
[INFO] jZenith Examples ................................... SKIPPED
[INFO] Examples Common .................................... SKIPPED
[INFO] Example - MySQL .................................... SKIPPED
[INFO] Example - PostgreSQL ............................... SKIPPED
[INFO] Example - PostgreSQL with Plugin ................... SKIPPED
[INFO] Example - Redis .................................... SKIPPED
[INFO] Example - Mongodb .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  12.283 s
[INFO] Finished at: 2020-06-24T12:27:16-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project jzenith-core: Compilation failure
[ERROR] /root/jzenith-stuff/jzenith/jzenith-core/src/main/java/org/jzenith/core/metrics/JvmOptionMetrics.java:[19,26] cannot find symbol
[ERROR]   symbol:   class VMOption
[ERROR]   location: package com.sun.management

I think this new error is unrelated so I am closing this issue.

@mayshukla
Copy link
Contributor Author

Thanks for the help @DanHeidinga

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants