JDK-8357380 : java/lang/StringBuilder/RacingSBThreads.java times out with C1
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 25,26
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-05-20
  • Updated: 2025-09-26
  • Resolved: 2025-07-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25 JDK 26
25-pool-oracleUnresolved 26 b08Fixed
Related Reports
Relates :  
Relates :  
Description
Test
java/lang/StringBuilder/RacingSBThreads.java
times out when executed 
 -XX:TieredStopAtLevel=2/3

Stack dump shows that test is still working, so might be it is too slow when C1 is used.

Part of stack:

"Thread-5" #41 [2977413] prio=5 os_prio=0 cpu=294682.70ms elapsed=301.66s allocated=57363M defined_classes=0 tid=0x00007f65cc041160 nid=2977413 runnable  [0x00007f6650421000]
   java.lang.Thread.State: RUNNABLE
Thread: 0x00007f65cc041160  [0x2d6e85] State: _at_safepoint _at_poll_safepoint 1
   JavaThread state: _thread_blocked
	at java.lang.StringUTF16.inflate(java.base@25-ea/StringUTF16.java:1593)
	at java.lang.StringLatin1.inflate(java.base@25-ea/StringLatin1.java:775)
	at java.lang.AbstractStringBuilder.ensureCapacityNewCoder(java.base@25-ea/AbstractStringBuilder.java:288)
	at java.lang.AbstractStringBuilder.append(java.base@25-ea/AbstractStringBuilder.java:650)
	at java.lang.StringBuilder.append(java.base@25-ea/StringBuilder.java:179)
	at RacingSBThreads$Writer.createShrink(RacingSBThreads.java:289)
	at RacingSBThreads$Writer.access$300(RacingSBThreads.java:267)
	at RacingSBThreads.lambda$stress$0(RacingSBThreads.java:174)
	at RacingSBThreads$$Lambda/0x00007f65fb044220.run(Unknown Source)
	at java.lang.Thread.runWith(java.base@25-ea/Thread.java:1460)
	at java.lang.Thread.run(java.base@25-ea/Thread.java:1447)

   Locked ownable synchronizers:
	- None

"Thread-6" #42 [2977414] prio=5 os_prio=0 cpu=294982.99ms elapsed=301.66s allocated=65508M defined_classes=0 tid=0x00007f65cc047760 nid=2977414 runnable  [0x00007f6650320000]
   java.lang.Thread.State: RUNNABLE
Thread: 0x00007f65cc047760  [0x2d6e86] State: _at_safepoint _at_poll_safepoint 1
   JavaThread state: _thread_blocked
	at java.lang.StringUTF16.inflate(java.base@25-ea/StringUTF16.java:1593)
	at java.lang.StringLatin1.inflate(java.base@25-ea/StringLatin1.java:775)
	at java.lang.AbstractStringBuilder.inflateToUTF16(java.base@25-ea/AbstractStringBuilder.java:324)
	at java.lang.AbstractStringBuilder.appendChars(java.base@25-ea/AbstractStringBuilder.java:2035)
	at java.lang.AbstractStringBuilder.append(java.base@25-ea/AbstractStringBuilder.java:764)
	at java.lang.StringBuilder.append(java.base@25-ea/StringBuilder.java:218)
	at RacingSBThreads$StressKind.lambda$static$2(RacingSBThreads.java:142)
	at RacingSBThreads$StressKind$$Lambda/0x00007f65fb041b00.accept(Unknown Source)
	at RacingSBThreads$PokeBuilder.readModify(RacingSBThreads.java:234)
	at RacingSBThreads$PokeBuilder.access$400(RacingSBThreads.java:205)
	at RacingSBThreads.lambda$stress$1(RacingSBThreads.java:175)
	at RacingSBThreads$$Lambda/0x00007f65fb044458.run(Unknown Source)
	at java.lang.Thread.runWith(java.base@25-ea/Thread.java:1460)
	at java.lang.Thread.run(java.base@25-ea/Thread.java:1447)

Comments
Changeset: 30d20036 Branch: master Author: Roger Riggs <rriggs@openjdk.org> Date: 2025-07-18 16:40:28 +0000 URL: https://git.openjdk.org/jdk/commit/30d20036987c9d68eb76b1e0401821386a76bb07
18-07-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26389 Date: 2025-07-18 15:06:33 +0000
18-07-2025

The timeout had nothing to do with additional flags, the combination of -Xcomp and debug build and slower machines resulted in the timeout. Reducing the cpu time by cutting the number of trial iterations from 10 million to 1 million.
18-07-2025

There is little benefit of running this test with arbitrary flags. Adding `* @requires vm.flagless` would cut down on the edge cases that raise the cpu time.
17-07-2025

ILW = Test timeout when running with C1 only, two tests, no known workaround other than running with C2 enabled = MLH = P4
20-05-2025