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

Matthias Baesken mbaesken at openjdk.org
Wed Jun 19 12:02:15 UTC 2024


On Wed, 19 Jun 2024 09:02:34 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:
> 
>   whitespace adjustments

I can remove the 2 word 'or overflows' if you want .
(there was at least a 'division by 0' example case here https://github.com/openjdk/jdk/pull/19674
where the case detected by ubsan was already handled; but the coding could be reorganized to avoid it at all ;
comment in that review from the area expert 'This whole ubsan thing is just random findings based on what tests we have.
We'll never be ubsan clean and I'm not sure it is advisable in all cases.' )

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

PR Comment: https://git.openjdk.org/jdk/pull/19722#issuecomment-2178517419


More information about the hotspot-dev mailing list