JDK-8325095 : C2: bailout message broken: ResourceArea allocated string used after free
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21,22,23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-02-01
  • Updated: 2024-06-11
  • Resolved: 2024-03-05
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 21 JDK 22 JDK 23
21.0.4Fixed 22.0.2Fixed 23 b13Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Originally reported by [~kvn] in JDK-8324743.

As [~dlong] said, this is a regression of JDK-8303951.

JDK 22 and latest 23 produces strange message:

java -XX:CICompilerCount=1 -XX:-TieredCompilation X:+PrintCompilation -Xbatch -Xmx128m TestNestedLocks
154 1 b java.util.ArrayList::add (25 bytes)
159 2 b java.util.ArrayList::add (23 bytes)
162 3 !b TestNestedLocks::test (102 bytes)
162 3 !b TestNestedLocks::test (102 bytes) COMPILE SKIPPED: ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
182 4 % !b TestNestedLocks::main @ 18 (39 bytes)
184 5 !b TestNestedLocks::main (39 bytes)
637 4 % ! TestNestedLocks::main @ 18 (39 bytes) made not entrant
OOM caught in test

It looks like something was broken recently with bailout messages.
Comments
[jdk22u-fix-request] Approval Request from Aleksey Shipilëv Fixes the diagnostic regression in JDK 21. Does not apply cleanly, but easy to resolve. Fixes a regression that touches uninitialized memory in product bits, low-medium risk.
25-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk22u/pull/165 Date: 2024-04-25 11:53:24 +0000
25-04-2024

This looks like another backport where 22u ports aren't happening before 21u ports.
23-04-2024

[jdk21u-fix-request] Approval Request from Aleksey Shipilëv Fixes the diagnostic regression in JDK 21. Does not apply cleanly, but easy to resolve. Fixes a regression that touches uninitialized memory in product bits, low-medium risk.
23-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/522 Date: 2024-04-22 15:37:03 +0000
22-04-2024

Changeset: c5895558 Author: Emanuel Peter <epeter@openjdk.org> Date: 2024-03-05 06:35:32 +0000 URL: https://git.openjdk.org/jdk/commit/c589555845e61cdde5340aaa76fcc36b2753240d
05-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17710 Date: 2024-02-05 16:02:57 +0000
15-02-2024

As discussed with [~kvn] offline: Since there are potentially multiple failure_reasons around, and they can go beyond the scope of Compile and even ciEnv, we must store them in the scope of CompileTask. There is already other code that CHeap allocates strings, see failure_reason_on_C_heap in CompileTask. If we now do more CHeap allocation for these strings, we get ourselves into a difficult management problem, especially since there can be multiple failure_reasons at a time. Thus, we will introduce an arena at the CompileTask level, so that strings can be allocated for the duration of CompileTask, and automatically deallocated afterwards.
05-02-2024

ILW = Broken bailout message on C2 compilation bailout, on bailout with single test, no workaround = MLH = P4
01-02-2024