RFR: 8374807: Crash in MethodData::extra_data_lock()+0x0 when running -XX:+TraceDeoptimization -XX:-ProfileTraps -XX:-TieredCompilation -Xcomp -version [v4]

Emanuel Peter epeter at openjdk.org
Wed Jan 21 16:54:50 UTC 2026


On Wed, 21 Jan 2026 13:52:52 GMT, Guanqiang Han <ghan at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/uncommontrap/TestPrintDiagnosticsWithoutProfileTraps.java line 32:
>> 
>>> 30:  * @run main/othervm -XX:+TraceDeoptimization -XX:-ProfileTraps
>>> 31:  *                   -XX:-TieredCompilation -Xcomp
>>> 32:  *                   compiler.uncommontrap.TestPrintDiagnosticsWithoutProfileTraps
>> 
>> `TraceDeoptimization` is a diagnostic flag. This test will cause issues without `-XX:+UnlockDiagnosticVMOptions`, right? And `ProfileTraps` is debug. So won't this need `-XX:+IgnoreUnrecognizedVMOptions`?
>> 
>> @iwanowww Did you already run testing on this patch or should I run some?
>
> Hi @eme64 , thanks for the comments.
> 
> I think we don’t need to add -XX:+UnlockDiagnosticVMOptions or -XX:+IgnoreUnrecognizedVMOptions here, because the test is guarded by @requires vm.debug. In debug builds, UnlockDiagnosticVMOptions is enabled by default (trueInDebug), so diagnostic flags like TraceDeoptimization are already unlocked, and ProfileTraps (a develop flag) is also available/recognized.
> 
> https://github.com/openjdk/jdk/blob/983ae96f60c935aa52f482d21ae6a0d947679541/src/hotspot/share/runtime/globals.hpp#L172-L173
> 
> https://github.com/openjdk/jdk/blob/983ae96f60c935aa52f482d21ae6a0d947679541/src/hotspot/share/runtime/globals.hpp#L1188-L1189

@hgqxjj Hmm I see. I'm not a fan of using `@requires vm.debug`, because it means that your test is not run in product, and sometimes bugs only show up in product.

It's also not great that we have to run a whole JVM startup with `-Xcomp`, compiling EVERYTHING, and blocking for every compilation. We should only use `-Xcomp` in combination with a fairly restricted `compileonly`. Otherwise, we just waste a lot of compute resources.

@iwanowww What is your opinion on this?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29147#discussion_r2713463904


More information about the hotspot-compiler-dev mailing list