RFR: 8274794: Print all owned locks in hs_err file [v2]

Coleen Phillimore coleenp at openjdk.java.net
Mon Oct 18 13:00:57 UTC 2021


On Sat, 16 Oct 2021 06:38:30 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/share/runtime/mutex.cpp line 344:
>> 
>>> 342: // Print all mutexes/monitors that are currently owned by a thread; called
>>> 343: // by fatal error handler.
>>> 344: void Mutex::print_owned_locks_on_error(outputStream* st) {
>> 
>> Maybe a small comment that we explicitly avoid locking here, because we are in error handling and locking may block? That we rather risk a secondary crash instead of blocking in error handling?
>
> You also could assert for `VMError::is_error_reported()` to prevent future use outside error handling.

Nice suggestion.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5958


More information about the hotspot-dev mailing list