DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21363>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21363

Race in AbstractDOMParser::parse causes crashes

           Summary: Race in AbstractDOMParser::parse causes crashes
           Product: Xerces-C++
           Version: Nightly build (please specify the date)
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Non-Validating Parser
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Hi,

There's a race on the entrance to AbstractParser::parse():

-------
void AbstractDOMParser::parse(const InputSource& source)
{
    // Avoid multiple entrance
    if (fParseInProgress)
        ThrowXML(IOException, XMLExcepts::Gen_ParseInProgress);

    try
    {
        fParseInProgress = true;
-------

The comment is misleading.. although it could/might avoid multiple entrance, it
doesn't in any way guarantee it.  The result is that two threads can pass the
test and set the flag.  This causes crashes and other weird behaviour. 
Test-and-set checks like this should be performed using a locking mechanism.

Cheers,

Matthew Duggan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to