RFR: 8274794: Make Thread::_owned_locks available in product [v2]
Coleen Phillimore
coleenp at openjdk.java.net
Tue Oct 12 13:28:51 UTC 2021
On Mon, 11 Oct 2021 18:39:44 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Make thread owned locks available in product and change the error message printing to print by thread so that not only locks in mutexLocker are printed in the hs_err file.
>> Tested with tier1-3 and with product build, and tested hs_err files manually with some selected temporary ShouldNotReachHere, also new test.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix optimized build (move print_on) up.
in opposite order, I've found the mutex_array to be not useful at all for debugging - didn't know it existed for 20yrs. You can check the lock you're interested in directly because it's a global name. The small chance of a thread adding a lock during error reporting and potential crash, is handled by the error reporting "STEP" framework, so I don't see that as a concern.
There are a few locks that would be useful to see in error handling (like the HandshakeState_lock) that are not covered by the mutex_array because they're not global. It would have helped debug some bug I was looking for several months ago.
I was actually motivated to do this because of some awful looking code in https://github.com/openjdk/jdk/pull/5590, but apparently that's been removed.
My real motivation, besides accurate error reporting, is to remove the 'def' macros in mutexLocker.cpp so that the default case of _allow_vm_block isn't specified, so that we can see some safepoint checking locks that pass true which block safepoints that really should not pass true. Some of these are cut/paste code.
This is the change that wanted to get to:
https://github.com/openjdk/jdk/commit/38b58c59b4bc9fbd62a57c3550d3e02f30efe8cb
-------------
PR: https://git.openjdk.java.net/jdk/pull/5896
More information about the hotspot-dev
mailing list