Skip to content

Xpp3DomBuilder.createXmlReader() system property race condition #392

Closed

Description

@elharo

Xpp3DomBuilder.createXmlReader() (lines 119-129) clears and restores the global org.xml.sax.driver system property without synchronization. In a multi-threaded environment (like Maven parallel builds), one thread's clear/restore sequence can interfere with another thread's read or write of the same property. The code even acknowledges this with the comment: "There's a 'slight' problem with this an parallel maven: It does not work ;)"

The method already tries to directly instantiate com.sun.org.apache.xerces.internal.parsers.SAXParser first (line 114), which succeeds on all Oracle/OpenJDK JVMs. The system property manipulation fallback is both unnecessary and harmful.

Fix: remove the system property manipulation. If the direct instantiation fails, just call XMLReaderFactory.createXMLReader() without modifying any system properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions