Closed Bug 1443212 Opened 5 years ago Closed 2 years ago

Assertion failure: !mConsumers.Contains(aConsumer), at /builds/worker/workspace/build/src/dom/media/MediaStreamTrack.cpp:436

Categories

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

59 Branch
defect

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox83 --- wontfix
firefox84 --- wontfix
firefox85 --- fixed

People

(Reporter: jkratzer, Assigned: pehrsons)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, testcase)

Attachments

(3 files, 1 obsolete file)

Attached file trigger.html (obsolete) —
Testcase found while fuzzing mozilla-central rev 51200c0fdadd.  Testcase must be served via a local webserver.
```
rax = 0x0000000000000000   rdx = 0x0000000000000000
rcx = 0x00007f87525772dd   rbx = 0x00007f87296ecc00
rsi = 0x00007f8752846770   rdi = 0x00007f8752845540
rbp = 0x00007ffe3da5f630   rsp = 0x00007ffe3da5f610
r8 = 0x00007f8752846770    r9 = 0x00007f8753911740
r10 = 0x0000000000000039   r11 = 0x0000000000000000
r12 = 0x00007f87296ecc80   r13 = 0x00007f8727cec1c0
r14 = 0x00007f8727c504c0   r15 = 0x00007f8729683cf0
rip = 0x00007f8742aa3589
OS|Linux|0.0.0 Linux 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64
CPU|amd64|family 6 model 78 stepping 3|1
GPU|||
Crash|SIGSEGV|0x0|0
0|0|libxul.so|mozilla::dom::MediaStreamTrack::AddConsumer|hg:hg.mozilla.org/mozilla-central:dom/media/MediaStreamTrack.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|441|0x18
0|1|libxul.so|mozilla::DOMMediaStream::NotifyTrackAdded|hg:hg.mozilla.org/mozilla-central:dom/media/DOMMediaStream.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|1412|0x13
0|2|libxul.so|mozilla::DOMMediaStream::AddTrack|hg:hg.mozilla.org/mozilla-central:dom/media/DOMMediaStream.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|722|0x16
0|3|libxul.so|mozilla::dom::MediaStreamBinding::addTrack|s3:gecko-generated-sources:147497fb1b3e5d6d959b3288bc4e2a6e2a667e52b65568a1f8164ea334a6204a77f34ff4e45589244c58abc13e2ab61f9defb6348b727b76af7fc7fdd91de0b1/dom/bindings/MediaStreamBinding.cpp:|805|0xc
0|4|libxul.so|mozilla::dom::GenericBindingMethod|hg:hg.mozilla.org/mozilla-central:dom/bindings/BindingUtils.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|3031|0x9
0|5|libxul.so|js::CallJSNative|hg:hg.mozilla.org/mozilla-central:js/src/vm/JSContext-inl.h:51200c0fdaddb2749549a82596da5323a4cbd499|290|0x6
0|6|libxul.so|js::InternalCallOrConstruct|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|467|0xf
0|7|libxul.so|InternalCall|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|516|0xd
0|8|libxul.so|Interpret|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|522|0xf
0|9|libxul.so|js::RunScript|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|417|0xb
0|10|libxul.so|js::InternalCallOrConstruct|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|489|0xf
0|11|libxul.so|InternalCall|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|516|0xd
0|12|libxul.so|js::Call|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|535|0x5
0|13|libxul.so|PromiseReactionJob|hg:hg.mozilla.org/mozilla-central:js/src/builtin/Promise.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|1237|0x5
0|14|libxul.so|js::CallJSNative|hg:hg.mozilla.org/mozilla-central:js/src/vm/JSContext-inl.h:51200c0fdaddb2749549a82596da5323a4cbd499|290|0x6
0|15|libxul.so|js::InternalCallOrConstruct|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|467|0xf
0|16|libxul.so|InternalCall|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|516|0xd
0|17|libxul.so|js::Call|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|535|0x5
0|18|libxul.so|JS::Call|hg:hg.mozilla.org/mozilla-central:js/src/jsapi.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|3028|0x20
0|19|libxul.so|mozilla::dom::PromiseJobCallback::Call|s3:gecko-generated-sources:79f115144bcf0c378a015975f9d6ac68159f52714a788d85a71ea7276ee3be31659d846c997914a24ee4364eddc910d1e28a2422e4e5cad3fe09187ffb5e6f88/dom/bindings/PromiseBinding.cpp:|21|0x5
0|20|libxul.so|mozilla::dom::PromiseJobCallback::Call|s3:gecko-generated-sources:b8f73248cf3155eb71bd1f90828c27ac4f6e93ea43a1a3cc1934a28e2b8e1d6736f91e7a6ded0ec41108322a5c95e99737d3e1b821e8f58ffe7e5d6162cf933a/dist/include/mozilla/dom/PromiseBinding.h:|90|0x12
0|21|libxul.so|mozilla::dom::PromiseJobCallback::Call|s3:gecko-generated-sources:b8f73248cf3155eb71bd1f90828c27ac4f6e93ea43a1a3cc1934a28e2b8e1d6736f91e7a6ded0ec41108322a5c95e99737d3e1b821e8f58ffe7e5d6162cf933a/dist/include/mozilla/dom/PromiseBinding.h:|103|0x13
0|22|libxul.so|mozilla::PromiseJobRunnable::Run|hg:hg.mozilla.org/mozilla-central:xpcom/base/CycleCollectedJSContext.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|205|0x17
0|23|libxul.so|mozilla::CycleCollectedJSContext::PerformMicroTaskCheckPoint|hg:hg.mozilla.org/mozilla-central:xpcom/base/CycleCollectedJSContext.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|543|0x10
0|24|libxul.so|mozilla::dom::ScriptLoader::EvaluateScript|hg:hg.mozilla.org/mozilla-central:dom/script/ScriptLoader.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|2210|0xc
0|25|libxul.so|mozilla::dom::ScriptLoader::ProcessRequest|hg:hg.mozilla.org/mozilla-central:dom/script/ScriptLoader.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|1950|0xb
0|26|libxul.so|mozilla::dom::ScriptLoader::ProcessInlineScript|hg:hg.mozilla.org/mozilla-central:dom/script/ScriptLoader.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|1591|0xf
0|27|libxul.so|mozilla::dom::ScriptLoader::ProcessScriptElement|hg:hg.mozilla.org/mozilla-central:dom/script/ScriptLoader.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|1310|0xb
0|28|libxul.so|mozilla::dom::ScriptElement::MaybeProcessScript|hg:hg.mozilla.org/mozilla-central:dom/script/ScriptElement.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|141|0x13
0|29|libxul.so|nsIScriptElement::AttemptToExecute|hg:hg.mozilla.org/mozilla-central:dom/script/nsIScriptElement.h:51200c0fdaddb2749549a82596da5323a4cbd499|247|0x3
0|30|libxul.so|nsHtml5TreeOpExecutor::RunScript|hg:hg.mozilla.org/mozilla-central:parser/html/nsHtml5TreeOpExecutor.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|736|0x10
0|31|libxul.so|nsHtml5TreeOpExecutor::RunFlushLoop|hg:hg.mozilla.org/mozilla-central:parser/html/nsHtml5TreeOpExecutor.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|540|0x8
0|32|libxul.so|nsHtml5ExecutorFlusher::Run|hg:hg.mozilla.org/mozilla-central:parser/html/nsHtml5StreamParser.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|131|0x10
0|33|libxul.so|mozilla::SchedulerGroup::Runnable::Run|hg:hg.mozilla.org/mozilla-central:xpcom/threads/SchedulerGroup.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|413|0x1c
0|34|libxul.so|nsThread::ProcessNextEvent|hg:hg.mozilla.org/mozilla-central:xpcom/threads/nsThread.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|1040|0x15
0|35|libxul.so|NS_ProcessNextEvent|hg:hg.mozilla.org/mozilla-central:xpcom/threads/nsThreadUtils.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|517|0x11
0|36|libxul.so|mozilla::ipc::MessagePump::Run|hg:hg.mozilla.org/mozilla-central:ipc/glue/MessagePump.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|125|0xd
0|37|libxul.so|MessageLoop::RunInternal|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:51200c0fdaddb2749549a82596da5323a4cbd499|326|0x17
0|38|libxul.so|MessageLoop::Run|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:51200c0fdaddb2749549a82596da5323a4cbd499|319|0x8
0|39|libxul.so|nsBaseAppShell::Run|hg:hg.mozilla.org/mozilla-central:widget/nsBaseAppShell.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|157|0xd
0|40|libxul.so|XRE_RunAppShell|hg:hg.mozilla.org/mozilla-central:toolkit/xre/nsEmbedFunctions.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|892|0x11
0|41|libxul.so|mozilla::ipc::MessagePumpForChildProcess::Run|hg:hg.mozilla.org/mozilla-central:ipc/glue/MessagePump.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|269|0x5
0|42|libxul.so|MessageLoop::RunInternal|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:51200c0fdaddb2749549a82596da5323a4cbd499|326|0x17
0|43|libxul.so|MessageLoop::Run|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:51200c0fdaddb2749549a82596da5323a4cbd499|319|0x8
0|44|libxul.so|XRE_InitChildProcess|hg:hg.mozilla.org/mozilla-central:toolkit/xre/nsEmbedFunctions.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|718|0x8
0|45|firefox|content_process_main|hg:hg.mozilla.org/mozilla-central:ipc/contentproc/plugin-container.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|50|0x14
0|46|firefox|main|hg:hg.mozilla.org/mozilla-central:browser/app/nsBrowserApp.cpp:51200c0fdaddb2749549a82596da5323a4cbd499|280|0x11
0|47|libc-2.23.so||||0x20830
0|48|firefox|MOZ_ReportAssertionFailure|hg:hg.mozilla.org/mozilla-central:mfbt/Assertions.h:51200c0fdaddb2749549a82596da5323a4cbd499|164|0x5
```
Flags: in-testsuite?
Rank: 19
Priority: -- → P2
Attached file trigger.html

Updated test case.

Attachment #8956138 - Attachment is obsolete: true

Thanks for the recording. This is now trivial :-)

Assignee: nobody → apehrson
Severity: normal → S4
Status: NEW → ASSIGNED
Rank: 19
Component: WebRTC → WebRTC: Audio/Video

FWIW the reason behind this is that MediaStream.RemoveTrack() has a guard so we don't notify of ended tracks being removed. AddTrack() OTOH does not have the same guard.

So with an ended track t:

stream.addTrack(t);
stream.removeTrack(t);
stream.addTrack(t);

will fail this assert.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.