bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bugs #8817] Race condition in ClassType.java and cxr.java


From: Per Bothner
Subject: [Bug-kawa] [bugs #8817] Race condition in ClassType.java and cxr.java
Date: Fri, 07 May 2004 02:11:24 -0400
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Gecko/20040113

This mail is an automated notification from the bugs tracker
 of the project: Kawa.

/**************************************************************************/
[bugs #8817] Latest Modifications:

Changes by: 
                Per Bothner <address@hidden>
'Date: 
                Fri 05/07/04 at 06:11 (GMT)

------------------ Additional Follow-up Comments ----------------------------
I check in a patch for cxr.java.






/**************************************************************************/
[bugs #8817] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8817>
Project: Kawa
Submitted by: Chris Dean
On: Thu 05/06/04 at 04:08

Category:  Scheme language
Severity:  5 - Average
Item Group:  Run-time exception
Resolution:  None
Assigned to:  None
Status:  Open


Summary:  Race condition in ClassType.java and cxr.java

Original Submission:  There are two race conditions that I'm seeing when 
running under heavy multi-threaded scenarios.

In ClassType.java we have a few test/set blocks that need a syncronized block 
around them.  For example:
  public Method getDeclaredMethods()
  {
    if ((flags & (ADD_METHODS_DONE|EXISTING_CLASS)) == EXISTING_CLASS)
      addMethods(getReflectClass());
    return methods;
  }

A similar situation exists in cxr.java:
 public Object apply1 (Object arg1)
  {
    if (count == 0)
      program(getName().toString());
   ...

I can provide patches if you'de like.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Fri 05/07/04 at 06:11         By: bothner
I check in a patch for cxr.java.

-------------------------------------------------------
Date: Thu 05/06/04 at 05:54         By: ctdean
Patch to fix is attached.

-------------------------------------------------------
Date: Thu 05/06/04 at 05:15         By: ctdean
Sure, I'll make those changes and send you a patch.

-------------------------------------------------------
Date: Thu 05/06/04 at 05:04         By: bothner
For addMethods, I'd make that synchronized, and add an extra
  if ((flags & ADD_METHODS_DONE) != 0)  return;
We need to do the same for addFields.
One caveat: is this prey to the warnings about "double-locking" and does tha 
matter in practice?

For cxr.java, I don't think we need locking.  Just replace the mask and count 
variables in the program method by local variables, and then set mask and then 
finally count at the end.






File Attachments
-------------------

-------------------------------------------------------
Date: Thu 05/06/04 at 05:54  Name: race.patch  Size: 4KB   By: ctdean

http://savannah.gnu.org/bugs/download.php?item_id=8817&amp;item_file_id=1274






For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=8817>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]