Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent access issue during XML CRS configuration parsing in deegree leading to CRSConfigurationException #1725

Open
julianzz98 opened this issue Jul 23, 2024 · 0 comments
Labels
bug error issue and bug (fix)

Comments

@julianzz98
Copy link
Contributor

We have observed a concurrent access issue during the parsing of XML CRS configuration files in deegree. Specifically, test failures have been noted in parameterized tests and asynchronously executed tests. These failures are characterized by a CRSConfigurationException caused by an XML parsing error, suggesting that the file might be incomplete or corrupted.

The error observed indicates a potential race condition and inconsistent states during XML parsing.

Stacktrace of the CRSConfigurationException:

org.deegree.cs.exceptions.CRSConfigurationException: 
com.ctc.wstx.exc.WstxParsingException: Unexpected '<' character in element (missing closing '>'?)
 at [row,col,system-id]: [15,12,"jar:file:/.../.repository/de/latlon/deegree-core-cs/3.6.0-SNAPSHOT/deegree-core-cs-3.6.0-SNAPSHOT.jar!/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml"]
	at org.deegree.cs.persistence.deegree.d3.parsers.ProjectionParser.getProjectionForId(ProjectionParser.java:283)
	at org.deegree.cs.persistence.deegree.d3.DeegreeCRSStore.getCRSResource(DeegreeCRSStore.java:316)
	at org.deegree.cs.persistence.deegree.d3.DeegreeReferenceResolver.getObject(DeegreeReferenceResolver.java:68)
	at org.deegree.commons.tom.Reference.getReferencedObject(Reference.java:150)
	at org.deegree.cs.refs.projections.ProjectionRef.doInverseProjection(ProjectionRef.java:75)
	at org.deegree.cs.coordinatesystems.ProjectedCRS.doInverseProjection(ProjectedCRS.java:172)
	at org.deegree.cs.transformations.coordinate.ProjectionTransform.doInverseTransform(ProjectionTransform.java:220)
	at org.deegree.cs.transformations.coordinate.ProjectionTransform.doTransform(ProjectionTransform.java:135)
	at org.deegree.cs.transformations.coordinate.ConcatenatedTransform.doTransform(ConcatenatedTransform.java:112)
	at org.deegree.cs.transformations.coordinate.ConcatenatedTransform.doTransform(ConcatenatedTransform.java:112)
	at org.deegree.geometry.GeometryTransformer.transform(GeometryTransformer.java:531)
	at org.deegree.geometry.GeometryTransformer.transform(GeometryTransformer.java:483)
	at org.deegree.geometry.GeometryTransformer.transform(GeometryTransformer.java:304)
	at org.deegree.geometry.GeometryTransformer.transform(GeometryTransformer.java:270)
	at org.deegree.geometry.GeometryTransformer.transform(GeometryTransformer.java:170)
	...
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected '<' character in element (missing closing '>'?)
 at [row,col,system-id]: [15,12,"jar:file:/.../.repository/de/latlon/deegree-core-cs/3.6.0-SNAPSHOT/deegree-core-cs-3.6.0-SNAPSHOT.jar!/org/deegree/cs/persistence/deegree/d3/config/projection-definitions.xml"]
	at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:634)
	at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:504)
	at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:488)
	at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:3075)
	at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:3030)
	at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2908)
	at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1121)
	at org.deegree.commons.xml.stax.XMLStreamUtils.nextElement(XMLStreamUtils.java:630)
	at org.deegree.commons.xml.stax.XMLStreamUtils.moveReaderToFirstMatch(XMLStreamUtils.java:800)
	at org.deegree.cs.persistence.deegree.d3.parsers.DefinitionParser.moveReaderToNextIdentifiable(DefinitionParser.java:306)
	at org.deegree.cs.persistence.deegree.d3.parsers.ProjectionParser.parseProjection(ProjectionParser.java:126)
	at org.deegree.cs.persistence.deegree.d3.parsers.ProjectionParser.getProjectionForId(ProjectionParser.java:277)
	... 63 more

This problem suggests that the current handling of concurrent access to the CRS resources in deegree may not be robust enough, leading to potential race conditions and inconsistent states during XML parsing.

@julianzz98 julianzz98 added the bug error issue and bug (fix) label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug error issue and bug (fix)
Projects
None yet
Development

No branches or pull requests

1 participant