-
Bug
-
Resolution: Fixed
-
P2
-
17, 20, 21, 22
-
b13
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8315643 | 21.0.1 | Roman Marchenko | P2 | Closed | Fixed | b10 |
JDK-8316404 | 17.0.10-oracle | Tobias Hartmann | P2 | Closed | Fixed | b01 |
JDK-8315861 | 17.0.10 | Roman Marchenko | P2 | Resolved | Fixed | b01 |
OS X + Linux
A DESCRIPTION OF THE PROBLEM :
JitRex creates bytecode in a pre-stackmaps manner. In some cases, this bytecode can crash the JVM.
Example provided later in this form.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Adjust the path to Java in repro.sh to point to 17.0.8 (and possibly others as well).
Run ./repro.sh
JVM will crash - # SIGSEGV (0xb) at pc=0x00000001064e5c10, pid=96307, tid=25347
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JVM should not crash, and executes the bytecode to perform regex matching.
ACTUAL -
JVM crashes:
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000001064e5c10, pid=96307, tid=25347
---------- BEGIN SOURCE ----------
Requires jitrex 0.1.20.jar
I've also uploaded the .tgz file here: https://filetransfer.io/data-package/rM9xhQMu#link
It should contain 3 files
* jitrex
* repro.sh
* ReproSimple.java
--------- .sh file --------
#!/bin/bash
set -e
LIBS=jitrex-0.1.20.jar
# ADJUST THIS:
JAVA_BIN=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin
JAVA_FLAGS="-Xms2G -Xmx4G -Xss1M -Xlog:jit*=debug:file=./jit_humio.log:time,tags:filecount=5,filesize=1024000"
javac -classpath ${LIBS} ReproSimple.java
${JAVA_BIN}/java -classpath .:${LIBS} ${JAVA_FLAGS} ReproSimple
------ Java File --------
import com.humio.jitrex.*;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
public class ReproSimple {
final static String regexPattern = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}),(\\S+),(\\S+),(\\S+),(\\S+),(\\S+),(\\S+),(\\S+),(\\S+),(\\S+),(\\S+),(.*)";
public static void main(String[] args) throws InterruptedException {
System.out.println("Starting");
work();
System.out.println("Ended");
}
static void work() {
String[] haystack = new String[] {
"2023-10-01 01:23:46,warn,maccle,Something happened.",
"",
"0".repeat(50)
};
long sum = 0;
for (int iter=1; iter<=100; iter++) {
System.out.print("("+iter+")");
Pattern p = Pattern.compile(regexPattern, 0);
Matcher m = p.matcher("");
for (int k=0; k<haystack.length; k++) {
for (int i=0; i < 1 * 1000 ; i++) {
m.reset(CharSeq.fromString(haystack[k]));
if (m.find()) {
sum += m.start() + m.end();
}
}
}
}
if (sum<0) System.out.println(sum);
}
static class CharSeq implements CharSequence {
ByteBuffer buf;
int start, end;
public static CharSeq fromString(String s) {
CharSeq r = new CharSeq();
r.buf = ByteBuffer.wrap(s.getBytes(StandardCharsets.ISO_8859_1));
r.start = 0;
r.end = r.buf.limit();
return r;
}
public int length() { return end - start; }
public char charAt(int index) {
if (index < 0 || start + index >= end) throw new IndexOutOfBoundsException("" + index);
return (char)(buf.get(start + index) & 0xFF);
}
public CharSequence subSequence(int start, int end) {
throw new UnsupportedOperationException();
}
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8315861 SIGSEGV in PhaseIdealLoop::build_loop_late_post_work due to bad immediate dominator info
-
- Resolved
-
-
JDK-8315643 SIGSEGV in PhaseIdealLoop::build_loop_late_post_work due to bad immediate dominator info
-
- Closed
-
-
JDK-8316404 SIGSEGV in PhaseIdealLoop::build_loop_late_post_work due to bad immediate dominator info
-
- Closed
-
- relates to
-
JDK-8280799 С2: assert(false) failed: cyclic dependency prevents range check elimination
-
- Resolved
-
-
JDK-8315920 C2: "control input must dominate current control" assert failure
-
- Resolved
-
-
JDK-8342330 C2: "node pinned on loop exit test?" assert failure
-
- Resolved
-
- links to
-
Commit openjdk/jdk17u-dev/bb2fcb89
-
Commit openjdk/jdk21u/efb11c1b
-
Commit openjdk/jdk/ed1ea5fe
-
Review openjdk/jdk17u-dev/1714
-
Review openjdk/jdk21u/124
-
Review openjdk/jdk/15399