Crash in [@ webrtc::SharedScreenCastStreamPrivate::OnStreamProcess]
Categories
(Core :: WebRTC, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr153 | --- | unaffected |
| firefox158 | --- | wontfix |
| firefox159 | --- | wontfix |
| firefox160 | --- | wontfix |
| firefox161 | --- | fix-optional |
| firefox162 | --- | fixed |
| firefox163 | --- | fixed |
People
(Reporter: clouseau-bot, Assigned: jgrulich)
References
(Blocks 1 open bug, Regression, )
Details
(Keywords: crash, regression)
Crash Data
Attachments
(2 external files)
Crash report: https://crash-stats.mozilla.org/report/index/7940b50f-b518-46f8-ad0b-1ce7e0261021
Crash Reason:
SIGSEGV / SEGV_MAPERR at 0x0000000000000000
Top 10 frames:
0 libxul.so webrtc::SharedScreenCastStreamPrivate::OnStreamProcess(void*) third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
1 libpipewire-0.3.so.0
2 libpipewire-0.3.so.0
3 libpipewire-0.3.so.0
4 libpipewire-0.3.so.0
5 libspa-support.so
6 libpipewire-0.3.so.0
7 firefox-bin set_alt_signal_stack_and_start(PthreadCreateParams*) mozglue/interposers/pthread_create_interposer.cpp:81
8 libc.so.6
9 libc.so.6
There is 1 crash in nightly 160 with buildid 20261019073400.
In the last 30 days, Firefox has 52 crashes (from 15 installations) on release, 5 crashes (from 3 installations) on beta/DevEdition and 2 crashes (from 2 installations) on nightly with this signature.
This signature has been reported since build 20260921231603 (2026-09-21), 27 days before the build above.
This bug looks actionable because:
-
SharedScreenCastStreamPrivate::OnStreamProcessdereferences a nullpw_on thepw-data-loopthread while theDesktopCapturethread is destroying the PipeWire stream viapw_.reset()inStopAndCleanupStream.DesktopCaptureImpl::ShutdownOnThreaddestroys the capturer, and~BaseCapturerPipeWirecallsStopScreenCastStream->StopAndCleanupStream.StopAndCleanupStreamstops onlypw_->main_loopwithpw_thread_loop_stop, then callspw_.reset()(line 773).std::unique_ptr::reset()stores null intopw_first, then runs~PipeWireThreadLoop, which is still insidepw_stream_disconnect(stream)(line 218) when the crash happens.- The PipeWire data loop is still running and delivers the stream's
processevent, callingOnStreamProcessonpw-data-loop. OnStreamProcessevaluatespw_stream_dequeue_buffer(that->pw_->stream)(line 493) withpw_ == nullptrand loads from address 0x18, the offset ofPipeWireThreadLoop::stream.
The report shows both halves at once: thread 138 faults with
mov rbx, [rax+0x18]at address 0x18, and thread 135 is in~PipeWireThreadLoopat line 218 underStopAndCleanupStreamline 773. All 59 reports of this signature fault at the same address. Theunique_ptr<PipeWireThreadLoop>design that opens this window came in with the libwebrtc vendor d2e600f2f07c. The old code read a rawpw_stream_that stayed valid until afterpw_stream_disconnect. Look first at teardown order: disconnect the stream, or removespa_stream_listener_, whilepw_is still set and release it afterwards, or make the stream callbacks tolerate a nullpw_. -
The failing code comes from d2e600f2f07c (gh) (bug 2064200) by :mjf.
Code references:
- webrtc::SharedScreenCastStreamPrivate::OnStreamProcess
- webrtc::SharedScreenCastStreamPrivate::StopAndCleanupStream
- third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc:760
- third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc:495
:mjf, can you have a look please?
Filed automatically by Clouseau, which analyses nightly crashes with an LLM. Nothing above was written or checked by a human. Please close it as INVALID if it is wrong — that is useful feedback, not a nuisance.
This is not an independent Mozilla discovery: the crash is known here only because somebody submitted the crash report linked at the top. If this duplicates an existing report, please resolve THIS bug as the duplicate and leave the credit with the earlier reporter.
Updated•1 month ago
|
Comment 1•1 month ago
|
||
Jan, is this something you'd be interested in looking at?
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
Updated•1 month ago
|
Comment 2•1 month ago
|
||
The severity field is not set for this bug.
:mjf, could you have a look please?
For more information, please visit BugBot documentation.
Updated•1 month ago
|
Comment 3•22 days ago
|
||
Set release status flags based on info from the regressing bug 2064200
| Assignee | ||
Updated•15 days ago
|
Updated•12 days ago
|
| Assignee | ||
Comment 4•10 days ago
|
||
OnStreamProcess() runs on PipeWire's data loop thread, not on
main_loop, so stopping main_loop does not stop it. Since 46ce2a180c,
StopAndCleanupStream() calls pw_.reset(), which nulls pw_ before
~PipeWireThreadLoop() disconnects the stream. An in-flight
OnStreamProcess() then dereferences a null pw_ and crashes. It also
clears queue_ and latest_available_frame_ while ProcessBuffer() can
still repopulate them, which can leave latest_available_frame_
dangling.
Add PipeWireThreadLoop::DestroyStream(), which disconnects and
destroys the stream; pw_stream_disconnect() waits for the data loop
to finish. Call it from StopAndCleanupStream() before resetting the
frame state, and from ~PipeWireThreadLoop() before destroying the
renegotiate event.
Add a regression test that stops the stream while a buffer is being
processed.
This is a simple backport of an WebRTC upstream change.
Upstream commit: 1d3a072191f6c26c5c4f3a59187c0065d7855d06
Comment 6•8 days ago
|
||
| bugherder | ||
Comment 7•8 days ago
|
||
The patch landed in nightly and beta is affected.
:jgrulich, please make an uplift decision for beta:
- For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set
status-firefox162towontfixif the fix can wait for the next release.
Uplift requests can be submitted from Lando: D343929.
See Requesting an Uplift for documentation on how to request an uplift.
For more information, please visit BugBot documentation.
Comment 8•4 days ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Any Linux user on Wayland who tears down a WebRTC screen share (getDisplayMedia: "Stop sharing", call hang-up, tab close, or navigating away) can hit this null-deref. It is a hard SIGSEGV in the content process, not a catchable error. The tab/page dies immediately (crash report + lost page), which for the common case means dropping out of a live video call mid-meeting.
- Code covered by automated testing?: no
- Fix verified in Nightly?: no
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: This is confirmed to fix the issue in WebRTC upstream and the patch is simple WebRTC backport.
- String changes made/needed?: None
- Is Android affected?: no
| Assignee | ||
Comment 9•4 days ago
|
||
OnStreamProcess() runs on PipeWire's data loop thread, not on
main_loop, so stopping main_loop does not stop it. Since 46ce2a180c,
StopAndCleanupStream() calls pw_.reset(), which nulls pw_ before
~PipeWireThreadLoop() disconnects the stream. An in-flight
OnStreamProcess() then dereferences a null pw_ and crashes. It also
clears queue_ and latest_available_frame_ while ProcessBuffer() can
still repopulate them, which can leave latest_available_frame_
dangling.
Add PipeWireThreadLoop::DestroyStream(), which disconnects and
destroys the stream; pw_stream_disconnect() waits for the data loop
to finish. Call it from StopAndCleanupStream() before resetting the
frame state, and from ~PipeWireThreadLoop() before destroying the
renegotiate event.
Add a regression test that stops the stream while a buffer is being
processed.
This is a simple backport of an WebRTC upstream change.
Upstream commit: 1d3a072191f6c26c5c4f3a59187c0065d7855d06
Original Revision: https://phabricator.services.mozilla.com/D343929
| Assignee | ||
Updated•4 days ago
|
Updated•4 days ago
|
Updated•4 days ago
|
Comment 10•4 days ago
|
||
| uplift | ||
Description
•