[SCUFL2-120] Stack overflow when parsing profile with nodes of type collection Created: 2012-04-04  Updated: 2013-04-23  Resolved: 2012-04-23

Status: Resolved
Project: Scufl 2
Component/s: scufl parser
Affects Version/s: 0.9.2
Fix Version/s: 0.11.0

Type: Bug Priority: Blocker
Reporter: David Withers (Inactive) Assignee: Stian Soiland-Reyes
Resolution: Fixed Votes: 0
Labels: profile, rdfxml, scufl2tools, workflowBundle
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS X, Java 1.6


Attachments: File apiconsumer.scufl2    
Issue Links:
Depends
has dependent SCAPE-3 OSGi Tavern 3 command-line - multiple... In Progress

 Description   

Getting a stack overflow when reading a workflow bundle. Using WorkflowBundleIO to read a t2flow, write it out as a workflow bundle and the read the bundle back in.

WorkflowBundle bundle = workflowBundleIO.readBundle(t2FlowWorkflow, null);
workflowBundleIO.writeBundle(bundle, workflowFile, RDFXMLReader.APPLICATION_VND_TAVERNA_SCUFL2_WORKFLOW_BUNDLE);
bundle = workflowBundleIO.readBundle(workflowFile, null);

The stack trace is

java.lang.StackOverflowError
	at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.freeNodeListCache(CoreDocumentImpl.java:2299)
	at com.sun.org.apache.xerces.internal.dom.ParentNode.nodeListItem(ParentNode.java:774)
	at com.sun.org.apache.xerces.internal.dom.ParentNode.item(ParentNode.java:796)
	at uk.org.taverna.scufl2.rdfxml.ProfileParser$1$1.next(ProfileParser.java:80)
	at uk.org.taverna.scufl2.rdfxml.ProfileParser$1$1.next(ProfileParser.java:70)
	at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseList(ProfileParser.java:214)
	at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseElement(ProfileParser.java:159)
	at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseList(ProfileParser.java:218)
	at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseElement(ProfileParser.java:159)
	at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseList(ProfileParser.java:218)
	at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseElement(ProfileParser.java:159)
	at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseList(ProfileParser.java:218)
	at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseElement(ProfileParser.java:159)
...

It looks like an error in ProfileParser

ProfileParser.java
protected PropertyObject parseList(Element element) throws ReaderException {
	PropertyList propertyList = new PropertyList();
	for (Node node : nodeIterable(element.getChildNodes())) {
		if (!(node instanceof Element)) {
			continue;
		}
		PropertyObject propertyObject = parseElement(element);//should be parseElement(node)?
		propertyList.add(propertyObject);
	}
	return propertyList;
}


 Comments   
Comment by David Withers (Inactive) [ 2012-04-04 ]

Attached the workflow bundle causing the error.

Comment by Stian Soiland-Reyes [ 2012-04-05 ]

Could you try my patch at https://github.com/myGrid/scufl2 ?

