RFR: 8261391: ZGC crash - SEGV in RevokeOneBias::do_thread [v3]

Robbin Ehn rehn at openjdk.java.net
Fri Feb 19 07:41:39 UTC 2021


On Thu, 18 Feb 2021 02:19:58 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Tiny spelling error
>
> Hi Robbin,
> 
> I think there is a bug in your fix wrt. async handshakes - see below.
> 
> More generally I am concerned by the fact that we have a potential bug if a Handle created by one thread is accessed by another, without first calling start_processing() on the creator of the Handle. This would seem to be error prone to me unless it is actually hidden away inside the Handle implementation - though how to do that efficiently is unclear. I'm very concerned that it is too easy to write code (eg. handing something off to the  service thread or notification thread) that will be buggy.
> 
> Perhaps @fisk can comment on the general problem.
> 
> Thanks,
> David

> _Mailing list message from [David Holmes](mailto:david.holmes at oracle.com) on [hotspot-runtime-dev](mailto:hotspot-runtime-dev at openjdk.java.net):_
> 
> Correction ...
> 
> On 18/02/2021 12:22 pm, David Holmes wrote:
> 
> > More generally I am concerned by the fact that we have a potential bug if a Handle created by one thread is accessed by another, without first calling start_processing() on the creator of the Handle. This would seem to be error prone to me unless it is actually hidden away inside the Handle implementation - though how to do that efficiently is unclear. I'm very concerned that it is too easy to write code (eg. handing something off to the  service thread or notification thread) that will be buggy.
> 
> I was confusing Handles with Resources in terms of lifecycle - not
> realising Handles are stack-local to a Thread and can only be shared
> with another thread very, very carefully.

Yes, but I do not intended to address if we should disallow passing Handles or if Handles should handle this automatically.
IMHO the right thing would be a 'GlobalHandle' (with oop backing in oopStorage) which you can give owner ship of to another thread.

Are you ok with the change?

> 
> David

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

PR: https://git.openjdk.java.net/jdk/pull/2571


More information about the hotspot-runtime-dev mailing list