-
Bug
-
Resolution: Fixed
-
P4
-
10, 11, 12
-
b24
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8227518 | 11.0.6-oracle | Nils Eliasson | P4 | Resolved | Fixed | b01 |
JDK-8233502 | 11.0.6 | Nils Eliasson | P4 | Resolved | Fixed | b02 |
Quoted from hotspot-compiler-dev@openjdk.java.net:
"Hello,
I’m posting this to the group since I can’t open a bug report against OpenJDK – I only have browsing privileges.
compilerDirectives.cpp is using the MT-Unsafe strtok function. This is causing some JVM crashes with our application under linux-x86_64 since some of our native code run via JNI is also using strtok. Fixing either our code or HotSpot to use strtok_r resolves the issue. We started seeing this problem after upgrading to OpenJDK 11 from Oracle JDK 8, which didn’t trigger any crashes.
Problematic lines:
https://hg.openjdk.java.net/jdk/jdk11/file/1ddf9a99e4ad/src/hotspot/share/compiler/compilerDirectives.cpp#l402
https://hg.openjdk.java.net/jdk/jdk11/file/1ddf9a99e4ad/src/hotspot/share/compiler/compilerDirectives.cpp#l407
Fixing this would make the compiler immune from other JNI code (or other JVM code) that could be using strtok.
The following details a survey of HotSpot that was done a long time ago to identify all occurrences of MT-unsafe functions:
https://bugs.openjdk.java.net/browse/JDK-4647546
I understand the latter goes beyond the scope of the compiler group.
Thanks,
Andre <Andre.Gillet@nuance.com>
"Hello,
I’m posting this to the group since I can’t open a bug report against OpenJDK – I only have browsing privileges.
compilerDirectives.cpp is using the MT-Unsafe strtok function. This is causing some JVM crashes with our application under linux-x86_64 since some of our native code run via JNI is also using strtok. Fixing either our code or HotSpot to use strtok_r resolves the issue. We started seeing this problem after upgrading to OpenJDK 11 from Oracle JDK 8, which didn’t trigger any crashes.
Problematic lines:
https://hg.openjdk.java.net/jdk/jdk11/file/1ddf9a99e4ad/src/hotspot/share/compiler/compilerDirectives.cpp#l402
https://hg.openjdk.java.net/jdk/jdk11/file/1ddf9a99e4ad/src/hotspot/share/compiler/compilerDirectives.cpp#l407
Fixing this would make the compiler immune from other JNI code (or other JVM code) that could be using strtok.
The following details a survey of HotSpot that was done a long time ago to identify all occurrences of MT-unsafe functions:
https://bugs.openjdk.java.net/browse/JDK-4647546
I understand the latter goes beyond the scope of the compiler group.
Thanks,
Andre <Andre.Gillet@nuance.com>
- backported by
-
JDK-8227518 Replace use of thread unsafe strtok
-
- Resolved
-
-
JDK-8233502 Replace use of thread unsafe strtok
-
- Resolved
-