RFR(M): 8221077: No NullPointerException message if top frame is hidden.
David Holmes
david.holmes at oracle.com
Mon May 6 11:49:52 UTC 2019
Hi Goetz,
Just commenting on the situation ...
On 6/05/2019 8:22 pm, Lindenmaier, Goetz wrote:
> Hi,
>
> Exceptions can print the stack trace of when the exception occurred.
> There can be methods on the stack that have been generated by
> the runtime. To not confuse the reader of the stackTrace,
> these are omitted (if -XX:-ShowHiddenFrames, which is default.)
>
> If the top frame is omitted/hidden,
> it is inconsistent to print a message telling where
> exactly in the hidden method the error occurred.
>
> Further, if the top frame is hidden, the information
> needed to compute the message is missing. A wrong
> message will be printed.
>
> This change suppresses the NPE message if the NPE
> occurred in a hidden top frame.
This sounds to me like "hidden frames" are being applied too broadly.
Frames should only be hidden with respect to throwing specific
exceptions - those for which the frame is part of the "throwing
mechanics". If that code hits a real exception then the frame should not
be treated as hidden IMO. But I don't know whether we can clearly
identify which kinds of exceptions should really lead to a frame being
hidden.
David
-----
> It adds a java.lang.Boolean(true) to the backtrace
> in case the real top frame is a hidden one and is dropped.
>
> When the NullPointerException message text is generated, this is
> checked and the message is skipped if the proper frame is not
> available.
>
> I handle this in a bug itself to keep the discussion of
> the basic feature separated from this technical issue.
>
> Please review:
> https://bugs.openjdk.java.net/browse/JDK-8221077
> http://cr.openjdk.java.net/~goetz/wr19/8221077-hidden_top_frame/02/
> This change must be applied on top of
> http://cr.openjdk.java.net/~goetz/wr19/8218628-exMsg-NPE/08/
>
> Best regards,
> Goetz.
>
More information about the hotspot-runtime-dev
mailing list