RFR: 8346193: Test runtime/ErrorHandling/TestDwarf.java fails build with clang17 [v2]

Hamlin Li mli at openjdk.org
Wed Dec 18 09:49:36 UTC 2024


On Wed, 18 Dec 2024 08:59:26 GMT, SendaoYan <syan at openjdk.org> wrote:

> There is a bit diffrence between `ShouldNotReachHere();` and `*t = 'c';`
> 
> 1. `ShouldNotReachHere();` cause jvm trigger `Internal Error` and then crash.
> 2. `*t = 'c';` cause jvm receive `SIGSEGV` signal, and then  crash.
> 

I see, thanks for explanation.
But seems the test does not check the crash details (i.e. the difference you mentioned above)?

> The test `runtime/ErrorHandling/TestDwarf.java` try to test various kinds jvm errors, such as `unsafeAccess`/`outOfMemory`/`abortVMOnException`/`nativeDivByZero` etc. I don't known change `*t = 'c';` to `ShouldNotReachHere();` could change the original test intention or not. So I'm inclined to keep this unchange, just add `volatile` modifier.

My only concern is that the current fix depends on the internal implementation and the effect of a compilation flag of clang, this is not stable, which means that in the future, it could fail for the similar reason. (In this sense, the change could also impact gcc behaviour.) IMHO, it would be better to use existing APIs in the JVM to implement this functionality.
But I'm not an expert of clang, so my above statement about clang could be wrong.

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

PR Comment: https://git.openjdk.org/jdk/pull/22757#issuecomment-2550860244


More information about the hotspot-dev mailing list