<html>
    <head>
      <base href="http://www.jacorb.org/bugzilla/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - NullPointerException during ORB initialization"
   href="http://www.jacorb.org/bugzilla/show_bug.cgi?id=994">994</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>NullPointerException during ORB initialization
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>JacORB
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.5
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P5
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>ORB
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>jacorb-bugs@lists.spline.inf.fu-berlin.de
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>franky.bugzilla@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm running multiple ORB instances (each with different properties) within a
single JVM. The differnt ORB instances are initialized in parallel on multiple
threads. All goes well until today where I got a NullPointerException during
orb initialization:
java.lang.NullPointerException
at
org.omg.CONV_FRAME.CodeSetComponentHelper.write(CodeSetComponentHelper.java:68)
at
org.omg.CONV_FRAME.CodeSetComponentInfoHelper.write(CodeSetComponentInfoHelper.java:68)
at
org.jacorb.orb.standardInterceptors.CodeSetInfoInterceptor.<init>(CodeSetInfoInterceptor.java:57)
at
org.jacorb.orb.standardInterceptors.IORInterceptorInitializer.post_init(IORInterceptorInitializer.java:61)
at org.jacorb.orb.ORB.interceptorPostInit(ORB.java:2147)
at org.jacorb.orb.ORB.internalInit(ORB.java:2005)
at org.jacorb.orb.ORB.set_parameters(ORB.java:1953)
at org.omg.CORBA.ORB.init(ORB.java:251)

After some digging in the code, I've found out that the problem lies in
org.jacorb.orb.giop.CodeSet's method "getLocalCodeSetComponentInfo" which is
not correctly implemented for concurrent access: In this method a first thread
can have created "localCodeSetComponentInfo" but not filled in the field
"ForCharData" yet and a second thread can then return this half initialized
"localCodeSetComponentInfo" object as the first check on
"localCodeSetComponentInfo" being null is not within the synchronized block.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>