RFR: 8338449: ubsan: division by zero in sharedRuntimeTrans.cpp
Lutz Schmidt
lucy at openjdk.org
Tue Oct 22 13:44:15 UTC 2024
On Mon, 14 Oct 2024 14:08:05 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> When running with ubsan enabled binaries on Linux ppc64le, some divisions by zero are detected in the java/lang/Math jdk jtreg tests dealing with log - related calculations.
>
> java/lang/Math/Log10Tests.java: Tests for {Math, StrictMath}.log10
>
> /jdk/src/hotspot/share/runtime/sharedRuntimeTrans.cpp:219:27: runtime error: division by zero
> #0 0x7fffa7e14abc in SharedRuntime::dlog10(double) (/build_ubsan/images/jdk/lib/server/libjvm.so+0x69f4abc)
> #1 0x7fff8b8fc8e8 (<unknown module>)
>
> test
> java/lang/Math/LogTests.java: Tests for {Math, StrictMath}.log
>
> /jdk/src/hotspot/share/runtime/sharedRuntimeTrans.cpp:125:27: runtime error: division by zero
> #0 0x7fff887f48bc in __ieee754_log(double) (/build_ubsan/images/jdk/lib/server/libjvm.so+0x69f48bc)
> #1 0x7fff6b8fc768 (<unknown module>)
>
> test
> java/lang/Math/PowTests.java: Tests for {Math, StrictMath}.pow
>
> /jdk/src/hotspot/share/runtime/sharedRuntimeTrans.cpp:508:23: runtime error: division by zero
> #0 0x7fff92fd61f0 in SharedRuntime::dpow(double, double) (/build_ubsan/images/jdk/lib/server/libjvm.so+0x69f61f0)
> #1 0x7fff7701c8ec (<unknown module>)
>
> The coding does intentional division by zero.
> We should probably check for IEEE compliance (or rewrite the coding); but checking for compliance might be sufficient.
After all the discussion: LGTM.
-------------
Marked as reviewed by lucy (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/21500#pullrequestreview-2385250994
More information about the hotspot-dev
mailing list