In JDK-8290867 we hackfixed a crash during VM shutdown related to GlobalCounter usage by explicitly conditionalizing that usage.
"VM shutdown calls the the destructor for the (global) free list pool, which in turn frees all segments; however at that time the VM is not in a state where GlobalCounter works (threads are detached, no valid threads list) and crashes. The last commit provides a workaround for that issue, not doing the global synchronization when shutting down. That is safe because the process is single-threaded in the VM_Exit operation anyway. This is a workaround for this issue that needs to be cleaned up, but it's too late imho in the release to find a better solution for this issue."
Look for alternatives there.
Here is a comment from a discussion about this:
Though [we] have talked about using SingleWriterSynchronizer instead of GlobalCounter for the buffer allocator, to avoid such issues with GlobalCounter usability. The use case driving that notion is the arena allocator and the CHeap allocator, which currently use ThreadCritical. And can't use GlobalCounter because they need to work too early in VM init"
Another option is to make GlobalCounter itself shutdown-safe (or even init safe).
"VM shutdown calls the the destructor for the (global) free list pool, which in turn frees all segments; however at that time the VM is not in a state where GlobalCounter works (threads are detached, no valid threads list) and crashes. The last commit provides a workaround for that issue, not doing the global synchronization when shutting down. That is safe because the process is single-threaded in the VM_Exit operation anyway. This is a workaround for this issue that needs to be cleaned up, but it's too late imho in the release to find a better solution for this issue."
Look for alternatives there.
Here is a comment from a discussion about this:
Though [we] have talked about using SingleWriterSynchronizer instead of GlobalCounter for the buffer allocator, to avoid such issues with GlobalCounter usability. The use case driving that notion is the arena allocator and the CHeap allocator, which currently use ThreadCritical. And can't use GlobalCounter because they need to work too early in VM init"
Another option is to make GlobalCounter itself shutdown-safe (or even init safe).
- relates to
-
JDK-8290867 Race freeing remembered set segments
-
- Closed
-