RFR: 8274986: max code printed in hs-err logs should be configurable [v5]
Thomas Stuefe
stuefe at openjdk.java.net
Wed Oct 13 04:49:52 UTC 2021
On Tue, 12 Oct 2021 19:55:54 GMT, Doug Simon <dnsimon at openjdk.org> wrote:
>> I thought the point of MIN2 here is to handle ErrorLogPrintCodeLimit < max. IMHO ErrorLogPrintCodeLimit > max would be just an assert-worthy error, since as David wrote flag values should not be changed after initialization.
>
> The point is to ensure that we don't run off the end of the stack allocated `printed` array in the (granted, unlikely) case that `ErrorLogPrintCodeLimit` is (accidentally) updated after arg parsing .
> I'm not sure an assert is the best thing as it would cause error reporting to recurse.
> Maybe I was being too defensive but I figured the overhead is negligible so why not be ultra-safe.
Recursive asserts would be caught by secondary error handling and show up as "Error occurred during error reporting" printout. Not ideal, but at least won't endanger the rest of the printing.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5875
More information about the hotspot-dev
mailing list