Closed Bug 1520812 Opened 11 months ago Closed 11 months ago

nsExpatDriver seems to have a bogus mSink assert in HandleError

Categories

(Core :: XML, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 file)

The code is:

  NS_ASSERTION(mSink, "no sink?");

but if we abort the parser via calling Stop() on the docshell while parsing, then we get a stack like this:

#2  0x00007f6cbe92392d in nsExpatDriver::DidBuildModel(nsresult) 
#3  0x00007f6cbe92606f in nsParser::DidBuildModel(nsresult)
#4  0x00007f6cbe9263a1 in nsParser::Terminate()
#5  0x00007f6cbf47e707 in mozilla::dom::Document::StopDocumentLoad()
#6  0x00007f6cc119dfb5 in nsHTMLDocument::StopDocumentLoad()
#7  0x00007f6cc27adf69 in nsDocumentViewer::Stop()

and that nulls out mSink. Then we get a OnStopRequest from necko for the canceled channel, go to report the well-formedness error due to lacking end tags, and hit this assert.

Any time we stop a load of an XML document before we've gotten all the data,
we'll end up in this code with mSink null, because nsParser::Terminate ends up
calling nsExpatDriver::DidBuildModel which nulls out mSink, and not getting all
the data means the XML won't be well-formed.
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6098b2652c6c
Remove bogus assertion in nsExpatDriver::HandleError.  r=hsivonen
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.