RFR: 8274687: JDWP can deadlock VM if Java thread waits in blockOnDebuggerSuspend
Richard Reingruber
rrich at openjdk.java.net
Mon Oct 4 14:26:19 UTC 2021
This change fixes the deadlock described in the JBS-bug by:
* Releasing `handlerLock` before waiting on `threadLock` in `blockOnDebuggerSuspend()`
* Notifying on `threadLock` after resuming all threads in `threadControl_reset()`
The PR has 3 commits:
The first commit delays the cleanup actions after leaving the loop in
`debugLoop_run()` because of a Dispose command. The delay allows to reproduce the deadlock
running the dispose003 test with the command
make run-test TEST=test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose003
The second commit contains the fix described above. With it the deadlock
cannot be reproduced anymore.
The third commit removes the diagnostic code introduced with the first commit again.
The fix passed our nightly regression testing: JCK and JTREG, also in Xcomp mode with fastdebug and release builds on all platforms.
-------------
Commit messages:
- Remove delay in cleanup again.
- Fix that prevents deadlock.
- Delay cleanup after JDWP Dispose command to trigger deadlock in the test dispose003
Changes: https://git.openjdk.java.net/jdk/pull/5805/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5805&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8274687
Stats: 11 lines in 1 file changed: 11 ins; 0 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/5805.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/5805/head:pull/5805
PR: https://git.openjdk.java.net/jdk/pull/5805
More information about the serviceability-dev
mailing list