RFR: 8274687: JDWP deadlocks if some Java thread reaches wait in blockOnDebuggerSuspend [v7]

Chris Plummer cjplummer at openjdk.java.net
Fri Oct 22 04:07:06 UTC 2021


On Thu, 21 Oct 2021 19:38:41 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

>> If you are worried about another thread changing those fields after they have already been checked, then you can use the threadLock around them also. So you can grab threadLock before the `if (node->handlingAppResume)` and release after the `pendingInterrupt` and `pendingStop` references. I don't think it's really needed, because this is the only place where the flags are set false (and some action is taken when true), but there is no harm in holding the threadLock here, and it doesn't make the locking any more complicated.
>
> I have hoisted the locking from `trackAppResume()` up to `doPendingTasks()`
> where it is more visible. The change in that form is sufficient to fix the
> deadlock issues. Would it be ok for you to do further enhancements in a
> follow-up RFE?

Yes, an RFE is fine. The changes look good. I just added one suggestion to improve a comment.

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

PR: https://git.openjdk.java.net/jdk/pull/5849


More information about the serviceability-dev mailing list