RFR: 8294580: frame::interpreter_frame_print_on() crashes if free BasicObjectLock exists in frame
Richard Reingruber
rrich at openjdk.org
Tue Oct 4 11:52:11 UTC 2022
On Thu, 29 Sep 2022 12:49:27 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
> Add null check before dereferencing BasicObjectLock::_obj.
> BasicObjectLocks are marked as free by setting _obj to null.
>
> I've done manual testing:
>
>
> ./images/jdk/bin/java -Xlog:continuations=trace -XX:+VerifyContinuations --enable-preview VTSleepAfterUnlock
>
>
> with the test attached to the JBS item.
>
> Example output:
>
>
> [0.349s][trace][continuations] Interpreted frame (sp=0x000000011d5c6398 unextended sp=0x000000011d5c63b8, fp=0x000000011d5c6420, real_fp=0x000000011d5c6420, pc=0x00007f0ff0199c6a)
> [0.349s][trace][continuations] ~return entry points [0x00007f0ff0199820, 0x00007f0ff019a2e8] 2760 bytes
> [0.349s][trace][continuations] - local [0x000000011d5c3550]; #0
> [0.349s][trace][continuations] - local [0x000000011d5c3550]; #1
> [0.349s][trace][continuations] - local [0x0000000000000000]; #2
> [0.349s][trace][continuations] - stack [0x0000000000000064]; #1
> [0.349s][trace][continuations] - stack [0x0000000000000000]; #0
> [0.349s][trace][continuations] - obj [null]
> [0.349s][trace][continuations] - lock [monitor mark(is_neutral no_hash age=0)]
> [0.349s][trace][continuations] - monitor[0x000000011d5c63d8]
> [0.349s][trace][continuations] - bcp [0x00007f0fa8400401]; @17
> [0.349s][trace][continuations] - locals [0x000000011d5c6440]
> [0.349s][trace][continuations] - method [0x00007f0fa8400430]; virtual void VTSleepAfterUnlock.sleepAfterUnlock()
Hi David,
> Seems quite reasonable. I'm guessing we now print frames in different contexts to what we used to and so now find unlocked BasicObjectLocks.
The fix for JDK-8290718 changed `VerifyStackChunkFrameClosure::do_frame()` to call `StackChunkFrameStream<frames>::print_on()`which delegates to `frame::interpreter_frame_print_on()`. Before that `AllocatedObj::print_value_on()` was called (see https://github.com/openjdk/jdk/commit/f714ac52bfe95b5a94e3994656438ef2aeab2c86#diff-a8b7bc88a1deed1885629c925d53059a9835f58ae29ec4bce7503d31e1029495).
Thanks for the review,
Richard.
-------------
PR: https://git.openjdk.org/jdk/pull/10486
More information about the hotspot-dev
mailing list