Open viktoriia-fomina opened 1 year ago
hi, Allow me to repeat your problem: Your java program works perfectly fine on Windows but fail on WSL2/Ubuntu? What corretto-11 binary are you using in WSL2/Ubuntu?
Can you reliably trigger the same error? The crash report such as (hs_err_pid32716.log) is helpful here. Please upload it.
I don't think hsdis matters unless you need to read the assembly code. Message "Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled" is a warning not an error. it won't cause the crash of hotspot.
hi, Allow me to repeat your problem: Your java program works perfectly fine on Windows but fail on WSL2/Ubuntu? What corretto-11 binary are you using in WSL2/Ubuntu?
Can you reliably trigger the same error? The crash report such as (hs_err_pid32716.log) is helpful here. Please upload it.
I don't think hsdis matters unless you need to read the assembly code. Message "Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled" is a warning not an error. it won't cause the crash of hotspot.
Hi! Exactly!
I forgot to add an important notice. The program crashes after usage of JavaCPP Presets, but it can crash at different time. Sometimes it crashes even after all the interactions with JavaCPP Presets.
I use corretto 11.0.17.8.1. It was installed with:
wget -O- https://apt.corretto.aws/corretto.key | sudo apt-key add -
sudo add-apt-repository 'deb https://apt.corretto.aws stable main'
sudo apt-get update && sudo apt-get install -y java-11-amazon-corretto-jdk
SIGSEGV (0xb) at pc=0x00007f3c44e7f14a (sent by kill), pid=32716, tid=5160
at
J 476 c1 sun.reflect.generics.parser.SignatureParser.advance()V java.base@11.0.17 (53 bytes) @ 0x00007f3c44e7f14a [0x00007f3c44e7efe0+0x000000000000016a]
SIGSEGV (0xb) at pc=0x00007f3c44e7f14a (sent by kill), pid=32716, tid=5160
at
J 476 c1 sun.reflect.generics.parser.SignatureParser.advance()V java.base@11.0.17 (53 bytes) @ 0x00007f3c44e7f14a [0x00007f3c44e7efe0+0x000000000000016a]
I ran some test twice and got SIGSEGV
at different places:
J 1935 c1 java.util.concurrent.CopyOnWriteArrayList.size()I java.base@11.0.17 (6 bytes) @ 0x00007f111d14903f [0x00007f111d148fc0+0x000000000000007f]
and
J 1666 c2 java.lang.Object.<init>()V java.base@11.0.17 (1 bytes) @ 0x00007fb528387380 [0x00007fb528387320+0x0000000000000060]
JVM crash is not reproducible with JDK 17 (Amazon Corretto 17.0.6). I tried to run project with Azul JDK:
IMPLEMENTOR="Azul Systems, Inc."
IMPLEMENTOR_VERSION="Zulu11.60+19-CA"
JAVA_VERSION="11.0.17"
It also led to JVM crash.
Describe the bug
I use JavaCPP Presets library for LLVM. It's used to interact with Clang through LibClang API from Java.
I built small project from examples of JavaCPP Presets and successfully interacted with Clang from it (both on WSL2 and Windows 10, with same JDK).
When I integrated these logic into my project (unfortunately, I'm not able to provide the code), it led to JVM crash on the code interacting with Clang from WSL2. Everything works on Windows 10 for my project!
The program fails on WSL2 with such error:
``` # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f85e02cdd7b (sent by kill), pid=15477, tid=20403 # # JRE version: OpenJDK Runtime Environment Corretto-11.0.17.8.1 (11.0.17+8) (build 11.0.17+8-LTS) # Java VM: OpenJDK 64-Bit Server VM Corretto-11.0.17.8.1 (11.0.17+8-LTS, mixed mode, tiered, compressed oops, g1 gc, linux-amd64) # Problematic frame: # J 170 c1 java.util.jar.Attributes$Name.hashCode()I java.base@11.0.17 (5 bytes) @ 0x00007f85e02cdd7b [0x00007f85e02cdd40+0x000000000000003b] # # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /home/user/[git-project-hosting]/[project]/[subproject]/hs_err_pid15477.log Compiled method (c1) 2514 629 3 java.util.jar.Attributes::getValue (9 bytes) total in heap [0x00007f85d8ea8f90,0x00007f85d8ea9550] = 1472 relocation [0x00007f85d8ea9108,0x00007f85d8ea9150] = 72 main code [0x00007f85d8ea9160,0x00007f85d8ea9440] = 736 stub code [0x00007f85d8ea9440,0x00007f85d8ea9480] = 64 metadata [0x00007f85d8ea9480,0x00007f85d8ea9498] = 24 scopes data [0x00007f85d8ea9498,0x00007f85d8ea94c8] = 48 scopes pcs [0x00007f85d8ea94c8,0x00007f85d8ea9538] = 112 dependencies [0x00007f85d8ea9538,0x00007f85d8ea9540] = 8 nul chk table [0x00007f85d8ea9540,0x00007f85d8ea9550] = 16 Compiled method (c1) 2516 50 3 java.util.LinkedHashMap::get (33 bytes) total in heap [0x00007f85d8d9e290,0x00007f85d8d9ea08] = 1912 relocation [0x00007f85d8d9e408,0x00007f85d8d9e470] = 104 main code [0x00007f85d8d9e480,0x00007f85d8d9e860] = 992 stub code [0x00007f85d8d9e860,0x00007f85d8d9e8c0] = 96 metadata [0x00007f85d8d9e8c0,0x00007f85d8d9e8d8] = 24 scopes data [0x00007f85d8d9e8d8,0x00007f85d8d9e958] = 128 scopes pcs [0x00007f85d8d9e958,0x00007f85d8d9e9e8] = 144 dependencies [0x00007f85d8d9e9e8,0x00007f85d8d9e9f0] = 8 nul chk table [0x00007f85d8d9e9f0,0x00007f85d8d9ea08] = 24 Compiled method (c1) 2516 1609 3 sun.net.www.ParseUtil::canonizeString (38 bytes) total in heap [0x00007f85d9086d10,0x00007f85d90879e8] = 3288 relocation [0x00007f85d9086e88,0x00007f85d9086f50] = 200 main code [0x00007f85d9086f60,0x00007f85d90876a0] = 1856 stub code [0x00007f85d90876a0,0x00007f85d9087710] = 112 metadata [0x00007f85d9087710,0x00007f85d9087758] = 72 scopes data [0x00007f85d9087758,0x00007f85d9087868] = 272 scopes pcs [0x00007f85d9087868,0x00007f85d90879b8] = 336 dependencies [0x00007f85d90879b8,0x00007f85d90879c0] = 8 nul chk table [0x00007f85d90879c0,0x00007f85d90879e8] = 40 Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled # # If you would like to submit a bug report, please visit: # https://github.com/corretto/corretto-11/issues/ # Aborted Process finished with exit code 134 ```I can provide the information from error report
/home/user/[git-project-hosting]/[project]/[subproject]/hs_err_pid15477.log
if you require . File text is too long to be applied here.I tried to solve the problem. It's described in additional context.
To Reproduce
I cannot provide steps to reproduce as I cannot provide the code.
Expected behavior
I expect my code works on WSL2 with JDK 11 (as it does on Windows 10 now).
Screenshots
Screenshots are not attached.
Platform information
Additional context
I tried to build hsdis-amd64.so as it described in article and put it to
/usr/lib/jvm/java-11-amazon-corretto/lib
.I used two ways (in both of them I used binutils-2.28):
./src/utils/hsdis
directory in the repository, ranmake BINUTILS=../../../../binutils-2.28 ARCH=amd64
.Result (error):
jdk-11+11
tag, opened./src/utils/hsdis
directory in the repository, ranmake BINUTILS=../../../../binutils-2.28 ARCH=amd64
.Result: I got
hsdis-amd64.so
and put it to/usr/lib/jvm/java-11-amazon-corretto/lib
.Then I ran the project and got same error with different description below (Loaded disassembler from /usr/lib/jvm/java-11-amazon-corretto/lib/hsdis-amd64.so):
``` # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f3c44e7f14a (sent by kill), pid=32716, tid=5160 # # JRE version: OpenJDK Runtime Environment Corretto-11.0.17.8.1 (11.0.17+8) (build 11.0.17+8-LTS) # Java VM: OpenJDK 64-Bit Server VM Corretto-11.0.17.8.1 (11.0.17+8-LTS, mixed mode, tiered, compressed oops, g1 gc, linux-amd64) # Problematic frame: # J 476 c1 sun.reflect.generics.parser.SignatureParser.advance()V java.base@11.0.17 (53 bytes) @ 0x00007f3c44e7f14a [0x00007f3c44e7efe0+0x000000000000016a] # # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /home/user/codehub/kirin-new/kirin/kirin-parse/hs_err_pid32716.log Compiled method (c1) 2095 1668 3 sun.reflect.generics.parser.SignatureParser::skipIdentifier (67 bytes) total in heap [0x00007f3c450add10,0x00007f3c450ae608] = 2296 relocation [0x00007f3c450ade88,0x00007f3c450adf20] = 152 main code [0x00007f3c450adf20,0x00007f3c450ae420] = 1280 stub code [0x00007f3c450ae420,0x00007f3c450ae4a0] = 128 metadata [0x00007f3c450ae4a0,0x00007f3c450ae4c0] = 32 scopes data [0x00007f3c450ae4c0,0x00007f3c450ae520] = 96 scopes pcs [0x00007f3c450ae520,0x00007f3c450ae5f0] = 208 dependencies [0x00007f3c450ae5f0,0x00007f3c450ae5f8] = 8 nul chk table [0x00007f3c450ae5f8,0x00007f3c450ae608] = 16 Loaded disassembler from /usr/lib/jvm/java-11-amazon-corretto/lib/hsdis-amd64.so # # If you would like to submit a bug report, please visit: # https://github.com/corretto/corretto-11/issues/ # Aborted Process finished with exit code 134 ```I can provide the information from error report
/home/user/[git-project-hosting]/[project]/[subproject]/hs_err_pid32716.log
if you require.