On Mon, 12 Dec 2022 08:04:57 GMT, Justin King <jck...@openjdk.org> wrote:

>> src/java.base/share/native/launcher/main.c line 41:
>> 
>>> 39: // extremely early during library loading, before main is called. We 
>>> need to override the default
>>> 40: // options because by default UBSan only prints a warning for each 
>>> occurrence. We want jtreg tests
>>> 41: // to fail when undefined behavior is encountered. We also want a full 
>>> stack trace for the offending
>> 
>> If this is primarily for tests then can't we set the env-var in the test 
>> Makefile?
>
> Primarily, but its not a requirement. We should also be able to invoke `java` 
> as is. The environment variables should be used to force specific behavior 
> for a single invocation. Otherwise, if one forgets to pass the environment 
> variables, things may not go as expected.

It really comes down to who we expect to do these ubsan builds and how we 
expect them to be used. If this is something explicit then using the env-var 
seems fine to me. I'm not sure why it needs to be enabled by default through 
this source modification.

I'd like to hear other opinions on this.

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

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

Reply via email to