RFR: 8323576: [Windows] Fallthrough to std::abort instead of os::infinite_sleep for noreturn methods

Julian Waters jwaters at openjdk.org
Mon Jan 15 05:39:22 UTC 2024


On Thu, 11 Jan 2024 08:31:21 GMT, Julian Waters <jwaters at openjdk.org> wrote:

> os::infinite_sleep should only be used in very specific scenarios, and using it to satisfy compiler requirements for [[noreturn]] marked methods is a bad idea, since in the impossible case this will cause HotSpot to hang for a seemingly unknown reason. Fallthrough to std::abort instead, like other platforms do, to align Windows with them

I believe ShouldNotReachHere ultimately calls back into the code in question here, so doing that would ultimately result in a never ending recursion loop (I'm not at home right now however, so I cannot confirm whether this is true). This also aligns with the POSIX platforms, which all fall through to ::abort in their respective terminate methods

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

PR Comment: https://git.openjdk.org/jdk/pull/17366#issuecomment-1891333029


More information about the hotspot-runtime-dev mailing list