RFR: 8274794: Make Thread::_owned_locks available in product [v2]

David Holmes dholmes at openjdk.java.net
Mon Oct 11 22:03:53 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.

Hi Coleen,

Sorry but I have significant concerns with parts of this change. First it isn't safe to print the owned locks of all threads during error reporting as those threads are still running and could be updating their list of owned threads.

I also think there is still need for the _mutex_array because that allows you to check what each mutex thinks its state is, independently of what the threads think ie. if there's a bug in the owned_locks code and a locked lock was mistakenly elided, then you now have no way to know that.

My understanding of the motivation for this change was to allow printing of the dynamically defined locks held by the current thread during error reporting - but this change tries to go way beyond that.

Thanks,
David

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

Changes requested by dholmes (Reviewer).

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


More information about the hotspot-dev mailing list