Report telemetry when the IO layer feeds a zero-length stream to the parser
Categories
(Core :: XML, task)
Tracking
()
People
(Reporter: zbraniecki, Unassigned)
References
(Blocks 1 open bug)
Details
Initial telemetry indicates that one of the more common sources of YSOD on Beta is that .xhtml (XUL) documents are erroring out with NO_ELEMENTS
and UNKNOWN_ENTITY
errors.
For the former, it seems pretty plausible that the reason is that IO layer feeds a zero-byte long document to the parser.
For the latter, it is also possible that the IO layer feeds a zero-byte long DTD document to the parser.
Henri suggested on Matrix to add a flag to nsParser that would get flipped at https://searchfox.org/mozilla-central/source/parser/htmlparser/nsParser.cpp#1275 when OnDataAvailable
sees a non-zero-length buffer and then in OnStopRequest
have a probe that checks the flag.
Henri:
- Will that cover both XML and DTD files?
- Is there a risk that the last block of data is going to be empty and the flag ends up being
true
inOnStopRequest
? - Is there any additional data we could collect in such telemetry event to help us with the next step if we indeed confirm the hypothesis that 0-byte long documents correlate with the errors? (like, which IO causes it etc.)
Comment 1•4 years ago
|
||
(In reply to Zibi Braniecki [:zbraniecki][:gandalf] from comment #0)
- Will that cover both XML and DTD files?
No, DTDs are here:
https://searchfox.org/mozilla-central/rev/f4b4008f5ee00f5afa3095f48c54f16828e4b22b/parser/htmlparser/nsExpatDriver.cpp#595
- Is there a risk that the last block of data is going to be empty and the flag ends up being
true
inOnStopRequest
?
We should have a "has seen at least one byte" flag and set the flag if any OnDataAvailable
call reports more that zero bytes.
- Is there any additional data we could collect in such telemetry event to help us with the next step if we indeed confirm the hypothesis that 0-byte long documents correlate with the errors? (like, which IO causes it etc.)
Redirecting this question to Necko.
Comment 2•4 years ago
|
||
OnDataAvailable should not be call with count==0. That is per the design. Is it possible that count is not 0 but actually data is not available. We could check Available() if it implemented by the stream.
The data is always coming from omni.ja, is this right? In that case we can add some telemetry to nsJARChannel::OnDataAvailable.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Description
•