RFR: 8294580: frame::interpreter_frame_print_on() crashes if free BasicObjectLock exists in frame

Richard Reingruber rrich at openjdk.org
Fri Sep 30 05:59:42 UTC 2022


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()

-------------

Commit messages:
 - Add null check

Changes: https://git.openjdk.org/jdk/pull/10486/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10486&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8294580
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/10486.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10486/head:pull/10486

PR: https://git.openjdk.org/jdk/pull/10486


More information about the hotspot-dev mailing list