RFR: 8310228: Improve error reporting for uncaught native exceptions on Windows [v5]
Jorn Vernee
jvernee at openjdk.org
Tue May 21 08:16:12 UTC 2024
On Thu, 21 Sep 2023 12:24:03 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Prevents a stack overflow (or other fatal error) from occurring when handling an unknown exception. See JBS issue for full problem outline.
>>
>> WRT implementation:
>> - I've refactored `Handle_FLT_Exception` to check the exception code on 64 bit Windows as well. It now returns a boolean indicating whether the exception was recognized and handled.
>> - For x86, I've created a new Uncaugh_Exception_Handler function which implements the uncaught exception handler. This new function replaces the previous use of `Handle_FLT_Exception` as uncaught exception handler. x86 also supports exception chaining through a previous exception handler stored in `prev_uef_handler`. But, on 64 bit windows this field is never set, so we don't need to try to execute the fallback handler on 64 bit. Hence, it seemed clearer to factor out that bit to a separate function. Both the x86 and 64 bit impls call the `handle_FLT_exception` function.
>>
>> I've tested this patch locally on Windows x64, I will need some help testing this on Windows x86 (it seems some of the test libraries are failing to build?)
>>
>> Testing: tier 1-4
>
> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>
> add static to forward declaration too
> Hey,
>
> Following the discussion in [openjdk/jdk21u-dev#510](https://github.com/openjdk/jdk21u-dev/pull/510), I'm still able to reproduce this issue on Java 22+.
>
> I made a simple PoC at https://github.com/Rigner/jdk-21-crash, which would help you reproducing and investigating the issue. Everything is explained in the README, with example outputs, build & run commands and my personal investigation.
>
> Hope that helps 🙏
I had a quick look, but the issue you're seeing is unrelated to this PR. If you're still experiencing the issue, I suggest submitting a bug report to https://bugreport.java.com/bugreport/ or the bug tracker for your JDK vendor.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14523#issuecomment-2122031192
More information about the hotspot-runtime-dev
mailing list