emersion / xdg-desktop-portal-wlr

xdg-desktop-portal backend for wlroots
MIT License
580 stars 54 forks source link

Regression #205 ? - (ungoogled-)chromium sigsegv on screenshare #217

Closed muchgitsuchwow closed 1 year ago

muchgitsuchwow commented 2 years ago

Hey guys,

I'm on arch and starting with 0.6.0 chromium segfaults for me when sharing the screen. Downgrade to 0.5.0 fixes the issue. I found #205 showing the same symptoms as I have here.

First of all I wanted to state that. Second of all I'd like to ask:

What I can tell:

I run chromium "chrooted" with bwrap to use it for (anonymous) zoom only.

Just at the moment I have no possibility to upgrade and produce a crash (I need screen share today), but I'd upgrade and produce data if you can tell me what data you need.

Thanks!

lucas-dclrcq commented 2 years ago

I have exactly the same error, rolling back to 0.5.0 fixes the issue.

Detegr commented 2 years ago

Same issue with stock Google Chrome. Relevant output running with xdg-desktop-portal-wlr -l DEBUG:

2022/06/14 13:55:25 [DEBUG] - dbus: start: found matching session /org/freedesktop/portal/desktop/session/
1_36/webrtc_session185363372
2022/06/14 13:55:25 [INFO] - wlroots: num_modififiers 5
2022/06/14 13:55:25 [INFO] - pipewire: stream state changed to "connecting"
2022/06/14 13:55:25 [INFO] - pipewire: node id is -1
2022/06/14 13:55:25 [INFO] - pipewire: stream state changed to "paused"
2022/06/14 13:55:25 [INFO] - pipewire: node id is 73
2022/06/14 13:55:25 [DEBUG] - dbus: start: returning node 73
2022/06/14 13:55:25 [INFO] - wlroots: num_modififiers 5
2022/06/14 13:55:25 [DEBUG] - pipewire: Format negotiated:
2022/06/14 13:55:25 [DEBUG] - pipewire: buffer_type: 1 (8)
2022/06/14 13:55:25 [DEBUG] - pipewire: format: 8
2022/06/14 13:55:25 [DEBUG] - pipewire: modifier: 72057594037927940
2022/06/14 13:55:25 [DEBUG] - pipewire: size: (1920, 1080)
2022/06/14 13:55:25 [DEBUG] - pipewire: max_framerate: (143 / 1)
2022/06/14 13:55:25 [DEBUG] - pipewire: add buffer event handle
2022/06/14 13:55:25 [DEBUG] - pipewire: add buffer event handle
2022/06/14 13:55:25 [INFO] - pipewire: stream state changed to "streaming"
2022/06/14 13:55:25 [INFO] - pipewire: node id is 73
2022/06/14 13:55:25 [WARN] - pipewire: out of buffers
2022/06/14 13:55:25 [WARN] - wlroots: no current buffer
2022/06/14 13:55:25 [WARN] - pipewire: out of buffers
2022/06/14 13:55:25 [WARN] - wlroots: no current buffer
2022/06/14 13:55:25 [WARN] - pipewire: out of buffers
2022/06/14 13:55:25 [WARN] - wlroots: no current buffer
2022/06/14 13:55:25 [WARN] - pipewire: out of buffers
2022/06/14 13:55:25 [WARN] - wlroots: no current buffer
... repeats until Chrome crashes
2022/06/14 13:55:26 [WARN] - wlroots: no current buffer
2022/06/14 13:55:26 [WARN] - pipewire: out of buffers
2022/06/14 13:55:26 [WARN] - wlroots: no current buffer
2022/06/14 13:55:26 [WARN] - pipewire: out of buffers
2022/06/14 13:55:26 [WARN] - wlroots: no current buffer
2022/06/14 13:55:26 [INFO] - pipewire: stream state changed to "paused"
2022/06/14 13:55:26 [INFO] - pipewire: node id is 73
2022/06/14 13:55:26 [WARN] - pipewire: no buffer to queue
2022/06/14 13:55:26 [WARN] - pipewire: out of buffers
2022/06/14 13:55:26 [WARN] - wlroots: no current buffer
2022/06/14 13:55:26 [INFO] - dbus: session closed
2022/06/14 13:55:26 [DEBUG] - dbus: destroying session 0x564010f03af0
2022/06/14 13:55:26 [DEBUG] - xdpw: screencast instance 0x564010f2de50 now has 0 references
2022/06/14 13:55:26 [DEBUG] - xdpw: destroying cast instance
2022/06/14 13:55:26 [DEBUG] - pipewire: destroying stream
2022/06/14 13:55:26 [DEBUG] - pipewire: remove buffer event handle
2022/06/14 13:55:26 [DEBUG] - pipewire: remove buffer event handle
2022/06/14 13:55:26 [INFO] - pipewire: stream state changed to "unconnected"
2022/06/14 13:55:26 [INFO] - pipewire: node id is -1

Checking pipewire logs, there is a line:

invalid memory type 8
columbarius commented 2 years ago

Please test if screencast works with OBS-Studio.

