Closed
Bug 515109
Opened 15 years ago
Closed 3 months ago
DTD parser breaks if chrome/jar file not found (breaks about:rights in Fennec trunk)
Categories
(Core :: XML, defect)
Core
XML
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: Gavin, Unassigned)
References
Details
(Keywords: regression)
Attachments
(1 obsolete file)
Seems like brand.dtd is failing to load somehow. This doesn't occur on 1.9.2.
Comment 2•15 years ago
|
||
So I debugged this and found that after security.dtd fails to load, the last dtd (ie aboutRights.dtd) no longer gets loaded at all (from nsExpatDriver.cpp). I'm not sure why that doesn't fail just as hard in 1.9.2. I did verify that swapping the two dtd's in the xhtml file fixes the issue. I'll have a look if I can figure out why this is broken when it didn't used to be... Might be that the expat bits would need to be fixed rather than swapping the dtds as a workaround.
Comment 3•15 years ago
|
||
OK, I think I found the culprit. Expat attempts to load the security.dtd file. On trunk, that leads to the following stack of calls: nsExpatDriver::HandleExternalEntityRef (nsExpatDriver.cpp:734) nsExpatDriver::OpenInputStreamFromExternalDTD (nsExpatDriver.cpp:825) NS_OpenURI (/nsNetUtil.h:228) nsJARChannel::Open (nsJARChannel.cpp:677) because of bug 512515, on trunk this now returns NS_FILE_NOT_FOUND, whereas on branch nothing happens (it just returns NS_OK at the end of the method). I *think* the proper fix is to get expat to not balk completely about NS_FILE_NOT_FOUND, and continue loading the rest of the DTD references, but I'd like a second opinion. :-) For now, marking this as depending on bug 512515.
Depends on: 512515
Keywords: regression
Reporter | ||
Updated•15 years ago
|
Reporter | ||
Comment 4•15 years ago
|
||
(In reply to comment #3) > I *think* the proper fix is to get expat to not balk completely about > NS_FILE_NOT_FOUND, and continue loading the rest of the DTD references, but I'd > like a second opinion. :-) Sounds right to me.
Comment 5•15 years ago
|
||
So, it's actually slightly more subtle still, as whether parsing continues depends on some internal expat stuff. Just returning "1" (as the NS_ENSURE_SUCCESS calls actually do) isn't enough and leads to parsing being stopped. IIRC, on branch, we still create a stream, it's just empty and nothing gets parsed. This patch mimics that behaviour on trunk, although I'm not sure if this approach is entirely correct. I'm happy to take suggestions on how to make this better if necessary - requesting review to get such suggestions :-). owners.html suggests peterv, if I should be asking someone else, please let me know...
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #414245 -
Flags: review?(peterv)
Updated•15 years ago
|
Assignee: gijskruitbosch+bugs → nobody
Component: General → XML
Product: Fennec → Core
QA Contact: general → xml
Summary: about:rights broken in Fennec trunk builds → DTD parser breaks if chrome/jar file not found (breaks about:rights in Fennec trunk)
Comment 7•14 years ago
|
||
Peter, could you have a look at this? If you're busy, can you suggest someone else to take the review? Thanks!
Comment 8•14 years ago
|
||
Can we get a NS_WARNING if the dtd isn't found? Seems like we shouldn't normally try to point to missing dtds if we can help it.
Comment 9•14 years ago
|
||
This is a mass change. Every comment has "assigned-to-new" in it. I didn't look through the bugs, so I'm sorry if I change a bug which shouldn't be changed. But I guess these bugs are just bugs that were once assigned and people forgot to change the Status back when unassigning.
Status: ASSIGNED → NEW
Comment 10•14 years ago
|
||
Peter: any chance of a review on this? :-)
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Comment 11•14 years ago
|
||
Reproducible with the build identifier: Mozilla /5.0 (Maemo;Linux armv7l;rv:2.0b6pre)Gecko/20100913 Firefox/4.0b6pre Fennec /2.0b1pre
Comment 12•13 years ago
|
||
@Peter: any chance to get a review on this patch? It's been over a year. :-) @Everyone else: suggestions for alternative reviewers/courses of action here?
Comment 13•13 years ago
|
||
Comment on attachment 414245 [details] [diff] [review] Rough patch Why do we need to create the external entity parser if we don't have a stream? That seems wrong.
Updated•11 years ago
|
Attachment #414245 -
Attachment is obsolete: true
Attachment #414245 -
Flags: review?(peterv)
Updated•11 years ago
|
Assignee: gijskruitbosch+bugs → nobody
Comment 15•5 years ago
|
||
Axel, should we go ahead and parse the rest of the DTDs even if one of them fails to load? We do parse the rest of the document... Simple testcase:
<?xml version="1.0"?>
<!DOCTYPE html [
<!ENTITY % fakeDTD SYSTEM "foo:bar"> %fakeDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd"> %globalDTD;
]>
<root>&locale.dir;</root>
This came up in https://phabricator.services.mozilla.com/D34656 though it's not the main thing going wrong there.
Flags: needinfo?(l10n)
Comment 16•5 years ago
|
||
I think that'd be a good idea. We should probably report to the console still, because, by all likelyhood, the parser is gonna break later on missing entities ;-).
Flags: needinfo?(l10n)
Updated•2 years ago
|
Severity: normal → S3
Comment 17•3 months ago
|
||
No more DTDs, whee!
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•