Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-2172

WantPropertyElement.rdf_n() is not thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Jena 2.7.4, Jena 4.2.0
    • Jena 4.3.0
    • RDF/XML
    • None

    Description

      In 2.7.4, concurrent calls to Model.read (on RDF/XML) are occasionally corrupting internal parser state which results in NPE.  This corruption is sticky - all subsequent RDF/XML parsing (at least via Model.read) is potentially affected.

      com.hp.hpl.jena.rdf.arp.states.WantPropertyElement._rdf_n can be left with null elements when multiple threads race to expand the array.  One consequence of such null elements is that WantPropertyElement.predicate can be null, causing a NullPointerException when toObject() is called.

      This was discovered in 2.7.4, but the same code is present in org.apache.jena.rdfxml.xmlinput.states.WantPropertyElement.  (I don't know the role that code plays in the latest Jena versions, so this issue may not be manifest in main.)

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              img ian green
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: