This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Remove data race in libgcj interpreter


Bryce McKinlay wrote:
> On Thu, Aug 21, 2008 at 2:03 PM, Andrew Haley <aph@redhat.com> wrote:
> 
>> I've discovered a nasty data race in libgcj's interpreter.
>>
>> It is the cause of several bug reports, in particular
>> https://bugzilla.redhat.com/show_bug.cgi?id=458921
>>
>> An optimization rerwites instructions of the form
>>
>>  invokespecial <constant pool index>
>>
>> to
>>
>>  invokespecial_resolved <address>
>>
>> the first time that each invokespecial is encountered.
>>
>> However, in the presence of multiple threads this breaks.
> 
> Ahh, yeah. I remember this bug:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8995
> 
> As Tom suggests, the proper fix may be to do all the rewriting in the
> compile phase, which is protected by a lock.

Ah right, thanks.  It's rather appalling that we once knew about this
bug but didn't fix it, preferring a fast interpreter to a correct one.
Thankfully, my name doesn't appear on any of the comments!  :-)

> There is at least one other interpreter bug which shows up only on
> multi-core systems:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16902

Thanks.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]