RFR: 8343321: Bad verify in LockStack::oops_do()

Stefan Karlsson stefank at openjdk.org
Mon Nov 4 13:27:32 UTC 2024


On Thu, 31 Oct 2024 12:46:26 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

> Hello,
> 
> Verifying the lock stack's consistency before calling do_oop on the content in the lock stack is unnecessary and may result in a crash. The call to do_oop will (potentially) only change oops already stored in the lock stack, not add or remove anything. If two (or more) oops were equal before doing do_oop on all oops, they will still be the equivalent after the operation. Hence, the consistensy check only needs to happen once, either before or after do_oops, and doing it before might crash, so I propose we remove it.
> 
> See exact crash details in the linked issue.

Changes requested by stefank (Reviewer).

src/hotspot/share/runtime/lockStack.inline.hpp line 219:

> 217: 
> 218: inline void LockStack::oops_do(OopClosure* cl) {
> 219:   verify("pre-oops-do");

It would be nice to have a comment stating that we don't perform the "pre-oops-do" check because this could is used by the GC to fix the oops.

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

PR Review: https://git.openjdk.org/jdk/pull/21806#pullrequestreview-2413058582
PR Review Comment: https://git.openjdk.org/jdk/pull/21806#discussion_r1827727810


More information about the hotspot-runtime-dev mailing list