On Thu, 11 Aug 2022 11:39:01 GMT, Robbin Ehn <r...@openjdk.org> wrote:

> > > > Thanks for giving this PR a spin. I pushed a fix for the aarch64 build 
> > > > problem (seems weird that GHA did not catch it).
> > > 
> > > 
> > > NP, thanks. I notice some other user of 
> > > owning_thread_from_monitor_owner() such as DeadlockCycle::print_on_with() 
> > > which asserts on "assert(adr != reinterpret_cast<void*>(1)) failed: must 
> > > convert to lock object".
> > 
> > 
> > Do you know by any chance which tests trigger this?
> 
> Yes, there is a couple of to choose from, I think the jstack cmd may be 
> easiest: jstack/DeadlockDetectionTest.java

I pushed a refactoring and fixes to the relevant code, and all users should now 
work correctly. It's passing test tiers1-3 and tier4 is running while I write 
this.

@robehn or @dholmes-ora I believe one of you mentioned somewhere (can't find 
the comment, though) that we might need to support the bytecode sequence 
monitorenter A; monitorenter B; monitorexit A; monitorexit B; properly. I have 
now made a testcase that checks this, and it does indeed fail with this PR, 
while passing with upstream. Also, the JVM spec doesn't mention anywhere that 
it is required that monitorenter/exit are properly nested. I'll have to fix 
this in the interpreter (JIT compilers refuse to compile not-properly-nested 
monitorenter/exit anyway).

See 
https://github.com/rkennke/jdk/blob/fast-locking/test/hotspot/jtreg/runtime/locking/TestUnstructuredLocking.jasm

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

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

Reply via email to