Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 903616 - net-im/discord-0.0.26 crashes on launch
Summary: net-im/discord-0.0.26 crashes on launch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: Randall
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-31 01:51 UTC by Eric Hermes
Modified: 2023-03-31 16:30 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Discord strace (discord_strace.log,246.04 KB, text/x-log)
2023-03-31 01:51 UTC, Eric Hermes
Details
Ebuild with conditional crashpad (discord-0.0.26-r1.ebuild,3.24 KB, text/plain)
2023-03-31 07:28 UTC, Jyrki Launonen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Hermes 2023-03-31 01:51:02 UTC
As of net-im/discord-0.0.26, attempting to launch results in a core dump:

eric@mikan ~ $ discord
[3999:0330/214124.529256:FATAL:spawn_subprocess.cc(221)] posix_spawn: No such file or directory (2)
Trace/breakpoint trap (core dumped)
eric@mikan ~ $


Reproducible: Always

Steps to Reproduce:
1. Launch discord
2.
3.
Actual Results:  
Discord fails to launch.

Expected Results:  
Discord launches.
Comment 1 Eric Hermes 2023-03-31 01:51:46 UTC
Created attachment 859308 [details]
Discord strace
Comment 2 Artemis Everfree 2023-03-31 06:51:34 UTC
same issue on my machine. i think that the `posix_spawn: No such file or directory` may be somewhat misleading to the actual problem. looking at my own strace, i can see, just before the error,

[pid 20328] execve("/opt/discord/chrome_crashpad_handler", ["/opt/discord/chrome_crashpad_han"..., "--monitor-self-annotation=ptype="..., "--no-rate-limit", "--database=/home/vi/.config/disc"..., "--url=https://sentry.io/api/1463"..., "--annotation=_companyName=Discor"..., "--annotation=_productName=Discor"..., "--annotation=_version=0.0.26", "--annotation=lsb-release=Gentoo "..., "--annotation=plat=Linux", "--annotation=prod=Electron", "--annotation=ver=22.3.2", "--initial-client-fd=44", "--shared-client-connection"], 0x3f48002f8900 /* 87 vars */) = -1 ENOENT (No such file or directory)

and indeed /opt/discord/chrome_crashpad_handler does not exist. i put a simple bash script at that location that prints args/stdin to a file in /tmp. no stdin came in but, full args are 

--monitor-self-annotation=ptype=crashpad-handler --no-rate-limit --database=/home/vi/.config/discord/Crashpad --url=https://sentry.io/api/146342/minidump/?sentry_key=384ce4413de74fe0be270abe03b2b35a --annotation=_companyName=Discord Inc. --annotation=_productName=Discord --annotation=_version=0.0.26 --annotation=lsb-release=Gentoo Linux --annotation=plat=Linux --annotation=prod=Electron --annotation=ver=22.3.2 --initial-client-fd=44 --shared-client-connection

discord is still ultimately failing to launch, so it's only trying to execute that file to report on some error further up the process. what the root cause error actually is im not sure.
Comment 3 Artemis Everfree 2023-03-31 06:57:21 UTC
i guess i should add that it starts failing with ECONNRESET (Connection reset by peer) in recvmsg after exexcuting the crashpad so maybe (im not very knowledgeable about electron) its' supposed to be running the whole time and the fact that the real one doesnt exist _is_ the problem? i dont have a copy of the real on around to test.
Comment 4 Artemis Everfree 2023-03-31 06:59:40 UTC
jk (sorry for the reply spam) I forgot vscode provides a copy of chrome_crashpad_handler since that's also discord

I ran

sudo cp /opt/vscode/chrome_crashpad_handler /opt/discord/chrome_crashpad_handler

and then ran discord and it started right up. so its literally just erroring because its missing that executable
Comment 5 Artemis Everfree 2023-03-31 07:00:03 UTC
that's also electron*
Comment 6 Jyrki Launonen 2023-03-31 07:20:20 UTC
Same happened previously in discord 0.0.23, see bug 890595. Then they removed the handler in 0.0.24 a day or two later. The chrome_crashpad_handler does exist in discord-0.0.26.tar.gz (but not in discord-0.0.25.tar.gz), so maybe the ebuild should conditionally install it as it seems the upstream randomly supplies it.
Comment 7 Jyrki Launonen 2023-03-31 07:28:39 UTC
Created attachment 859312 [details]
Ebuild with conditional crashpad

--- discord-0.0.26.ebuild	2023-03-31 04:12:29.000000000 +0300
+++ discord-0.0.26-r1.ebuild	2023-03-31 10:24:32.314558216 +0300
@@ -116,6 +116,10 @@
 	fowners root "${DESTDIR}/chrome-sandbox"
 	fperms 4711 "${DESTDIR}/chrome-sandbox"
 
+	# Crashpad is included in the package once in a while and when it does, it must be installed.
+	# See #903616 and #890595
+	[[ -x chrome_crashpad_handler ]] && doins chrome_crashpad_handler
+
 	dosym "${DESTDIR}/${MY_PN^}" "/usr/bin/${MY_PN}"
 }
Comment 8 Dawid Chemloul 2023-03-31 07:58:46 UTC
Running this command is a workaround that made it work for me:

$ ELECTRON_ENABLE_STACK_DUMPING=true discord
Comment 9 Dawid Chemloul 2023-03-31 08:15:59 UTC
(In reply to Dawid Chemloul from comment #8)
> Running this command is a workaround that made it work for me:
> 
> $ ELECTRON_ENABLE_STACK_DUMPING=true discord

courtesy of redit community:
https://www.reddit.com/r/Gentoo/comments/127cuk9/i_cant_run_discord_after_update_0026/?utm_source=share&utm_medium=web2x&context=3
Comment 10 whitleystriber 2023-03-31 10:49:31 UTC
Same issue as well.

~ discord
[4905:0331/064917.225507:FATAL:spawn_subprocess.cc(221)] posix_spawn: No such file or directory (2)
[1]    4883 trace trap  discord
➜  ~
Comment 11 APN-Pucky 2023-03-31 15:20:48 UTC
(In reply to Dawid Chemloul from comment #8)
> Running this command is a workaround that made it work for me:
> 
> $ ELECTRON_ENABLE_STACK_DUMPING=true discord

Thank you
Comment 12 Randall 2023-03-31 15:24:00 UTC
Thanks to everyone who helped investigate this. I'll try to take a look this weekend and push a PR with a fix.
Comment 13 Larry the Git Cow gentoo-dev 2023-03-31 16:23:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=faa52c1c5bc2c1a2ac9382f22c6dd0802b8b7250

commit faa52c1c5bc2c1a2ac9382f22c6dd0802b8b7250
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-03-31 16:22:23 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-31 16:23:15 +0000

    net-im/discord: install chrome_crashpad_handler if it exists
    
    This fixes crashes at startup.
    
    Closes: https://bugs.gentoo.org/903616
    Thanks-to: Jyrki Launonen <codez_iccd_99@yahoo.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 net-im/discord/{discord-0.0.26.ebuild => discord-0.0.26-r1.ebuild} | 4 ++++
 1 file changed, 4 insertions(+)