RFR: JDK-8296907: VMError: add optional callstacks, siginfo for secondary errors [v3]

Thomas Stuefe stuefe at openjdk.org
Thu Nov 17 07:46:22 UTC 2022


On Wed, 16 Nov 2022 17:32:33 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Merge branch 'JDK-8296907-VMError-add-optional-callstacks-siginfo-for-secondary-errors' of github.com:tstuefe/jdk into JDK-8296907-VMError-add-optional-callstacks-siginfo-for-secondary-errors
>>  - Feedback David
>
> src/hotspot/share/utilities/vmError.cpp line 1653:
> 
>> 1651:         st->print_cr("]");
>> 1652: #ifdef ASSERT
>> 1653:         if (ErrorLogSecondaryErrorDetails) {
> 
>> But printing callstacks during error reporting is unsafe - if we get a second crash or assert, it will cause infinite recursion and interrupt error reporting.
> 
> Should there be logic here that at least guarantee progress?
> ```c++
> if (ErrorLogSecondaryErrorDetails && !_some_bool) {
>   _some_bool = true;
>   [...]
> }
> _some_bool = false;

It would work horizontally too, though, since it would disable call stack printing for the next secondary error.

I still think yours is a good idea. We can extend it to using a counter and only allow a small number (2-5) of secondary errors to get printed out with their call stacks. Because if we have more than, say, 5 recursive errors, chances are they all trip over the same thing anyway and more call stacks won't tell you anything new.

And then, if we limit the number of these things, maybe we can afford to leave this feature on by default in debug builds. That addresses the concern  @dholmes-ora voiced, about having to switch on the feature first.

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

PR: https://git.openjdk.org/jdk/pull/11118


More information about the hotspot-dev mailing list