The default bug view has changed. See this FAQ.

about:memory can fail due to generating invalid XML

VERIFIED FIXED in Firefox 9

Status

()

Toolkit
about:memory
P2
normal
VERIFIED FIXED
6 years ago
5 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

({verified-aurora, verified-beta})

Trunk
mozilla10
x86
Mac OS X
verified-aurora, verified-beta
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(firefox9 fixed)

Details

(Whiteboard: [qa!])

Attachments

(1 attachment)

When I open about:memory?verbose in my build right now, I get a blank page and an XML well-formedness error in the error console.  The culprit is this:

<span class='mrName hasDesc' title='The sum of all entries below &#39;shell(javascript:&#39;<html></html>&#39;)&#39;.'>shell(javascript:&#39;&lt;html&gt;&lt;/html&gt;&#39;)</span>

'<' is not allowed in attribute values in XML.

The relevant part of aboutMemory.js is this:

852   var text = "-- <span class='mrName hasDesc' title='" +
853              kindToString(aKind) + prepDesc(aDesc) +
854              "'>" + prepName(aName) + "</span>";

where prepName escapes '&', '<', '>', '\'', and '"' while prepDesc only escapes '&' and '\''.  At the very least, prepDesc needs to escape '<'.  But is there any reason at all to not use prepName in both places?  Not posting a patch for now on the off chance that I'm missing something here...
I don't think you're missing something...
Created attachment 564110 [details] [diff] [review]
proposed fix

I left the separate prepName/prepDesc functions in case we actually want to do more processing on one of them sometime.  Let me know if you'd prefer they just be merged.
Attachment #564110 - Flags: review?(justin.lebar+bug)
Assignee: nobody → bzbarsky
Priority: -- → P2
Whiteboard: [need review]
Comment on attachment 564110 [details] [diff] [review]
proposed fix

r=me, but please remove escapeQuotes() -- it's not used, and it sounds like it's not correct under any circumstances!
Attachment #564110 - Flags: review?(justin.lebar+bug) → review+
Whiteboard: [need review] → [need landing]
https://hg.mozilla.org/integration/mozilla-inbound/rev/092140ecc44c

Justin, do you think we want this on aurora/beta?
Flags: in-testsuite?
Whiteboard: [need landing]
Target Milestone: --- → mozilla10
I don't think it's critical to take on aurora/beta, but it would be nice, since if someone has a memory problem and hits this case, we can't get any data out of them.
Comment on attachment 564110 [details] [diff] [review]
proposed fix

Requesting aurora approval.  This should be pretty safe, and we need all the memory info we can get.

I'm not going to try to get this into beta.  Too much risk/reward ratio at that point, I think, if the risk is anything but 0.
Attachment #564110 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/092140ecc44c
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Attachment #564110 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/6763937c5a1f
status-firefox9: --- → fixed
Whiteboard: [qa+]

Comment 9

5 years ago
Setting resolution to Verified Fixed on:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0 beta 3
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0a2) Gecko/20111127 Firefox/10.0a2
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0a1) Gecko/20111127 Firefox/11.0a1

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20100101 Firefox/9.0 beta 3
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0a2) Gecko/20111127 Firefox/10.0a2
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0a1) Gecko/20111128 Firefox/11.0a1

The about:memory?verbose page is displayed properly.
Status: RESOLVED → VERIFIED
Keywords: verified-aurora, verified-beta
Whiteboard: [qa+] → [qa!]
You need to log in before you can comment on or make changes to this bug.