RFR: 8269268: JDWP: Properly fix thread lookup assert in findThread()
David Holmes
dholmes at openjdk.java.net
Thu Jun 24 06:41:31 UTC 2021
On Thu, 24 Jun 2021 05:17:02 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:
> Re-enable the assert that was disabled (with some overhead) by [JDK-8265683](https://bugs.openjdk.java.net/browse/JDK-8265683). Explanation is in the CR and also in comments included with the changes.
>
> I tested by running `vmTestbase/nsk/jdb/suspend/suspend001/suspend001.java` and `vmTestbase/nsk/jdb/wherei/wherei001/wherei001.java` 100's of times, and did not see any failures. I also verified the original issue was still reproducible by temporarily not setting `gdata->handlingVMDeath = JNI_TRUE`, which did trigger the assert as expected.
src/jdk.jdwp.agent/share/native/libjdwp/eventHandler.c line 1243:
> 1241:
> 1242: /* Setting this flag is needed for a very special case. See the reference in findThread(). */
> 1243: gdata->handlingVMDeath = JNI_TRUE;
Is this used to communicate across different threads? If so then it needs to be at least volatile, but a more forceful memory-barrier may be needed on some platforms. I can't tell in what context findThread will be called after this has been set to true.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4580
More information about the serviceability-dev
mailing list