RFR: 8274986: max code printed in hs-err logs should be configurable [v4]
Doug Simon
dnsimon at openjdk.java.net
Tue Oct 12 08:13:55 UTC 2021
On Tue, 12 Oct 2021 07:36:36 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Doug Simon has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits:
>>
>> - print extra info for an nmethod in CodeBlob::dump_for_addr to st instead of tty in non-verbose mode
>> - made ErrorLogPrintCodeLimit a diagnostic flag
>> - make max code printed in hs-err log configurable and also scan Java stack for code to print
>> - do not unnecessarily pollute tty
>
> src/hotspot/share/runtime/flags/jvmFlagLimit.cpp line 37:
>
>> 35: #include "oops/markWord.hpp"
>> 36: #include "runtime/task.hpp"
>> 37: #include "utilities/vmError.hpp"
>
> Why is this needed?
For the definition of `VMError::max_error_log_print_code` to be available just like `task.hpp` is included to make `PeriodicTask::min_interval` (used in defining the range of `PerfDataSamplingInterval`) available.
> src/hotspot/share/utilities/vmError.cpp line 920:
>
>> 918: // Even though ErrorLogPrintCodeLimit is ranged checked
>> 919: // during argument parsing, there's no way to prevent it
>> 920: // being set to a value outside the range.
>
> I don't understand what you mean here. Do we not abort the VM if the flag value is out-of-range?
`ErrorLogPrintCodeLimit` is a writable global variable so this is just being extra defensive should anything update `ErrorLogPrintCodeLimit` (e.g. `ErrorLogPrintCodeLimit == 100;`) after argument parsing.
> src/hotspot/share/utilities/vmError.cpp line 925:
>
>> 923: // Scan the native stack
>> 924: if (!_print_native_stack_used) {
>> 925: // Only try print code of the crashing frame since
>
> Existing typo: s/try/try to/
Fixed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5875
More information about the hotspot-dev
mailing list