FS#65885 - [libappindicator-gtk3] Segfault with Discord
Attached to Project:
Community Packages
Opened by Paul G (paulieg) - Wednesday, 18 March 2020, 23:36 GMT
Last edited by Balló György (City-busz) - Friday, 03 July 2020, 14:40 GMT
Opened by Paul G (paulieg) - Wednesday, 18 March 2020, 23:36 GMT
Last edited by Balló György (City-busz) - Friday, 03 July 2020, 14:40 GMT
|
Details
Description:
Several popular applications, such as Discord, have been suffering from constant crashes for years due to a bug in libappindicator. See for example: https://github.com/flathub/com.discordapp.Discord/issues/30 I have found this bug, fixed it and submitted the bug report and patch 'upstream' here: https://bugs.launchpad.net/archlinux/+source/libappindicator/+bug/1867996 I say 'upstream' because the only place I was able to find to report it is Ubuntu's bugtracker, which isn't strictly speaking upstream for libappindicator. However, a real upstream is unavailable as its launchpad page doesn't accept bug reports. Given this, it is unlikely that the patch will be reviewed, applied and released any time soon. In the spirit of having Arch work properly when borked messes like Ubuntu don't, I propose applying my patch during the package build process. Attached please find a) the patch itself and b) the patch to the PKGBUILD. I have tested the new PKGBUILD and attached the patch so it is as easy as possible for the package maintainer to roll out this fix. |
This task depends upon
Closed by Balló György (City-busz)
Friday, 03 July 2020, 14:40 GMT
Reason for closing: Fixed
Additional comments about closing: libappindicator-gtk3 12.10.0.r296-1
Friday, 03 July 2020, 14:40 GMT
Reason for closing: Fixed
Additional comments about closing: libappindicator-gtk3 12.10.0.r296-1
Please post a proper trace as described here:
https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces
The problem appears more widespread - multiple emits of g_signal pass in an extra boolean vararg at the end that is not declared in the definition of the signals.
Examples:
---
definition:
signals[NEW_ICON_THEME_PATH] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH,
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AppIndicatorClass, new_icon_theme_path),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
call:
g_signal_emit (self, signals[NEW_ICON_THEME_PATH], 0, self->priv->icon_theme_path, TRUE);
definition:
signals[NEW_ICON] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_ICON,
G_TYPE_FROM_CLASS(klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (AppIndicatorClass, new_icon),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0, G_TYPE_NONE);
call:
g_signal_emit (self, signals[NEW_ICON], 0, TRUE);
Unless I'm fundamentally misunderstanding something (which is possible, since this is the first time I've looked at g_signals and gobject in general), these signalls clearly don't expect the G_TYPE_BOOL they are getting, hence the segfaults in va_list handlng.
I'm not running Arch anymore but this bug seems to be distribution-agnostic. Please let me know if I can help in any other way resolving this bug.
If you get these crashes often enough to be "reproducible", try building a separate copy of libappindicator with this patch applied, and LD_PRELOAD it for the electron app in question. If the crashes go away, it's an extra datapoint.
I did this last night and left my application open and still witnessed the crash some time overnight :(
https://bugs.launchpad.net/archlinux/+source/libappindicator/+bug/1867996/+attachment/5339867/+files/n_elements.patch