RFR: JDK-8298448: UndefinedBehaviorSanitizer [v8]

Magnus Ihse Bursie ihse at openjdk.org
Fri Dec 16 15:59:50 UTC 2022


On Mon, 12 Dec 2022 10:42:22 GMT, Justin King <jcking at openjdk.org> wrote:

>> Allow building OpenJDK with UBSan. Currently the build fails when optimizing the image due to lots of undefined behavior (it invokes the built JVM). Follow up PRs will either replace the undefined behavior with well defined behavior or suppress errors which are intentional. The goal is to make OpenJDK more well defined and thus more portable across compilers and architectures.
>
> Justin King has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Simplify logic for including __ubsan_default_options
>   
>   Signed-off-by: Justin King <jcking at google.com>

Sorry for the late review.

"Magic" solutions like this is always a bit scary. But we have some precedence in terms of the "autoheaders" for assembly files, so I guess this is not worse.

However, I do think the included source files should be treated like the autoheaders, and reside in data rather than in `src`. The latter is intended for buildtools, even though they are a bit scattered at the moment (there is a long-standing JBS bug about fixing that), and these are not really intended to be compiled into a product by itself, rather as something "injected" into all builds. I'd recommend `make/data/ubsan`, and perhaps skip the leading `__`.

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

PR: https://git.openjdk.org/jdk/pull/11604


More information about the core-libs-dev mailing list