Integrated: 8374807: Crash in MethodData::extra_data_lock()+0x0 when running -XX:+TraceDeoptimization -XX:-ProfileTraps -XX:-TieredCompilation -Xcomp -version
Guanqiang Han
ghan at openjdk.org
Wed Feb 25 13:16:50 UTC 2026
On Sat, 10 Jan 2026 00:08:12 GMT, Guanqiang Han <ghan at openjdk.org> wrote:
> Please review this change. Thanks!
>
> Description:
>
> This change fixes a crash in Deoptimization::uncommon_trap_inner when running with -XX:+TraceDeoptimization -XX:-ProfileTraps -XX:-TieredCompilation -Xcomp.
>
> With -XX:-ProfileTraps, create_if_missing is set to false.
> https://github.com/openjdk/jdk/blob/74faf033127ab3a5e28be75b91e662c589f81084/src/hotspot/share/runtime/deoptimization.cpp#L2121-L2122
>
> When create_if_missing is false, new mdo can not be created when m()->method_data() return null, so get_method_data() may return null .
> https://github.com/openjdk/jdk/blob/74faf033127ab3a5e28be75b91e662c589f81084/src/hotspot/share/runtime/deoptimization.cpp#L1911-L1912
>
> and trap_mdo can be null as a result
> https://github.com/openjdk/jdk/blob/74faf033127ab3a5e28be75b91e662c589f81084/src/hotspot/share/runtime/deoptimization.cpp#L2134-L2136
>
> The crash happens here because trap_mdo is null
> https://github.com/openjdk/jdk/blob/74faf033127ab3a5e28be75b91e662c589f81084/src/hotspot/share/runtime/deoptimization.cpp#L2157
>
> Fix:
>
> The fix makes acquisition of extra_data_lock conditional on trap_mdo being non-null, preserving the required lock ordering (extra_data_lock before ttyLocker) when an MDO exists.
>
> Test:
>
> GHA
This pull request has now been integrated.
Changeset: 194be818
Author: Guanqiang Han <ghan at openjdk.org>
Committer: Emanuel Peter <epeter at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/194be8180f89cd247d31e5ecdb23cb5261db2625
Stats: 62 lines in 2 files changed: 60 ins; 0 del; 2 mod
8374807: Crash in MethodData::extra_data_lock()+0x0 when running -XX:+TraceDeoptimization -XX:-ProfileTraps -XX:-TieredCompilation -Xcomp -version
Reviewed-by: vlivanov, epeter
-------------
PR: https://git.openjdk.org/jdk/pull/29147
More information about the hotspot-dev
mailing list