Integrated: 8338449: ubsan: division by zero in sharedRuntimeTrans.cpp
Matthias Baesken
mbaesken at openjdk.org
Wed Oct 23 07:11:10 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.
This pull request has now been integrated.
Changeset: 37cfaa8d
Author: Matthias Baesken <mbaesken at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/37cfaa8deb4cc15864bb6dc2c8a87fc97cff2f0d
Stats: 12 lines in 1 file changed: 12 ins; 0 del; 0 mod
8338449: ubsan: division by zero in sharedRuntimeTrans.cpp
Reviewed-by: lucy, kbarrett
-------------
PR: https://git.openjdk.org/jdk/pull/21500
More information about the hotspot-dev
mailing list