On Wed, Apr 4, 2012 at 18:07, David Withers (JIRA) <issues@mygrid.org.uk> wrote:
>
>     [ http://www.mygrid.org.uk/dev/issues/browse/SCUFL2-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> David Withers updated SCUFL2-120:
> ---------------------------------
>
>    Attachment: apiconsumer.scufl2
>
> Attached the workflow bundle causing the error.
>
>> Stack overflow when parsing profile with nodes of type collection
>> -----------------------------------------------------------------
>>
>>                 Key: SCUFL2-120
>>                 URL: http://www.mygrid.org.uk/dev/issues/browse/SCUFL2-120
>>             Project: Scufl 2
>>          Issue Type: Bug
>>          Components: scufl parser
>>    Affects Versions: 0.9.2
>>         Environment: OS X, Java 1.6
>>            Reporter: David Withers
>>            Assignee: Stian Soiland-Reyes
>>            Priority: Blocker
>>              Labels: profile, rdfxml, scufl2tools, workflowBundle
>>         Attachments: apiconsumer.scufl2
>>
>>
>> Getting a stack overflow when reading a workflow bundle. Using WorkflowBundleIO to read a t2flow, write it out as a workflow bundle and the read the bundle back in.
>>

>> WorkflowBundle bundle = workflowBundleIO.readBundle(t2FlowWorkflow, null);
>> workflowBundleIO.writeBundle(bundle, workflowFile, RDFXMLReader.APPLICATION_VND_TAVERNA_SCUFL2_WORKFLOW_BUNDLE);
>> bundle = workflowBundleIO.readBundle(workflowFile, null);
>> 

>> The stack trace is
>>

>> java.lang.StackOverflowError
>>       at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.freeNodeListCache(CoreDocumentImpl.java:2299)
>>       at com.sun.org.apache.xerces.internal.dom.ParentNode.nodeListItem(ParentNode.java:774)
>>       at com.sun.org.apache.xerces.internal.dom.ParentNode.item(ParentNode.java:796)
>>       at uk.org.taverna.scufl2.rdfxml.ProfileParser$1$1.next(ProfileParser.java:80)
>>       at uk.org.taverna.scufl2.rdfxml.ProfileParser$1$1.next(ProfileParser.java:70)
>>       at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseList(ProfileParser.java:214)
>>       at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseElement(ProfileParser.java:159)
>>       at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseList(ProfileParser.java:218)
>>       at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseElement(ProfileParser.java:159)
>>       at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseList(ProfileParser.java:218)
>>       at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseElement(ProfileParser.java:159)
>>       at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseList(ProfileParser.java:218)
>>       at uk.org.taverna.scufl2.rdfxml.ProfileParser.parseElement(ProfileParser.java:159)
>> ...
>> 

>> It looks like an error in ProfileParser
>>

ProfileParser.java
>> protected PropertyObject parseList(Element element) throws ReaderException {
>>       PropertyList propertyList = new PropertyList();
>>       for (Node node : nodeIterable(element.getChildNodes())) {
>>               if (!(node instanceof Element)) {
>>                       continue;
>>               }
>>               PropertyObject propertyObject = parseElement(element);//should be parseElement(node)?
>>               propertyList.add(propertyObject);
>>       }
>>       return propertyList;
>> }
>> 

>
> –
> This message is automatically generated by JIRA.
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>


Stian Soiland-Reyes, myGrid team
School of Computer Science
The University of Manchester

Comment by Hudson Daemon [ 2012-05-14 ]

Integrated in uk.org.taverna.scufl2 #206
SCUFL2-120 Fix for StackOverflowError

Comment by Jenkins Automated build [ 2012-06-14 ]

Integrated in scufl2 #3454
SCUFL2-120 Avoid stack overflow parsing property lists (Revision 42d391a5a4c981a0a5e42252b237465599134b65)

Result = SUCCESS
stian : 42d391a5a4c981a0a5e42252b237465599134b65
Files :

  • scufl2-rdfxml/src/main/java/uk/org/taverna/scufl2/rdfxml/ProfileParser.java
Comment by Jenkins Automated build [ 2012-07-09 ]

Integrated in scufl2 #3467
Test for SCUFL2-120 (Revision 07b28c1824b4c00ee154ce359ab0e6fa4fbd4078)

Result = SUCCESS
stian : 07b28c1824b4c00ee154ce359ab0e6fa4fbd4078
Files :

  • scufl2-t2flow/pom.xml
  • scufl2-t2flow/src/test/resources/apiconsumer.t2flow
  • scufl2-t2flow/src/test/java/uk/org/taverna/scufl2/translator/t2flow/PropertyListRoundtripTest.java
Comment by Jenkins Automated build [ 2012-07-09 ]

Integrated in scufl2 #3468
Test for SCUFL2-120 (Revision 07b28c1824b4c00ee154ce359ab0e6fa4fbd4078)

Result = SUCCESS
stian : 07b28c1824b4c00ee154ce359ab0e6fa4fbd4078
Files :

  • scufl2-t2flow/pom.xml
  • scufl2-t2flow/src/test/resources/apiconsumer.t2flow
  • scufl2-t2flow/src/test/java/uk/org/taverna/scufl2/translator/t2flow/PropertyListRoundtripTest.java
Comment by Jenkins Automated build [ 2012-10-05 ]

Integrated in scufl2 #3488
Test for SCUFL2-120 (Revision 8cfd90303f44f2f964aa532e2036b23ee0b89edd)

Result = SUCCESS
stian@mygrid.org.uk : 8cfd90303f44f2f964aa532e2036b23ee0b89edd
Files :

  • scufl2-t2flow/pom.xml
  • scufl2-t2flow/src/test/resources/apiconsumer.t2flow
  • scufl2-t2flow/src/test/java/uk/org/taverna/scufl2/translator/t2flow/PropertyListRoundtripTest.java
Generated at Mon Jun 24 17:39:12 BST 2019 using JIRA 6.1.2#6157-sha1:98c729218aad6de1537eb8e98889ee5562c90d96.