On Tue, 15 Feb 2022 06:36:36 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
>> src/jdk.jdwp.agent/share/native/libjdwp/classTrack.c line 100: >> >>> 98: struct bag* deleted = deletedSignatures; >>> 99: deletedSignatures = NULL; >>> 100: debugMonitorExit(classTrackLock); >> >> This looks risky as the critical section is broken and the NULL deleted >> signatures exposed. If `cbTrackingObjectFree` occurs while this is true then >> you will lose the record of the deleted signature. >> >> Alternatively you could allow for lock-free reading of `deletedSignatures`, >> preemptively allocate a new bad if needed then take the lock. Or even use >> the lock to read `deletedSignatures` to determine if a new bag is needed, >> then drop the lock, create the bag, take the lock and re-check everything. > > Agreed. Fixed ------------- PR: https://git.openjdk.java.net/jdk/pull/7461