RFR: 8302798: Refactor -XX:+UseOSErrorReporting for noreturn crash reporting [v3]

Julian Waters jwaters at openjdk.org
Tue Mar 28 10:41:30 UTC 2023


On Mon, 27 Mar 2023 00:52:05 GMT, Kim Barrett <kbarrett 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.

Alright, will pay attention to that issue. I'll also add an error from vmError_windows.cpp there as an addendum too, this also triggers together with the aforementioned os_windows.cpp warning but I forgot to include this to my previous message


src/hotspot/os/windows/vmError_windows.cpp: In static member function 'static void VMError::raise_fail_fast(void*, void*)':
d:/eclipse/workspace/jdk/src/hotspot/os/windows/vmError_windows.cpp:74:1: warning: 'noreturn' function does return
   74 | }
      | ^

-------------

PR Comment: https://git.openjdk.org/jdk/pull/12759#issuecomment-1486617673


More information about the hotspot-dev mailing list