RFR: 8332894: ubsan: vmError.cpp:2090:26: runtime error: division by zero [v2]

David Holmes dholmes at openjdk.org
Mon May 27 07:41:06 UTC 2024


On Mon, 27 May 2024 06:42:42 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> src/hotspot/share/utilities/vmError.cpp line 2093:
>> 
>>> 2091: static void ALWAYSINLINE crash_with_sigfpe() {
>>> 2092: 
>>> 2093:   // generate a native synchronous SIGFPE where possible;
>> 
>> Maybe simpler would be to change the definition to only use the divide-by-zero
>> approach for _WIN32 and always use the currently conditional fallback to
>> pthread_kill on non-_WIN32.  Especially in light of the fact that the
>> divide-by-zero approach doesn't work on some platforms.
>> 
>> I also wonder if the comment about OSX incorrectly implementing raise is
>> correct? Maybe that's been fixed?  Or maybe it's not a bug, but a BSD-ism?
>
> I do not know about the OSX specific issues, maybe someone else can comment?
> Regarding the handling on UNIX, Thomas commented and I think the coding should better stay.

macOS `raise` raises the signal to the process not the thread (per Posix requirements).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19394#discussion_r1615608795


More information about the hotspot-dev mailing list