RFR: 8340801: Disable ubsan checks in some awt/2d coding

Matthias Baesken mbaesken at openjdk.org
Fri Sep 27 07:46:34 UTC 2024


On Wed, 25 Sep 2024 12:17:59 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> There is some old awt/2d coding where warnings occur when running with ubsan enabled binaries.
> However at most of these locations the coding should work (at least on our supported platform set) so the warnings can be disabled at least for now.
> 
> The change adds a macro ATTRIBUTE_NO_UBSAN  similar to what we already use in Hotspot coding.

Btw regarding the function/method exclusion, this was introduced in HS some time ago 
https://bugs.openjdk.org/browse/JDK-8334239
We just needed in HS codebase a couple of places where we use/keep undefined behavior  (e.g. im vmError.cpp where it is intentionally used).  Obviously, the mentioned HS change does not work for the other C libs so this is some kind of follow up.
In HS we use the ATTRIBUTE_NO_UBSAN macro currently at 4 code locations.  So it is not intended or likely that this macro would go to a lot of places of the JDK libs, just a small number comparable to usage in HS.
Regarding putting  it into jni_md.h, probably it would moving it from there to a separate header like it is done in HS would be better, I can do that if this is preferred.

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

PR Comment: https://git.openjdk.org/jdk/pull/21184#issuecomment-2378625842


More information about the core-libs-dev mailing list