RFR: 8334239: Introduce macro for ubsan method/function exclusions [v5]

Stefan Karlsson stefank at openjdk.org
Wed Jun 19 13:46:11 UTC 2024


On Wed, 19 Jun 2024 12:41:43 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> A number of functions/methods have to be excluded from ubsan detection (e.g. because they do things that ubsan warns about, however it is still valid what is done there).
>> We can simplify this by introducing a macro (similar to asan-related ATTRIBUTE_NO_ASAN, see sanitizers/address.hpp).
>> Currently something like this is used :
>> 
>> #if defined(__clang__) || defined(__GNUC__)
>> __attribute__((no_sanitize("undefined")))
>> #endif
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   adjust comments

Thanks for making the change. I think this looks good, minus one nit in the whitespace change.

src/hotspot/share/sanitizers/ub.hpp line 42:

> 40: #define ATTRIBUTE_NO_UBSAN
> 41: #endif
> 42: #endif // SHARE_SANITIZERS_UB_HPP

You removed one too many blank lines here. It used to be two, now there are none.

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

PR Review: https://git.openjdk.org/jdk/pull/19722#pullrequestreview-2128330864
PR Review Comment: https://git.openjdk.org/jdk/pull/19722#discussion_r1646229154


More information about the hotspot-dev mailing list