RFR(S): 8065740: compiler/codecache/OverflowCodeCacheTest.java fails with SIGSEGV
tobias.hartmann at oracle.com
Tue Nov 25 14:58:28 UTC 2014
please review the following patch.
The test allocates CodeBlobs in the code cache by using the Whitebox API method
'WhiteBox::allocate_code_blob' introduced by JDK-8059624. The VM crashes while
sweeping because it encounters an allocated but uninitialized CodeBlob in the
code cache (crash happens in NMethodIterator::next_method because we call
'_code_blob->is_nmethod()' on an uninitialised CodeBlob).
The problem is that 'WhiteBox::allocate_code_blob' gives up the CodeCache_lock
before initializing the CodeBlob. This allows the sweeper thread to encounter a
yet uninitialized CodeBlob while iterating over the code cache.
I moved the initialization of the CodeBlob into the scope of the CodeCache_lock.
I also fixed some typos and removed a comment that became meaningless with
- Failing testcase
More information about the hotspot-compiler-dev