[jdk17u-dev] RFR: 8314225: SIGSEGV in JavaThread::is_lock_owned
Richard Reingruber
rrich at openjdk.org
Fri Jan 10 10:57:54 UTC 2025
On Sun, 29 Dec 2024 18:02:48 GMT, Goetz Lindenmaier <goetz at openjdk.org> wrote:
> I backport this for parity with 17.0.15-oracle.
>
> I had to resolve the larger part of this change.
> None of my edits change the code essentially, though.
>
> src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp
> Resolved because of NULL/nullptr difference
>
> src/hotspot/share/runtime/javaThread.cpp|hpp
> These files don't exist in 17, they were split off from thread.cpp|hpp.
> The modiefied code looks very similar in 17, so I could easily identify
> the changed code and apply the patches. Usual minor nullptr diffs etc.
>
> src/hotspot/share/runtime/monitorChunk.cpp
> Resolved because of NULL/nullptr difference
>
> src/hotspot/share/runtime/monitorChunk.hpp
> Resolved because of context diff.
>
> src/hotspot/share/runtime/synchronizer.cpp
> Resolved. Different checks in if condition.
> One is for the new locking mode in head, the other whether the mask has a locker.
> ... check ...
>
> src/hotspot/share/runtime/thread.cpp
> Resolved because new locking modes added an assertion in removed function is_lock_owned.
>
> src/hotspot/share/runtime/vframeArray.cpp
> Resolved. Code differs because 21 has biased locking removed.
>
>
>
> To make it build, I had to replace
> Javathread::cast() by as_Java_thread() in synchronizer.cpp.
>
> Also I removed is_linked() from monitorChunk.hpp.
Looks good besides one assertion message that could be improved.
src/hotspot/share/runtime/vframeArray.cpp line 98:
> 96: } else {
> 97: assert(monitor->owner() != nullptr, "monitor owner must not be null");
> 98: assert(!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern(), "object must be null or locked, and unbiased");
Suggestion:
assert(!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern(), "object must be locked, and unbiased");
-------------
PR Review: https://git.openjdk.org/jdk17u-dev/pull/3177#pullrequestreview-2542144348
PR Review Comment: https://git.openjdk.org/jdk17u-dev/pull/3177#discussion_r1910204494
More information about the jdk-updates-dev
mailing list