FS#51298 - [libxi] gtk2 segfaults
Attached to Project:
Arch Linux
Opened by Erin (heimer16) - Sunday, 09 October 2016, 15:43 GMT
Last edited by Jan de Groot (JGC) - Friday, 21 October 2016, 09:10 GMT
Opened by Erin (heimer16) - Sunday, 09 October 2016, 15:43 GMT
Last edited by Jan de Groot (JGC) - Friday, 21 October 2016, 09:10 GMT
|
Details
gtk2 applications fail to start with a segmentation fault
using libxi 1.7.7 with xbox360 controller connected via usb.
When disconnecting the controller gtk2 applications start
normally. Re-connecting the controller resumes causing
segfaults on starting gtk2 applications. gtk3 and non-gtk
applications start fine.
downgrading to libxi 1.7.6 fixes the issue. an example stack trace: #0 0x00007ffff78898ce in ?? () from /usr/lib/libgdk-x11-2.0.so.0 #1 0x00007ffff7864f28 in gdk_display_open () from /usr/lib/libgdk-x11-2.0.so.0 #2 0x00007ffff7834732 in gdk_display_open_default_libgtk_only () from /usr/lib/libgdk-x11-2.0.so.0 #3 0x00007ffff2176275 in gtk_init () from /usr/lib/libgtk-x11-2.0.so.0 #4 0x00007ffff7228f28 in Gtk::Main::init(int*, char***, bool) () from /usr/lib/libgtkmm-2.4.so.1 #5 0x00007ffff7228f8f in Gtk::Main::Main(int&, char**&, bool) () from /usr/lib/libgtkmm-2.4.so.1 #6 0x0000000000412231 in ?? () #7 0x00007ffff50c3291 in __libc_start_main () from /usr/lib/libc.so.6 #8 0x0000000000413e69 in ?? () thread in forum here: https://bbs.archlinux.org/viewtopic.php?pid=1659799#p1659799 |
This task depends upon
Closed by Jan de Groot (JGC)
Friday, 21 October 2016, 09:10 GMT
Reason for closing: Fixed
Additional comments about closing: libxi 1.7.7-2 moved to extra.
Friday, 21 October 2016, 09:10 GMT
Reason for closing: Fixed
Additional comments about closing: libxi 1.7.7-2 moved to extra.
You should fill an upstream bug report at https://bugs.freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=98204
Something hits the bailout code. I don't know what's wrong with the bailout code or if it's a problem in the server/driver here, but the bailout code is not complete.
XListInputDevices(
register Display *dpy,
int *ndevices)
ndevices is set to non-zero, then the calculations are done, something hits the bailout, ndevices is not touched anymore and NULL is returned.
gtk does this:
devices = XListInputDevices(display_x11->xdisplay, &num_devices);
for(loop=0; loop<num_devices; loop++)
So gtk will loop through a NULL devices array because num_devices is non-zero.
gtk is probably wrong and should check for devices, through it doesn't seem to be defined in the XListInputDevices manpage (https://linux.die.net/man/3/xlistinputdevices)
The man page should probably include a section on return codes, but for safety it is better to not touch ndevices at all until we are sure to return anything meaningful.
I still haven't looked into the code too much, but it could also be that the logic in XListInputDevices is wrong and it should not abort when SizeClassInfo returns 0.