[Bug 1003] New: A ConcurrentModificationException may occur while the IMR is serializing the server table to disk if a new POA is registered at the same time

[email protected] Thu, 05 Mar 2015 16:23:31 +0000
Newsgroups gmane.comp.corba.jacorb.bugs
Message-ID <[email protected]/bugzilla/>
http://www.jacorb.org/bugzilla/show_bug.cgi?id=1003

            Bug ID: 1003
           Summary: A ConcurrentModificationException may occur while the
                    IMR is serializing the server table to disk if a new
                    POA is registered at the same time
           Product: JacORB
           Version: 3.5
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Implementation Repository
          Assignee: [email protected]
          Reporter: [email protected]

One of our customers has reported a CuncurrentModicationException during system
start up:

2015-02-03 12:45:10.049 SEVERE Exception while saving server table
    java.util.ArrayList.writeObject(ArrayList.java:766)
    sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
   
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    ...
   
org.jacorb.imr.ImplementationRepositoryImpl.save_server_table(ImplementationRepositoryImpl.java:825)

This is a manifestation of a race condition that exists between the
WriteThread, which serializes the server_table to disk, and the thread calling
register_poa() with a new POA.  While adquate locking is provided for the
fields in the ServerTable class through its table_lock, the call to

    _server.addPOA(_poa);

while registering a new POA does not fall into the scope of that lock.

This bug was reported against an older version of JacORB, JacORB 2.3.1. 
However, by reviewing the code in the latest head of the upstream, I see that
it is also present there.

I will attach a patch that introduce a new lock to prevent the
ConcurrentModificationException.

--
Weiqi Gao
Principal Software Engineer
Object Computing, Inc.

-- 
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
jacorb-bugs mailing list
[email protected]
https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-bugs