Linux Wayland Screenshare Crash

60 views
Skip to first unread message

Jozsef Vass

unread,
May 27, 2025, 2:23:39 PM5/27/25
to discuss...@googlegroups.com
A quick question about desktop capture linux Wayland ScreenCastPortal regarding the session close signal handler. It is only unsubscribed in ScreenCastPortal::OnSessionClosedSignal() and not in ScreenCastPortal dtor or ScreenCastPortal::UnsubscribeSignalHandlers(). For success case (when the user selects a window and clicks share), I do not see ScreenCastPortal::OnSessionClosedSignal() called at all. When a user cancels the native screen selection dialog, it is called most of the time. In some cases, however, it is called when the user starts to share again - at this point, ScreenCastPortal object is long destructed and results in a crash.

When native screen selection is cancelled, BaseCapturerPipeWire::OnScreenCastSessionClosed() already has capturer_failed_ set to 2, so the function is a no-op.

It is totally possible that we use the desktop capture API wrong and that is the reason that we experience a crash. However, it would be good code hygiene to unsubscribe listener when the object is destructed.

Jozsef

Jan Grulich

unread,
May 28, 2025, 4:52:10 PM5/28/25
to discuss-webrtc
Hi,

I think you are correct with your observations. I have opened a change which I believe should fix this: https://webrtc-review.googlesource.com/c/src/+/393900.

Would you be able to give it a try and also possibly open a bug for your issue?

Thank you.

Regards,
Jan Grulich

Dne úterý 27. května 2025 v 20:23:39 UTC+2 uživatel Jozsef Vass napsal:

Jozsef Vass

unread,
May 29, 2025, 3:38:52 PM5/29/25
to discuss...@googlegroups.com
Both are done, I updated https://issues.webrtc.org/issues/420959042.

Jozsef

--
This list falls under the WebRTC Code of Conduct - https://webrtc.org/support/code-of-conduct.
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/discuss-webrtc/d247b075-d25c-439b-a88c-427642205b2en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages