-
Bug
-
Resolution: Duplicate
-
P4
-
23
I noticed this when running a micro benchmark from https://github.com/franz1981/java-puzzles
$ java -XX:+PrintCompilation -jar target/benchmark.jar -f 0 LockCoarsening.reentrantLocal
...
1151 763 ! 4 red.hat.puzzles.concurrent.LockCoarsening::reentrantLocal (36 bytes) COMPILE SKIPPED:
...
The reason is missing. The code producing that string is at:
https://github.com/openjdk/jdk/blob/f54e59835492e86b9178b2050901579707f41100/src/hotspot/share/opto/compile.cpp#L780
The string seems to be created in the resource area, a pointer to it stored somewhere and then the pointer is dereferenced after the buffer has been reclaimed. So it seems we're lucky here that there's no crash or garbage being printed.
$ java -XX:+PrintCompilation -jar target/benchmark.jar -f 0 LockCoarsening.reentrantLocal
...
1151 763 ! 4 red.hat.puzzles.concurrent.LockCoarsening::reentrantLocal (36 bytes) COMPILE SKIPPED:
...
The reason is missing. The code producing that string is at:
https://github.com/openjdk/jdk/blob/f54e59835492e86b9178b2050901579707f41100/src/hotspot/share/opto/compile.cpp#L780
The string seems to be created in the resource area, a pointer to it stored somewhere and then the pointer is dereferenced after the buffer has been reclaimed. So it seems we're lucky here that there's no crash or garbage being printed.
- duplicates
-
JDK-8325095 C2: bailout message broken: ResourceArea allocated string used after free
- Resolved