Open Bug 1410982 Opened 7 years ago Updated 2 years ago

Assertion failure: mPromisesForOperation.IsEmpty(), at /builds/worker/workspace/build/src/dom/media/GraphDriver.cpp:555

Categories

(Core :: Web Audio, defect, P2)

defect

Tracking

()

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, testcase)

Attachments

(5 files)

Attached file trigger.html
Testcase found while fuzzing mozilla-central rev ce1a86d3b4db.  Testcase requires the fuzzpriv extension which can be found here:
https://github.com/MozillaSecurity/domfuzz/tree/master/dom/extension

Further, the attached testcase could only be reproduced on an EC2 spot instance with no sound card.
Attached file log_minidump.txt
Attached file log_stderr.txt
Component: Audio/Video → Web Audio
Marking P2 because of crash.

Alex could you have an initial look at what is going on here?
Rank: 25
Flags: needinfo?(achronop)
Priority: -- → P2
Jason, can you try a patch for me?
Flags: needinfo?(achronop) → needinfo?(jkratzer)
(In reply to Alex Chronopoulos [:achronop] from comment #5)
> Jason, can you try a patch for me?

Certainly.  Feel free to pass it along and I'll test.
Flags: needinfo?(jkratzer)
Can you please check if you still repro the crash with this patch on?
Flags: needinfo?(jkratzer)
(In reply to Alex Chronopoulos [:achronop] from comment #7)
> Created attachment 8925873 [details] [diff] [review]
> Bug1410982-protect-mPromisesForOperation.patch
> 
> Can you please check if you still repro the crash with this patch on?

Alex, I cannot reproduce the issue with the patch applied.
Flags: needinfo?(jkratzer)
Attachment #8925873 - Flags: review?(padenot)
Comment on attachment 8925873 [details] [diff] [review]
Bug1410982-protect-mPromisesForOperation.patch

Review of attachment 8925873 [details] [diff] [review]:
-----------------------------------------------------------------

Yes. Please write a proper commit message before landing.
Attachment #8925873 - Flags: review?(padenot) → review+
Comment on attachment 8925873 [details] [diff] [review]
Bug1410982-protect-mPromisesForOperation.patch

Review of attachment 8925873 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/media/GraphDriver.cpp
@@ +553,5 @@
>  AudioCallbackDriver::~AudioCallbackDriver()
>  {
> +#ifdef DEBUG
> +  {
> +    MonitorAutoLock mon(mGraphImpl->GetMonitor());

To me this points to a serious problem in the AudioCallbackDriver code.

mPromisesForOperation is an array owned by the AudioCallbackDriver and not shared with anything else.

That you could have a race in the destructor to access this member, one that requires the monitor to be held, indicates that another thread is still using the AudioCallbackDriver even after the destructor is being called.

That likely points to a UAF.
Comment on attachment 8925873 [details] [diff] [review]
Bug1410982-protect-mPromisesForOperation.patch

Review of attachment 8925873 [details] [diff] [review]:
-----------------------------------------------------------------

sorry, I have to remove this review, because as it is it makes no sense.

If the fix requires the code to hold the monitor to read a private member in the destructor then it means you have a UAF on that object (it is accessed in another thread even after the destructor has been called).
If you don't have a UAF, then requiring the monitor shouldn't be required.

In any case, there's a problem that this change doesn't fix, just hiding the effect.
Attachment #8925873 - Flags: review+

I've requested a backout of the change for bug 1598117, thanks. The failures in the spike look a little different from this bug.

Flags: needinfo?(karlt)
Blocks: 1599448
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: