Closed Bug 1397528 Opened 7 years ago Closed 5 years ago

Assertion failure: rv, at /home/worker/workspace/build/src/dom/media/MediaManager.cpp:2778

Categories

(Core :: WebRTC: Audio/Video, defect, P3)

55 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- wontfix
firefox-esr68 --- wontfix
firefox55 --- wontfix
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- wontfix
firefox67 --- wontfix
firefox68 --- wontfix
firefox69 --- wontfix
firefox70 --- wontfix
firefox71 --- fixed

People

(Reporter: jkratzer, Assigned: pehrsons)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, regression, testcase)

Attachments

(3 files, 2 obsolete files)

Attached file trigger.html (obsolete) —
Testcase found while fuzzing mozilla-central rev 20170905-3ecda4678c49.
Flags: in-testsuite?
Attached file stacktrace.txt
Rank: 25
Priority: -- → P2
Component: Audio/Video → WebRTC: Audio/Video
Mass change P2->P3 to align with new Mozilla triage process.
Priority: P2 → P3
Version: unspecified → 56 Branch
Jan-Ivar, you probably have more knowledge about MediaManager&MediaDevices, would you see a link between the assertion in MediaManager and a change in MediaCache? (Or know someone who would know?) Thank you.
Flags: needinfo?(jib)
Hrm, not as sure as I thought I was. I'm getting different results now vs. what I was getting earlier. Turns out it runs a lot more reliably when opened from disk vs. running it from Bugzilla. INFO: Last good revision: e3bceb6eb287275e123cb92c487696c6c7325096 INFO: First bad revision: 1fb2d6e0aa2d82c2db246ecd75f7225fecc449ed INFO: Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=e3bceb6eb287275e123cb92c487696c6c7325096&tochange=1fb2d6e0aa2d82c2db246ecd75f7225fecc449ed --> Bug 1320994 I was able to let the testcase run on rev e3bceb6eb287275e123cb92c487696c6c7325096 for a few minutes without crashing (when affected builds would typically crash within 10-15sec otherwise). And that culprit definitely looks a lot more plausible. Sorry for the confusion before. On a side note, this testcase is pure spawn of Satan evil.
Blocks: 1320994
No longer blocks: 1379091
Version: 56 Branch → 55 Branch
Thanks Ryan, this is definitely bug 1320994. Looking at the code, OnNavigation() removes all the window's source listeners, while enumerateDevicesImpl when finished will remove one particular source listener. It's when the latter fails (because the former has already happened) that we fail the assert. Basically, when we navigate while enumerateDevices() is mid-flight. I think the proper thing to do would be to have OnNavigation() *not* clean up inactive source listeners, and after it has happened it should prevent promoting those inactive ones to active. jib, thoughts? Perhaps we can do something more radical, like cancel all pending enumerateDevices?
Assignee: nobody → jib
Flags: needinfo?(jib)

This issue is still being hit by fuzzers.

A Pernosco session can be found here: https://pernos.co/debug/TTZ9JloPY4lcxZg0kJes9g/index.html

Hopefully this will help get the issue resolved.

I think we know what's going on here, we just need to get around to fixing it.

I'll steal this, hoping to find more time than jib has over the last 2 years (-:

Assignee: jib → apehrson

The pernosco recording confirms comment 7.

Status: NEW → ASSIGNED

I think the simplest solution here is to mimic what other users of EnumerateDevicesImpl (i.e., GetUserMedia) do and abort the promise with AbortError, should the window have gone away already. We already do this for enumerateDevices if we're in shutdown.

Tyson, do you have a newer testcase that works on Nightly, that I could land as a crashtest?

The attachment here does a POST to mozilla.org which the test suite dislikes.

Flags: needinfo?(twsmith)
Attached file testcase.html (obsolete) —

I removed the calls to open() and send() and the test case works locally.

Attachment #8905305 - Attachment is obsolete: true
Flags: needinfo?(twsmith)

That looks like the wrong testcase.

Flags: needinfo?(twsmith)

Simply removing the open() and send() calls didn't trigger this for me. I tested loading it from an http server, file://, and as a crashtest. On the other hand, the original testcase doesn't trigger the bug either, when I load it manually. Am I missing some prefs?

I'll upload the fix for now, and get back to the testcase should we find one that works.

Attached file testcase.html

Oops you are right. Sorry about that.

Here try this, it uses localhost so when accessed via a local webserver it should trigger the assertion.

Attachment #9099612 - Attachment is obsolete: true
Flags: needinfo?(twsmith)

I am not able to reproduce with the testcase. I'll note that timing here relies on the set of cameras the host machine has available. Even if this would reproduce on try, that would be one brittle crashtest. I think we'll have to land without one.

Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/9b14e7bdee7a Handle cleaned up windows in async enumerateDevices response. r=jib
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Regressions: 1589686
Regressions: 1589854
See Also: → 1590092

The failing assertion was https://hg.mozilla.org/mozilla-central/annotate/3ecda4678c49/dom/media/MediaManager.cpp#l2778 (based on the stacktrace and revision).

Summary: Assertion failure: rv, at /home/worker/workspace/build/src/dom/media/MediaManager.cpp:2716 → Assertion failure: rv, at /home/worker/workspace/build/src/dom/media/MediaManager.cpp:2778
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: