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

Guanqiang Han ghan at openjdk.org
Sun Jan 18 01:47:26 UTC 2026


On Fri, 16 Jan 2026 20:32:34 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> src/hotspot/share/runtime/deoptimization.cpp line 2161:
>> 
>>> 2159:                                 Mutex::_no_safepoint_check_flag);
>>> 2160: 
>>> 2161:       ttyLocker ttyl;
>> 
>> Does the code still need `ttyLocker`? 
>> 
>> There's only one usage of `tty` and it prints all accumulated info all at once. `xtty` already annotates output with thread info. So, I'd assume that moving `trap_mdo->extra_data_lock()` locker to  `trap_mdo` accesses  should solve the problem as well. 
>> 
>> (I'm not sure whether a `ttyLocker` is needed or not to avoid interleaving during `tty->print_raw(st.freeze());`, but `ttyLocker` can be placed right before it.)
>
> I take my suggestion back. Sorry for the confusion.
> 
> The code in question populates complex XML structure, so locking is needed to ensure the resulting XML is well-formed. 
> 
> Your previous version looks fine to me.

Hi @iwanowww, I have restored the previous version. Could you please review it again?

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

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


More information about the hotspot-compiler-dev mailing list