RFR: 8302798: Refactor -XX:+UseOSErrorReporting for noreturn crash reporting [v3]
Kim Barrett
kbarrett at openjdk.org
Mon Mar 27 00:54:47 UTC 2023
On Tue, 21 Mar 2023 13:01:00 GMT, Julian Waters <jwaters at openjdk.org> wrote:
> When compiling a Windows HotSpot with gcc (see [8288293](https://bugs.openjdk.org/browse/JDK-8288293?filter=-3)) newer gcc versions have a diagnostic that can catch when noreturn code returns in certain areas, and gcc catches several with this change:
>
> ```
> src/hotspot/os/windows/os_windows.cpp: In static member function 'static void os::abort(bool, void*, const void*)':
> src/hotspot/os/windows/os_windows.cpp:1249:1: error: 'noreturn' function does return [-Werror]
> 1249 | }
> | ^
> src/hotspot/os/windows/os_windows.cpp: In static member function 'static void os::die()':
> src/hotspot/os/windows/os_windows.cpp:1254:1: error: 'noreturn' function does return [-Werror]
> 1254 | }
> | ^
> src/hotspot/os/windows/os_windows.cpp: In static member function 'static void os::exit(int)':
> src/hotspot/os/windows/os_windows.cpp:4792:1: error: 'noreturn' function does return [-Werror]
> 4792 | }
> | ^
> src/hotspot/os/windows/os_windows.cpp: In static member function 'static void os::_exit(int)':
> src/hotspot/os/windows/os_windows.cpp:4796:1: error: 'noreturn' function does return [-Werror]
> 4796 | }
> ```
>
> I don't know if this is something we should be worried about with our current setup and the regular build that we have for Windows, so I'm leaving this warning here for someone else to read through
I think all of these warnings would go away if `os::win32::exit_process_or_thread` was noreturn.
It looks like it is effectively noreturn (but not marked), though it contains a final `return exit_code;`
that is commented as unreachable. I filed https://bugs.openjdk.org/browse/JDK-8304939 for this.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/12759#issuecomment-1484311911
More information about the hotspot-dev
mailing list