Closed
Bug 1062293
Opened 11 years ago
Closed 11 years ago
Fix MediaStreamGraph shutdown sequence
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
mozilla35
| Tracking | Status | |
|---|---|---|
| firefox32 | --- | unaffected |
| firefox33 | --- | unaffected |
| firefox34 | + | fixed |
| firefox35 | --- | fixed |
People
(Reporter: padenot, Assigned: padenot)
References
Details
Attachments
(3 files)
|
13.51 KB,
patch
|
jesup
:
review+
lmandel
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
|
10.91 KB,
patch
|
jesup
:
review+
lmandel
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
|
1.09 KB,
patch
|
kinetik
:
review+
lmandel
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•11 years ago
|
||
As noted in the comment, it is very useful to have this interleaved with the ADB
logcat on Android/b2g, because this way we can correlate gecko state with the
state of the Android HAL.
Attachment #8483484 -
Flags: review?(rjesup)
| Assignee | ||
Comment 2•11 years ago
|
||
This basically gets a grip on the graph while doing driver switches operations
on another thread (system thread or audio thread), because those can take time.
Because the graph is refcounted, it'll be freed when the last operation
finishes, which is what we want.
This patch also only allows driver switching when the graph is in state
LIFECYCLE_RUNNING, which is what we want anyway.
Attachment #8483487 -
Flags: review?(rjesup)
| Assignee | ||
Comment 3•11 years ago
|
||
This ensures the callback won't be called when draining is done.
I've seen a bunch of cases on slow, mono-core machines where we call the
playhead state handler for the drain right before the next callback after having
set `stm->draining = 1`, so we actually stop draining by resetting
`stm->draining` to 0 and keep calling the user-provided callback.
This caused a bunch of UAF / deadlocks on Android and B2G.
Attachment #8483490 -
Flags: review?(kinetik)
Comment 4•11 years ago
|
||
Comment on attachment 8483484 [details] [diff] [review]
Add specialized logging to track the lifetime state change of MediaStreamGraphs r=
Review of attachment 8483484 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/media/GraphDriver.cpp
@@ +18,5 @@
> #endif
>
> +// We don't use NSPR log here because we want this interleaved with adb logcat
> +// on Android/B2G
> +#define ENABLE_LIFECYCLE_LOG
are we ever going to disable this?
::: content/media/MediaStreamGraph.cpp
@@ +44,5 @@
> #else
> #define STREAM_LOG(type, msg)
> #endif
>
> +#define ENABLE_LIFECYCLE_LOG
Are we ever going to disable this? If so, file a bug. If we don't want it in release builds, maybe something like
#if defined(DEBUG) || !defined(SOME_RELEASE_BUILD_DEFINE)
@@ +1576,5 @@
> + "LIFECYCLE_THREAD_NOT_STARTED",
> + "LIFECYCLE_RUNNING",
> + "LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP",
> + "LIFECYCLE_WAITING_FOR_THREAD_SHUTDOWN",
> + "LIFECYCLE_WAITING_FOR_STREAM_DESTRUCTION"
Add a note where the states are defined saying if you change it to update this.
Attachment #8483484 -
Flags: review?(rjesup) → review+
Updated•11 years ago
|
Attachment #8483487 -
Flags: review?(rjesup) → review+
Updated•11 years ago
|
Attachment #8483490 -
Flags: review?(kinetik) → review+
| Assignee | ||
Comment 5•11 years ago
|
||
Comment 6•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/030dfb5fa2af
https://hg.mozilla.org/mozilla-central/rev/dcd375e2750d
https://hg.mozilla.org/mozilla-central/rev/c5249f8eec65
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
| Assignee | ||
Comment 7•11 years ago
|
||
We need this on Aurora, as it fixes a bunch of intermittents
| Assignee | ||
Comment 8•11 years ago
|
||
Comment on attachment 8483484 [details] [diff] [review]
Add specialized logging to track the lifetime state change of MediaStreamGraphs r=
Approval Request Comment
[Feature/regressing bug #]: MSG refactoring (bug 848954)
[User impact if declined]: crashes
[Describe test coverage new/current, TBPL]: this fixes a lot of intermittents
[Risks and why]: it's been on inbound and central for some days
[String/UUID change made/needed]: none
Attachment #8483484 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Comment 9•11 years ago
|
||
Comment on attachment 8483487 [details] [diff] [review]
Ensure the graph stays alive when doing driver switches and audio stream shutdown operations. r=
Approval Request Comment
[Feature/regressing bug #]: MSG refactoring (bug 848954)
[User impact if declined]: crashes
[Describe test coverage new/current, TBPL]: this fixes a lot of intermittents
[Risks and why]: it's been on inbound and central for some days
[String/UUID change made/needed]: none
| Assignee | ||
Comment 10•11 years ago
|
||
Comment on attachment 8483487 [details] [diff] [review]
Ensure the graph stays alive when doing driver switches and audio stream shutdown operations. r=
Approval Request Comment
[Feature/regressing bug #]: MSG refactoring (bug 848954)
[User impact if declined]: crashes
[Describe test coverage new/current, TBPL]: this fixes a lot of intermittents
[Risks and why]: it's been on inbound and central for some days
[String/UUID change made/needed]: none
| Assignee | ||
Comment 11•11 years ago
|
||
Comment on attachment 8483490 [details] [diff] [review]
Fix opensl's cubeb backend draining. r=
Approval Request Comment
[Feature/regressing bug #]: MSG refactoring (bug 848954)
[User impact if declined]: crashes
[Describe test coverage new/current, TBPL]: this fixes a lot of intermittents
[Risks and why]: it's been on inbound and central for some days
[String/UUID change made/needed]: none
Updated•11 years ago
|
Updated•11 years ago
|
Attachment #8483487 -
Flags: approval-mozilla-aurora?
Updated•11 years ago
|
Attachment #8483490 -
Flags: approval-mozilla-aurora?
Comment 12•11 years ago
|
||
padenot put approval requests for the other two patches in here, but didn't set the bits on the patches
Updated•11 years ago
|
Comment 13•11 years ago
|
||
Comment on attachment 8483484 [details] [diff] [review]
Add specialized logging to track the lifetime state change of MediaStreamGraphs r=
Aurora+
Attachment #8483484 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•11 years ago
|
Attachment #8483487 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•11 years ago
|
Attachment #8483490 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 14•11 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/731305558f1c
https://hg.mozilla.org/releases/mozilla-aurora/rev/94140d5b6008
https://hg.mozilla.org/releases/mozilla-aurora/rev/2a6352464e21
Whiteboard: [webrtc-uplift]
Depends on: 1066980
You need to log in
before you can comment on or make changes to this bug.
Description
•