RFR (XXS): 7006810: G1: Introduce peace-of-mind checking in the Suspendible Thread Set

Per Liden per.liden at oracle.com
Thu Apr 9 08:48:42 UTC 2015


Hi Joe,

On 2015-04-09 01:29, Joseph Provino wrote:
>
> On 4/7/2015 4:33 AM, Per Liden wrote:
>> Hi Joe,
>>
>> suspendibleThreadSet.cpp:
>>
>>   78 void SuspendibleThreadSet::synchronize() {
>>   79 assert(Thread::current()->has_joined_suspendible_thread_set(),
>>   80     "Must have joined");
>>   ...
>>   93 void SuspendibleThreadSet::desynchronize() {
>>   94 assert(Thread::current()->has_joined_suspendible_thread_set(),
>>   95     "Must have joined");
>>
>> This does not look right to me. The VM thread is the only one calling
>> synchronize/desynchronize, and that should not be part of the sts.
>> Note that you need to enable G1 to test this code path. Did you run
>> this through jprt?
> Hi Per, I did run it through jprt and it passes.  Do you think there's
> still a problem that needs to be addressed?

That jprt run you linked to was not done with the patch you initially 
sent out for review. Anyway, those asserts are not correct. The VM 
thread is never part of the STS. I can easily provoke a crash with java 
-XX:+UseG1GC -version.

There's also a bug here, _suspendible_thread is never properly 
initialized in Thread's constructor and I suspect this might be the 
reason why it sometimes works by accident.

/Per


More information about the hotspot-gc-dev mailing list