Please provide a TRACE log with additional PipeWire and Wayland debug info:

PIPEWIRE_DEBUG=5 WAYLAND_DEBUG=1 /usr/lib/xdg-desktop-portal-wlr -r -l TRACE
Detegr commented 2 years ago

OBS' Screen capture (Pipewire) seems to be working. xdg-desktop-portal-wlr logs from running OBS and Chrome

mvdan commented 2 years ago

Adding another +1 with Chromium 102.0.5005 - Firefox 101.0.1 still works fine.

@columbarius here's the log you asked for. I stopped portal-wlr, started it with your command, waited a few seconds, opened chromium, navigated to meet.google.com to start an instant meeting, and tried to screenshare - which crashed the browser. Then I waited a few seconds and stopped portal-wlr with ^C. log.txt

columbarius commented 2 years ago

Thanks for the logs. They look pretty normal. Seems like chromium has problems with the negotiation process.

I helped creating a patch for kwin, so xdpw is not the only portal offering explicit modifiers and this can be found in testing.

@grulja Could you please test https://invent.kde.org/plasma/kwin/-/merge_requests/2507

grulja commented 2 years ago

I think this is still same problem as reported here https://github.com/emersion/xdg-desktop-portal-wlr/issues/205. I can reproduce it with Chrome 102, but cannot with my local build. The fix for https://github.com/emersion/xdg-desktop-portal-wlr/issues/205 should be in Chrome 103.

columbarius commented 2 years ago

@grulja thanks. sry for this. I assumed chromium was already released with the fix (probably I remembered testing the fix).

columbarius commented 2 years ago

Let's keep this pinned:

Solution: pin chromium to an older release, or use firefox until chromium 103 is released.

muchgitsuchwow commented 2 years ago

ungoogled-chromium 103 became available in Archlinux AUR today and I just wanted to confirm that screen share with 0.6.0 and chromium 103 does not result in a segmentation fault anymore.

migonos0 commented 2 years ago

ungoogled-chromium 103 became available in Archlinux AUR today and I just wanted to confirm that screen share with 0.6.0 and chromium 103 does not result in a segmentation fault anymore.

the problem just got worse for me.

I can provide all the information needed, for now I'm holding to ungoogled-chomium 102 and xdg-desktop-portal-wlr 0.5.

PD: Same behavior with std chromium distribution, applications such as jitsi meet are also affected since they ship their own chromium engine (I guess).

muchgitsuchwow commented 2 years ago

the problem just got worse for me.

This is not related to this issue. --app enables keyboard.lock() API (see https://chromestatus.com/feature/5642959835889664 and https://web.dev/keyboard-lock/) I disabled this in about:flags to no avail. Only solution for me was to not use --app anymore.

grulja commented 2 years ago

ungoogled-chromium 103 became available in Archlinux AUR today and I just wanted to confirm that screen share with 0.6.0 and chromium 103 does not result in a segmentation fault anymore.

the problem just got worse for me.

  • Screen sharing now works but not properly, it appears shattered.

Sounds like a stride issue. There was one already fixed with Chromium 105, you can test with latest binaries from here https://download-chromium.appspot.com/. There appears to be one more issue, but only in GNOME and I'm just waiting for confirmation that my patch fixes the issue.

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1333304

migonos0 commented 2 years ago

ungoogled-chromium 103 became available in Archlinux AUR today and I just wanted to confirm that screen share with 0.6.0 and chromium 103 does not result in a segmentation fault anymore.

the problem just got worse for me.

  • Screen sharing now works but not properly, it appears shattered.

Sounds like a stride issue. There was one already fixed with Chromium 105, you can test with latest binaries from here https://download-chromium.appspot.com/. There appears to be one more issue, but only in GNOME and I'm just waiting for confirmation that my patch fixes the issue.

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1333304

I can confirm, there is this pkgbuild and using that version the screen presents itself correctly.

fbievan commented 2 years ago

This seems to also effect electron in similar way. Same "Shattering".

columbarius commented 1 year ago

Chromium 105 was released and it works for me. @grulja Thanks a lot!

columbarius commented 1 year ago

If you have still this issue please check if you have version 105 or later installed and then reopen this please.

gierdo commented 1 year ago

There appears to be a regression:

[5188:5721:0417/211439.464897:ERROR:egl_dmabuf.cc(569)] Failed to record frame: Error creating EGLImage - EGL_BAD_ALLOC
[5188:5721:0417/211439.464971:ERROR:shared_screencast_stream.cc(791)] Dropping DMA-BUF modifier: 144115206334822913 and trying to renegotiate stream parameters

Environment:

xdg-desktop-portal 1.16.0
xdg-desktop-portal-wlr 0.6.0

Or am I alone with this?

grulja commented 1 year ago

See https://bugs.chromium.org/p/chromium/issues/detail?id=1433463. Can you try xdg-desktop-portal-wlr 0.7.0? Can you also try Chrome Beta/Dev? There was a change that might make it work.

gierdo commented 1 year ago

Thank you, confirmed fixed with xdg-desktop-portal-wlr 0.7.0.