WebCord: Segfault on Screen Share

Aknowledgements

  • I have checked that there’s no other issue describing the same or similar problem that I currently have, regardless if it has been closed or open.

  • I can confirm that this is not an issue with the Discord website, but it is a problem specific to the WebCord itself.

  • / I have verified this issue is not a bug within Chromium engine by checking, if this bug can be reproduced in Discord web on Chromium/Chrome or any other Chromium-based browser that uses unpatched/upstream Chromium engine (i.e. browsers which treats fixing Chromium bugs out of their scope and doesn’t do anything about them, either to patch or mitigate them).

  • I have tried running the build from the master branch and it does not have any fixes implemented according to my issue.

  • My issue describes one of the unstable and/or not fully implemented features.

  • I have found a workaround to mitigate or temporarily fix this issue in affected releases (please write it in Additional context section below).

Operating System / Platform

🐧️ Linux

Operating system architecture

x64 (64-bit Intel/AMD)

Electron version

22.0.0

Application version

v3.10.1

Bug description

Pressing the “Screen share” button in webcord immediately segfaults. i have tried this both through Flatpak and the rpm file in the latest release.

/app/bin/run.sh: line 9:     3 Segmentation fault      (core dumped) env TMPDIR="$XDG_RUNTIME_DIR/app/${FLATPAK_ID:-io.github.spacingbat3.webcord}" zypak-wrapper /app/bin/webcord/usr/bin/webcord $FLAGS "$@"

This works in Chromium just fine

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 9
  • Comments: 39 (14 by maintainers)

Most upvoted comments

Meanwhile on flatpak you can revert to latest working version and disable auto updating:

flatpak update --commit=ba230142b6d753191eec7416a36b7df6541b9da152c934b18dac3046491b0237 io.github.spacingbat3.webcord
flatpak mask io.github.spacingbat3.webcord

I can confirm downgrading to 3.10.0 no longer segfaults on screen share.

Also @ZirixCZ @m-wynn please avoid reporting / confirming if the issue affects Flatpaks. While @m-wynn did confirm this issue affects RPMs , I just mention you all to avoid reporting the issue I won’t fix as I’m not a maintainer of Flatpak builds.

I took a look on it on my own, finally I can confirm it occurs and that desktopCapturer does indeed crash on Wayland with Electron 22, but works fine at least since Electron 19 (unlike to reported Electron issue). I also wonder if we could bypass desktopCapturer.getSources and use a hard-coded string like screen:1:0 on Electron 22 as a workaround

Looks like hardcoding it or calculating on my own is viable workaround for the recent segfault. However, I’m unsure if for everyone it returns something like screen:1:0 or it is actually screeen:X:0 and I have to calculate X for each user based on env vars like $WAYLAND_DISPLAY or maybe even $DISPLAY on its own (docs tell it is serial indentifier, but I guess it always starts from 1 in normal circumstances – or at least always invokes capturer with 1 on Wayland).

Going to update that this is indeed an issue, you can rebase to the latest working version like so

flatpak update --commit=ba230142b6d753191eec7416a36b7df6541b9da152c934b18dac3046491b0237 io.github.spacingbat3.webcord

https://docs.flatpak.org/en/latest/tips-and-tricks.html#downgrading

And to stop updating:

flatpak mask io.github.spacingbat3.webcord

(I also see that someone else has posted a similar command, I believe mine downgrades it to a newer version than that).

EDIT: Apparently any commit newer than what they posted doesn’t work, which is weird. But I’ve updated this comment to include the appropriate commit.

No, I do not plan doing anything about that right now (…)

Screw this, I think I just downgrade Electron for now and bump WebCord major version number just to keep with the SemVer. I’ll also avoid major version bumps in package.json without Electron version bump. Maybe I’ll even refactor husky scripts to even prevent commits on local repo that will bump Electron without bumping WebCord version (same rule should be for blocking dependency and app version bumps without updating package-lock.json.

I should’ve known bumping a framework version and releasing it as patch could cause more bad than good. Personally I felt that, but since I weren’t much familiar with the semver releases of desktop apps rather than libraries, I just thought to reserve major for like a complete code refactors or to announce some key features being implemented. That was a terrible idea, lesson taken and since WebCord 4.0.0 you will be able to expect a release model that will suggest you whenever something is likely going to cause any breakage to some wokflows (I’ll then reserve patch releases for a basically critical bug fixes and security patches, so you could expect more major and minior version bumps).

Segfaults on Wayland here too.

3.10.1 segfaults, solution is to go back to 3.10.0 for the moment.

I should note that the only reason I use webcord is because it can screen share on Wayland, so not having this feature working seems lacking.

Nothing really changed in WebCord in terms of screenshare implementation outside of Electron / Chromium engine version bump. I suspect v3.10.0 works fine, doesn’t it?

I have a feeling this has to do sth with the portals and Wayland – if you have all dependencies needed for the portals to work, I guess it’s then a matter of downgrading an Electron to the older version, which unlike to the latest still has some issues with the tray, but might have other stuff functional.

just confirmed version 4.0.0 is crashing with wayland and previous release (3.10.2) is working properly

It seems this is an issue with the webcord-bin AUR package as the normal webcord package works fine