RFR: 8288497: add support for JavaThread::is_gc_barrier_detached()

Daniel D. Daugherty dcubed at openjdk.org
Thu Jun 16 16:36:53 UTC 2022


On Thu, 16 Jun 2022 12:29:13 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

>> A trivial fix to add support for JavaThread::is_gc_barrier_detached() which allows
>> us to add checks to detect failures like:
>> 
>>     JDK-8288139 JavaThread touches oop after GC barrier is detached
>>     https://bugs.openjdk.org/browse/JDK-8288139
>> 
>> This fix along with the fix for JDK-8288139 has been tested in Mach5 Tier[1-8].
>> There are no related failures in Mach5 Tier[1-7]; Mach5 Tier8 is still running.
>
> Just a suggestion:  I believe adding thread state check in Thread::gc_data() method helps to catch this problem in the future, as the gc_data is usually accessed by GC barrier ...

@zhengyu123's comment from above:

> Just a suggestion: I believe adding thread state check in Thread::gc_data()
> method helps to catch this problem in the future, as the gc_data is usually
> accessed by GC barrier ...

I think we (Runtime) are hoping that the GC folks add something specific that
is intended to catch these kind of problems. If that happens, then this hack
that I'm doing now can be retired. Adding a "thread state" check to
Thread::gc_data() might be the solution, but I would feel more comfortable if
that change was made by GC folks that know this barrier stuff.

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

PR: https://git.openjdk.org/jdk19/pull/20


More information about the hotspot-runtime-dev mailing list