Closed Bug 1025078 Opened 12 years ago Closed 12 years ago

AddressSanitizer: Crash at nsPerformance::GetDOMTiming()

Categories

(Core :: DOM: Core & HTML, defect)

32 Branch
x86_64
macOS
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla33
Tracking Status
firefox31 --- verified
firefox32 --- verified
firefox33 --- verified
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: smichaud, Assigned: smaug)

References

(Blocks 1 open bug)

Details

(Keywords: crash)

Crash Data

Attachments

(4 files)

I just saw this crash, testing with my new Mac ASan build on OS X 10.8.5. http://people.mozilla.org/~stmichaud/bmo/firefox-asan.dmg http://people.mozilla.org/~stmichaud/bmo/firefox-asan-howto.txt I can't find any of these in bmo or Socorro, and they happen in code that hasn't been changed recently. But given the high quality of ASan crash stacks, I figure it's worth opening a bug. Note that the main process appears to have been interacting with a plugin when the crash happened -- my stack (when I attach it) will show the plugin-container process aborting after the main process has died. Though you can't tell (directly) from the stack, the plugin is probably Flash. My Mac ASan builds, though universal, only use ASan in the 64-bit component. And I can't think of any other 64-bit plugins.
Attached file ASan crash log
The crashes happen here: https://hg.mozilla.org/mozilla-central/annotate/48eee276b1ee/dom/base/nsPerformance.h#l272 As best I can tell, the value of mDOMTiming is invalid -- not NULL. If so, then it must have been initialized with an invalid value, here: https://hg.mozilla.org/mozilla-central/annotate/48eee276b1ee/dom/base/nsPerformance.cpp#l370
Group: core-security
Er, not a security bug I think. Just a null pointer crash (null + offset)
Group: core-security
I actually don't think it's a null pointer dereference -- see comment #1. But I agree that it's not security sensitive -- I don't think it can possibly be a use-after-free.
Based on the log it is null + offset crash (which is effectively a null pointer crash).
Assignee: nobody → bugs
So a call to nsRefPtr<blah>::get() on a NULL (or unitialized) nsRefPtr object crashes, like here? I'd have thought it'd return NULL (and not crash).
Attached patch patchSplinter Review
This should do it. As far as I see we end up doing null_nsPerformance->mDOMTiming access. So, null+offset
Attachment #8439998 - Flags: review?(amarchesini)
> As far as I see we end up doing null_nsPerformance->mDOMTiming access. So, null+offset OK, now I get it.
Comment on attachment 8439998 [details] [diff] [review] patch Review of attachment 8439998 [details] [diff] [review]: ----------------------------------------------------------------- Is it correct that the window returns a null Performance object without an error? I think the issue is here: https://mxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindow.cpp#3643 3643 if (mPerformance || !mDoc) { 3644 return; 3645 } Smaug, what do you think about this?
Attachment #8439998 - Flags: review?(amarchesini) → review+
I guess we could make GetPerformance throw in case of null.
Attached patch v2Splinter Review
Attachment #8440014 - Flags: review?(amarchesini)
For what it's worth, I just got another one of these. They must be more common than I thought.
Comment on attachment 8440014 [details] [diff] [review] v2 Review of attachment 8440014 [details] [diff] [review]: ----------------------------------------------------------------- lgtm
Attachment #8440014 - Flags: review?(amarchesini) → review+
Mark it not nullable in the IDL too, if it's no longer nullable?
Too late :/. I wonder why the attribute got [Throws] and ?, yet the spec doesn't have either one.
Because the spec has no concept of "window without a document".
That doesn't explain both [Throws] and ?.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
The [Throws] was due to the fallible forward-to-inner-window...
#22 crash on v30. Not very high on 31 beta, but perhaps that might change when it reaches the release population. Should we uplift?
Crash Signature: [@ nsPerformance::Now()]
Keywords: crash
I think if we uplift depends on the risk of the patch. Saving .5% of our crashes on release is a small step, but one in the right direction. And this happens across all OSes and versions to some degree, see https://crash-stats.mozilla.com/report/list?signature=nsPerformance%3A%3ANow%28%29 Smaug, do you think the risk/reward of this patch warrants an uplift?
Flags: needinfo?(bugs)
Very low risk.
Flags: needinfo?(bugs)
Comment on attachment 8440071 [details] [diff] [review] v3 [Approval Request Comment] Bug caused by (feature/regressing bug #): bug 965860 User impact if declined: crashes Testing completed (on m-c, etc.): landed to m-c two weeks ago Risk to taking this patch (and alternatives if risky): shouldn't be risky String or IDL/UUID changes made by this patch: NA
Attachment #8440071 - Flags: approval-mozilla-beta?
Attachment #8440071 - Flags: approval-mozilla-aurora?
Attachment #8440071 - Flags: approval-mozilla-beta?
Attachment #8440071 - Flags: approval-mozilla-beta+
Attachment #8440071 - Flags: approval-mozilla-aurora?
Attachment #8440071 - Flags: approval-mozilla-aurora+
Steven, is there a way I can reproduce this crash in order to verify that the issue is fixed?
Flags: needinfo?(smichaud)
> Steven, is there a way I can reproduce this crash in order to verify that the issue is fixed? No, these weren't easily reproducible.
Flags: needinfo?(smichaud)
Looking through Socorro (https://crash-stats.mozilla.com/report/list?range_unit=days&range_value=28&signature=nsPerformance%3A%3ANow%28%29#tab-reports) I don't see any more crashes reported for: - Firefox 31 Beta builds after build 20140623175014 (the fix entered Beta on June 26) - Firefox 32 Aurora builds after build 20140625004001 (the fix entered Aurora on June 26) - Firefox 33 Nightly builds after build 20140612030349 (the fix entered Nightly on June 13)
Depends on: 1045096
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: