bug-classpath
[Top][All Lists]
Advanced

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

[Bug classpath/32162] New: SPECjbb2005 Crashes with XML Exception


From: robin dot garner at anu dot edu dot au
Subject: [Bug classpath/32162] New: SPECjbb2005 Crashes with XML Exception
Date: 31 May 2007 07:10:40 -0000

On multiprocessor machines SPECjbb2005 often crashes with stack trace similar
to that attached at the end of this description.  Problem discovered on
JikesRVM, but no reason to suspect it is platform-specific.  

This appears to be a concurrency error in the classpath implementation of
DomNode.  During cloning, all nodes except the root have the wrong 'owner', and
so the 'building' field is subject to change by other threads in unexpected
ways.  Patch attached.

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

WARNING: Exception: null
java.lang.reflect.InvocationTargetException
        at java.lang.Throwable.fillInStackTrace(Throwable.java:106)
        at java.lang.Throwable.<init>(Throwable.java:50)
        at java.lang.Throwable.<init>(Throwable.java:55)
        at java.lang.Throwable.<init>(Throwable.java:65)
        at java.lang.Exception.<init>(Exception.java:90)
        at
java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:98)
        at
java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:86)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:130)
        at spec.jbb.Transaction.getInstance((null); machine code offset:
0x00000175)
        at spec.jbb.TransactionManager.createTxnInstances((null); machine code
offset: 0x0000011A)
        at spec.jbb.TransactionManager.go((null):0)
        at spec.jbb.JBBmain.run((null); machine code offset: 0x00000196)
        at java.lang.Thread.run(Thread.java:343)
Caused by: gnu.xml.dom.DomDOMException: The node doesn't belong here.
More Information: can't append COMMENT_NODE to node of type DOCUMENT_TYPE_NODE
Node Name: JBB-Document
        at gnu.xml.dom.DomNode.checkMisc(DomNode.java:377)
        at gnu.xml.dom.DomNode.appendChild(DomNode.java:550)
        at gnu.xml.dom.DomNode.cloneNode(DomNode.java:1123)
        at gnu.xml.dom.DomNode.cloneNode(DomNode.java:1121)
        at spec.jbb.infra.Util.XMLTransactionLog.copy((null); machine code
offset: 0x00000062)
        at spec.jbb.infra.Util.XMLTransactionLog.<init>((null); machine code
offset: 0x000000E4)
        at spec.jbb.NewOrderTransaction.<init>((null); machine code offset:
0x00000D1B)
        at <invisible method>
        at org.jikesrvm.runtime.VM_Reflection.invoke(VM_Reflection.java:131)
        at org.jikesrvm.runtime.VM_Reflection.invoke(VM_Reflection.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:128)
        at spec.jbb.Transaction.getInstance((null); machine code offset:
0x00000175)
        at spec.jbb.TransactionManager.createTxnInstances((null); machine code
offset: 0x0000011A)
        at spec.jbb.TransactionManager.go((null):0)
        at spec.jbb.JBBmain.run((null); machine code offset: 0x00000196)
        at java.lang.Thread.run(Thread.java:343)
Timing Measurement began Thu May 31 10:10:32 GMT-04:00 2007 for 4 minutes
Exception in thread "Thread-8": java.lang.NullPointerException
        at spec.jbb.TransactionManager.runTxn((null):0)
        at spec.jbb.TransactionManager.goManual((null):0)
        at spec.jbb.TransactionManager.go((null):0)
        at spec.jbb.JBBmain.run((null); machine code offset: 0x00000196)
        at java.lang.Thread.run(Thread.java:343)
Timing Measurement ended Thu May 31 10:14:32 GMT-04:00 2007

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

Index: gnu/xml/dom/DomNode.java 
===================================================================
diff -r gnu/xml/dom/DomNode.java 
1111,1112d1110
<     DomNode node = (DomNode) clone();
<     
1115,1117c1113,1135
<         DomDocument doc = (nodeType == DOCUMENT_NODE) ?
<           (DomDocument) node : node.owner;
<         boolean building = doc.building;
---
>         return cloneNodeDeepInternal(true, null);
>       }
> 
>     DomNode node = (DomNode) clone();
>     if (nodeType == ENTITY_REFERENCE_NODE)
>       {
>         node.makeReadonly();
>       }
>     notifyUserDataHandlers(UserDataHandler.NODE_CLONED, this, node);
>     return node;
>   }
> 
>   /**
>    * Returns a deep clone of this node.
>    */
>   private DomNode cloneNodeDeepInternal(boolean root, DomDocument doc)
>   {
>     DomNode node = (DomNode) clone();
>     boolean building = false; // Never used unless root is true
>     if (root)
>       {
>         doc = (nodeType == DOCUMENT_NODE) ? (DomDocument) node : node.owner;
>         building = doc.building;
1119,1125c1137,1142
<         for (DomNode ctx = first; ctx != null; ctx = ctx.next)
<           {
<             DomNode newChild = (DomNode) ctx.cloneNode(deep);
<             newChild.setOwner(doc);
<             node.appendChild(newChild);
<           }
<         doc.building = building;
---
>       }
>     node.owner = doc;
>     for (DomNode ctx = first; ctx != null; ctx = ctx.next)
>       {
>         DomNode newChild = ctx.cloneNodeDeepInternal(false, doc);
>         node.appendChild(newChild);
1130a1148,1151
>     if (root)
>       {
>         doc.building = building;
>       }


-- 
           Summary: SPECjbb2005 Crashes with XML Exception
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: robin dot garner at anu dot edu dot au


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32162





reply via email to

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