Closed Bug 1742804 Opened 3 years ago Closed 3 years ago

Crash in [@ nsThread::Shutdown] for "MediaTrackGrph" thread

Categories

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

x86
Windows 10
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jstutte, Unassigned)

References

Details

(Keywords: crash)

Crash Data

Attachments

(2 files)

Crash report: https://crash-stats.mozilla.org/report/index/2ed3cff3-16aa-43a2-a59f-c65160211123

Reason: EXCEPTION_STACK_OVERFLOW

Top 1 frames of crashing thread:

0 xul.dll nsThread::Shutdown xpcom/threads/nsThread.cpp:860

This seems to be caused by repeated shutdown requests that cause a deep stack of SpinEventLoopUntil, as visible from the XPCOMSpinEventLoopStack annotation on the report.

We might want to check where we dispatch MediaTrackGraphShutdownThreadRunnables ?

I see crashes like this only since a few days.

Reports seem to have started on Nov 17. The only change I see in dom/media that could be related is bug 1740827. We have had similar cases of this in the past where silence gaps in an audio stream led to flip-flopping between channel counts which led to a new audio driver for each flip and each flop. And a new audio driver leads to a new fallback system driver, which creates a MediaTrackGrph thread.

I am contemplating backing that out just to see if it has an effect on these reports, and re-land if it doesn't.

See Also: → 1740827
Assignee: nobody → apehrson
Status: NEW → ASSIGNED
Keywords: leave-open
Priority: -- → P1

Audio drivers created at a very high rate have been observed on Nightly and
correlate time-wise to this commit (Bug 1740827) landing. We back it out
tentatively to see whether it has an effect on said reports.

Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/00121fcd57dd Backed out changeset fa867b130b44. r=padenot

Hmm, I do see a linux crash report with a 2021-11-14 build id. That suggests bug 1740827 is not the cause of this. I'll let some more time pass before drawing final conclusions.

It's also the only report on linux, so maybe something is latent and bug 1740827 triggered something to make it worse.

Judging on the extensions enabled that linux report is from a Mozilla dev in France... And with "fx-profiler-audio-cb".., Paul could this be you? :-D
If so, any clue what you did? Any particular HW that might be able to repro?

Flags: needinfo?(padenot)

There is no GraphRunner thread in that report, which seems weird. The windows reports I have sampled have that.

(In reply to Andreas Pehrson [:pehrsons] from comment #7)

There is no GraphRunner thread in that report, which seems weird. The windows reports I have sampled have that.

You might see a case of bug 1741131 or better bug 1742836.

(In reply to Jens Stutte [:jstutte] from comment #8)

(In reply to Andreas Pehrson [:pehrsons] from comment #7)

There is no GraphRunner thread in that report, which seems weird. The windows reports I have sampled have that.

You might see a case of bug 1741131 or better bug 1742836.

I'm not sure I understand them correctly, but if we're talking GraphRunner; that thread is just an indicator to whether the thing spawning all the MediaTrackGrph threads is alive.

Bug 1741131 discovered we may see in some cases an annotation from the parent process on the report of a child process. That could explain why you see no other signs of MediaTrackGrph in the stack traces of the threads. This would mean that the parent process was executing the SpinEventLoopUntil in question and while doing so the child process has been killed (for whatever reason and in whatever state it was).

(In reply to Andreas Pehrson [:pehrsons] from comment #6)

Judging on the extensions enabled that linux report is from a Mozilla dev in France... And with "fx-profiler-audio-cb".., Paul could this be you? :-D
If so, any clue what you did? Any particular HW that might be able to repro?

It's clearly my Mozilla workstation. I'm using a USB DAC and a C920 as the mic. Sometimes the USB DAC somehow disappears (might just be a short circuit in the cable or something). I wouldn't trust my own setup too much, I have way too much weirdness in my audio setup.

Flags: needinfo?(padenot)
Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/07b6db3cbfa9 Re-land changeset fa867b130b44. r=padenot

I won't have time to look into this anytime soon. And looking at the crash rate, impact seems generally low.

Assignee: apehrson → nobody
Severity: S2 → S4
Status: ASSIGNED → NEW
Priority: P1 → P3
See Also: → 1752305

Closing because no crashes reported for 12 weeks.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: