-
Bug
-
Resolution: Fixed
-
P2
-
9
-
b105
-
Verified
The debug "exactness" check produces a wrong bytecode when a no-arg method is pushed to StringConcatFactory BSM. This happens only with -Djava.lang.invoke.stringConcat.debug=true, and -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT. Note that no Java language string concat expression would result in javac emitting a no-arg SCF call, and we only have the failure on a targeted test that calls BSM directly.
A targeted test fails with:
Caused by: java.lang.VerifyError: Local variable table overflow
Exception Details:
Location:
java/lang/String$Concat.concat()Ljava/lang/String; @12: istore
Reason:
Local index 0 is invalid
Bytecode:
0000000: bb00 0959 03b7 000d 59b6 0011 3600 b600
0000010: 1459 b600 1915 009f 000d bb00 1b59 121d
0000020: b700 20bf b0
Stackmap Table:
same_locals_1_stack_item_frame(@36,Object[#22])
at sun.misc.Unsafe.defineAnonymousClass(Native Method)
at java.lang.invoke.StringConcatFactory$BytecodeStringBuilderStrategy.generate(StringConcatFactory.java:1024)
at java.lang.invoke.StringConcatFactory$BytecodeStringBuilderStrategy.access$000(StringConcatFactory.java:732)
at java.lang.invoke.StringConcatFactory.generate(StringConcatFactory.java:656)
... 11 more
In turn, this happens because "exactness" check needs a single slot to hold a temporary variable. In the case of non-arg method, local variable table is not large enough, and it overflows.
A targeted test fails with:
Caused by: java.lang.VerifyError: Local variable table overflow
Exception Details:
Location:
java/lang/String$Concat.concat()Ljava/lang/String; @12: istore
Reason:
Local index 0 is invalid
Bytecode:
0000000: bb00 0959 03b7 000d 59b6 0011 3600 b600
0000010: 1459 b600 1915 009f 000d bb00 1b59 121d
0000020: b700 20bf b0
Stackmap Table:
same_locals_1_stack_item_frame(@36,Object[#22])
at sun.misc.Unsafe.defineAnonymousClass(Native Method)
at java.lang.invoke.StringConcatFactory$BytecodeStringBuilderStrategy.generate(StringConcatFactory.java:1024)
at java.lang.invoke.StringConcatFactory$BytecodeStringBuilderStrategy.access$000(StringConcatFactory.java:732)
at java.lang.invoke.StringConcatFactory.generate(StringConcatFactory.java:656)
... 11 more
In turn, this happens because "exactness" check needs a single slot to hold a temporary variable. In the case of non-arg method, local variable table is not large enough, and it overflows.
- duplicates
-
JDK-8148764 SIGSEGV: java/lang/String/concat/StringConcatFactoryInvariants.java
-
- Closed
-
-
JDK-8148765 Compilation fails with assert(index < _size) failed: BitMap index out of bounds
-
- Closed
-
- relates to
-
JDK-8148764 SIGSEGV: java/lang/String/concat/StringConcatFactoryInvariants.java
-
- Closed
-
-
JDK-8148765 Compilation fails with assert(index < _size) failed: BitMap index out of bounds
-
- Closed
-