RFR: 8274986: max code printed in hs-err logs should be configurable [v5]
Doug Simon
dnsimon at openjdk.java.net
Wed Oct 13 07:49:53 UTC 2021
On Wed, 13 Oct 2021 04:47:18 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> 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.
Yes but in a production scenario (which is where robust error reporting is critical), the assert is ignored and we end up with potential buffer overflow.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5875
More information about the hotspot-dev
mailing list