RFR: 8346193: CrashGCForDumpingJavaThread do not trigger expected crash build with clang17 [v6]
Thomas Stuefe
stuefe at openjdk.org
Fri Jan 3 08:18:38 UTC 2025
On Thu, 2 Jan 2025 07:42:32 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> > @kimbarrett just for my understanding, Can't we do something like this:
> > ```c++
> > if (CrashGCForDumpingJavaThread) {
> > raise(SIGSEGV);
> > }
> > ```
>
> I think that would also work, but has to go through the complexities of signal handling and reporting, and doesn't provide any useful context in the error message, only in the hs_err stack trace. So I think the proposed use of `guarantee` is better.
To extend on @kimbarrett's answer: In some (few) crash tests we need real signals, in order to test detailed signal printing. But in those cases `raise` is also a poor choice, since it changes the signal details we get from the kernel. When we don't need to test signal handling, guarantee or assert are sufficient.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22757#issuecomment-2568834885
More information about the hotspot-dev
mailing list