GNOME Bugzilla – Bug 599971
PyGTK App (gajim) crashed in IA__gtk_accel_groups_activate()
Last modified: 2018-05-02 14:50:38 UTC
This issue is more or less reproducible. I can make it crash most of the time by closing a chat window using "escape". It's extremely likely to crash when I quickly close two windows. muelli@xbox:~$ apt-cache policy python-gtk2 libgtk2.0-0 python-gtk2: Installed: 2.16.0-0ubuntu1 Candidate: 2.16.0-0ubuntu1 Version table: *** 2.16.0-0ubuntu1 0 400 http://de.archive.ubuntu.com karmic/main Packages 100 /var/lib/dpkg/status 2.14.1-1ubuntu1 0 500 http://de.archive.ubuntu.com jaunty/main Packages libgtk2.0-0: Installed: 2.18.3-1 Candidate: 2.18.3-1 Version table: *** 2.18.3-1 0 400 http://de.archive.ubuntu.com karmic/main Packages 100 /var/lib/dpkg/status 2.16.1-0ubuntu2 0 500 http://de.archive.ubuntu.com jaunty/main Packages muelli@xbox:~$ Original bugreport at https://bugs.launchpad.net/ubuntu/+source/python2.6/+bug/462982 with probably more information. Other probably related bugreports: https://bugs.launchpad.net/bugs/389882 https://bugs.launchpad.net/bugs/452297 or https://bugs.launchpad.net/bugs/461571 If this happens to be a GTK+ issue, please reassign.
+ Trace 218642
Sometimes, I get this before the crash: gajim.py:3582: GtkWarning: gtk_accel_group_activate: assertion `GTK_IS_ACCEL_GROUP (accel_group)' failed gtk.main()
Now run with G_DEBUG=fatal_warnings: Gtk-CRITICAL **: gtk_accel_group_activate: assertion `GTK_IS_ACCEL_GROUP (accel_group)' failed aborting... Program received signal SIGABRT, Aborted. [Switching to Thread 0x7f12a66d46f0 (LWP 7793)] 0x00007f12a56e84b5 in raise () from /lib/libc.so.6 (gdb) t a a bt full
+ Trace 218643
Thread 1 (Thread 0x7f12a66d46f0 (LWP 7793))
(gdb)
Created attachment 146468 [details] Uninteresting valgrind.log Result of G_DEBUG=fatal-warnings valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=valgrind.log gajim Note that I couldn't make it crash with G_SLICE=always-malloc G_DEBUG=gc-friendly
FWIW, the only code I can see which is using anything accelerator related, seems to be this piece from http://trac.gajim.org/browser/src/message_window.py?rev=11245%3A8b8b18582724#L102: keys=['<Control>f', '<Control>g', '<Control>h', '<Control>i', '<Control>l', '<Control>L', '<Control>n', '<Control>u', '<Control>v$ '<Control>b', '<Control><Shift>Tab', '<Control>Tab', '<Control>F4', '<Control>w', '<Control>Page_Up', '<Control>Page_Down', '<Alt>Right$ '<Alt>Left', '<Alt>a', '<Alt>c', '<Alt>m', '<Alt>t', 'Escape'] + \ ['<Alt>'+str(i) for i in xrange(10)] accel_group = gtk.AccelGroup() for key in keys: keyval, mod = gtk.accelerator_parse(key) accel_group.connect_group(keyval, mod, gtk.ACCEL_VISIBLE, self.accel_group_func) self.window.add_accel_group(accel_group)
That code it's too complicated, can you attach a minimal example that shows the problem?
FWIW, there's another downstream report of this in Fedora's bug tracker here: https://bugzilla.redhat.com/show_bug.cgi?id=551834
I've downloaded an HG copy of Gajim, gtk.accel_group_activate() is not called directly so I suspect is not a wrapping mistake but rather something that happens inside GTK+ itself. Tobias try running gajim using G_SLICE=debug-blocks instead of G_SLICE=always-malloc and see if it helps in finding the problem.
FWIW: >Gajim-0.12 does not expose this problem, so taking the hg version of it does not trigger anything (weird enough). Running under valgrind with G_SLICE=debug-blocks does not help me :( It just crashes: muelli@bigbox /tmp $ G_SLICE=debug-blocks valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=valgrind.log gajim /usr/share/gajim/src/common/xmpp/auth.py:24: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha,base64,random,dispatcher /usr/share/gajim/src/common/xmpp/auth.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5 gajim.py:3535: Warning: g_set_prgname() called multiple times gnome.program_init('gajim', gajim.version) /usr/share/gajim/src/chat_control.py:1084: DeprecationWarning: Use the new widget gtk.Tooltip self.lock_tooltip = gtk.Tooltips() /usr/share/gajim/src/chat_control.py:1182: DeprecationWarning: Use the new widget gtk.Tooltip self.status_tooltip = gtk.Tooltips() /usr/share/gajim/src/chat_control.py:1455: DeprecationWarning: Use the new widget gtk.Tooltip banner_name_tooltip = gtk.Tooltips() /usr/share/gajim/src/chat_control.py:1543: DeprecationWarning: Use the new widget gtk.Tooltip banner_name_tooltip.set_tip(banner_name_label, label_tooltip) /usr/share/gajim/src/chat_control.py:1532: DeprecationWarning: Use the new widget gtk.Tooltip status) /usr/share/gajim/src/chat_control.py:1540: GtkWarning: Ran out of links self.banner_status_label.set_markup(status_text) /usr/share/gajim/src/message_window.py:278: GtkWarning: Ran out of links self.window.show_all() Segmentation fault (core dumped) muelli@bigbox /tmp $ ls -l valgrind.log -rw-------. 1 muelli muelli 5094 5. Jan 14:28 valgrind.log muelli@bigbox /tmp $ cat valgrind.log ==15868== Memcheck, a memory error detector ==15868== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==15868== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==15868== Command: gajim ==15868== Parent PID: 3773 ==15868== --15868-- --15868-- Valgrind options: --15868-- -v --15868-- --tool=memcheck --15868-- --leak-check=full --15868-- --num-callers=40 --15868-- --log-file=valgrind.log --15868-- Contents of /proc/version: --15868-- Linux version 2.6.31.9-174.fc12.x86_64 (mockbuild@x86-01.phx2.fedoraproject.org) (gcc version 4.4.2 20091027 (Red Hat 4.4.2-7) (GCC) ) #1 SMP Mon Dec 21 05:33:33 UTC 2009 --15868-- Arch and hwcaps: AMD64, amd64-sse3-cx16 --15868-- Page sizes: currently 4096, max supported 4096 --15868-- Valgrind library directory: /usr/lib64/valgrind --15868-- Reading syms from /bin/bash (0x400000) --15868-- object doesn't have a symbol table --15868-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux (0x38000000) --15868-- object doesn't have a dynamic symbol table --15868-- Reading syms from /lib64/ld-2.11.so (0x3762800000) --15868-- Reading debug info from /usr/lib/debug/lib64/ld-2.11.so.debug .. --15868-- Reading suppressions file: /usr/lib64/valgrind/default.supp --15868-- REDIR: 0x3762816fd0 (strlen) redirected to 0x3803f6f7 (vgPlain_amd64_linux_REDIR_FOR_strlen) --15868-- Reading syms from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so (0x4801000) --15868-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so (0x4a02000) ==15868== WARNING: new redirection conflicts with existing -- ignoring it --15868-- new: 0x3762816fd0 (strlen ) R-> 0x04a06340 strlen --15868-- REDIR: 0x3762816e40 (index) redirected to 0x4a05f80 (index) --15868-- REDIR: 0x3762816ec0 (strcmp) redirected to 0x4a06900 (strcmp) --15868-- Reading syms from /lib64/libtinfo.so.5.7 (0x3773000000) --15868-- Reading debug info from /usr/lib/debug/lib64/libtinfo.so.5.7.debug .. --15868-- Reading syms from /lib64/libdl-2.11.so (0x3763400000) --15868-- Reading debug info from /usr/lib/debug/lib64/libdl-2.11.so.debug .. --15868-- Reading syms from /lib64/libc-2.11.so (0x3762c00000) --15868-- Reading debug info from /usr/lib/debug/lib64/libc-2.11.so.debug .. --15868-- REDIR: 0x3762c80780 (__GI_strrchr) redirected to 0x4a05e00 (__GI_strrchr) --15868-- REDIR: 0x3762c7d290 (__GI_strcmp) redirected to 0x4a068b0 (__GI_strcmp) --15868-- REDIR: 0x3762c7ecc0 (__GI_strlen) redirected to 0x4a06300 (__GI_strlen) --15868-- REDIR: 0x3762c7eed0 (__GI_strncmp) redirected to 0x4a06800 (__GI_strncmp) --15868-- REDIR: 0x3762c7d1d0 (__GI_strchr) redirected to 0x4a05ec0 (__GI_strchr) --15868-- REDIR: 0x3762c83ed0 (strchrnul) redirected to 0x4a07620 (strchrnul) --15868-- REDIR: 0x3762c789f0 (malloc) redirected to 0x4a050db (malloc) --15868-- REDIR: 0x3762c79770 (free) redirected to 0x4a04ceb (free) --15868-- REDIR: 0x3762c828e0 (memcpy) redirected to 0x4a069d0 (memcpy) --15868-- REDIR: 0x3762c82640 (__GI_stpcpy) redirected to 0x4a072d0 (__GI_stpcpy) --15868-- REDIR: 0x3762c7ec90 (strlen) redirected to 0x480155c (_vgnU_ifunc_wrapper) ==15868== WARNING: new redirection conflicts with existing -- ignoring it --15868-- new: 0x3762c7ecc0 (__GI_strlen ) R-> 0x04a062e0 strlen --15868-- REDIR: 0x3762c7e6e0 (strcpy) redirected to 0x480155c (_vgnU_ifunc_wrapper) --15868-- REDIR: 0x3762d1fa20 (???) redirected to 0x4a06360 (strcpy) --15868-- REDIR: 0x3762c7ee90 (strncmp) redirected to 0x480155c (_vgnU_ifunc_wrapper) --15868-- REDIR: 0x3762d24220 (__strncmp_ssse3) redirected to 0x4a067a0 (strncmp) --15868-- REDIR: 0x3762c80750 (rindex) redirected to 0x480155c (_vgnU_ifunc_wrapper) ==15868== WARNING: new redirection conflicts with existing -- ignoring it --15868-- new: 0x3762c80780 (__GI_strrchr ) R-> 0x04a05dd0 rindex --15868-- REDIR: 0xffffffffff600400 (???) redirected to 0x3803f6ed (vgPlain_amd64_linux_REDIR_FOR_vtime) --15868-- REDIR: 0x3762c80e90 (memchr) redirected to 0x4a069a0 (memchr) --15868-- REDIR: 0x3762c83e80 (__GI___rawmemchr) redirected to 0x4a07670 (__GI___rawmemchr) --15868-- REDIR: 0x3762c7d250 (strcmp) redirected to 0x480155c (_vgnU_ifunc_wrapper) --15868-- REDIR: 0x3762d22fc0 (__strcmp_ssse3) redirected to 0x4a06860 (strcmp) --15868-- REDIR: 0x3762c7ed10 (strnlen) redirected to 0x4a06280 (strnlen) --15868-- REDIR: 0x3762cf3d70 (__strcpy_chk) redirected to 0x4a07d10 (__strcpy_chk) --15868-- REDIR: 0x3762c7d1a0 (index) redirected to 0x480155c (_vgnU_ifunc_wrapper) ==15868== WARNING: new redirection conflicts with existing -- ignoring it --15868-- new: 0x3762c7d1d0 (__GI_strchr ) R-> 0x04a05e90 index --15868-- REDIR: 0xffffffffff600000 (???) redirected to 0x3803f6e3 (vgPlain_amd64_linux_REDIR_FOR_vgettimeofday) --15868-- REDIR: 0x3762c80720 (strncpy) redirected to 0x480155c (_vgnU_ifunc_wrapper) --15868-- REDIR: 0x3762d20440 (???) redirected to 0x4a06500 (strncpy) --15868-- REDIR: 0x3762c814d0 (memset) redirected to 0x4a07540 (memset) --15868-- REDIR: 0x3762c79bf0 (realloc) redirected to 0x4a0518c (realloc) muelli@bigbox /tmp $ Do you want me to use some other debug tools or methods?
(In reply to comment #8) > FWIW: >Gajim-0.12 does not expose this problem, so taking the hg version of it > does not trigger anything (weird enough). What version do I have to download in order to trigger the bug_ > Do you want me to use some other debug tools or methods? I-ll give it a shot
It's reproducible for me with the following setup on Fedora 12: muelli@bigbox ~/svn/gnome2/gtk+/gtk $ yum info gtk2 pygtk2 gajim Loaded plugins: dellsysidplugin2, presto, priorities, refresh-packagekit Installed Packages Name : gajim Arch : x86_64 Version : 0.12.5 Release : 1.fc12 Size : 12 M Repo : installed From repo : fedora Summary : Jabber client written in PyGTK URL : http://gajim.org/ License : GPLv3 Description: Gajim is a Jabber client written in PyGTK. The goal of Gajim's : developers is to provide a full featured and easy to use xmpp : client for the GTK+ users. Gajim does not require GNOME to run, : eventhough it exists with it nicely. Name : gtk2 Arch : i686 Version : 2.18.5 Release : 4.fc12 Size : 12 M Repo : installed From repo : updates Summary : The GIMP ToolKit (GTK+), a library for creating GUIs for X URL : http://www.gtk.org License : LGPLv2+ Description: GTK+ is a multi-platform toolkit for creating graphical user : interfaces. Offering a complete set of widgets, GTK+ is suitable : for projects ranging from small one-off tools to complete : application suites. Name : gtk2 Arch : x86_64 Version : 2.18.5 Release : 4.fc12 Size : 12 M Repo : installed From repo : updates Summary : The GIMP ToolKit (GTK+), a library for creating GUIs for X URL : http://www.gtk.org License : LGPLv2+ Description: GTK+ is a multi-platform toolkit for creating graphical user : interfaces. Offering a complete set of widgets, GTK+ is suitable : for projects ranging from small one-off tools to complete : application suites. Name : pygtk2 Arch : x86_64 Version : 2.16.0 Release : 1.fc12 Size : 4.1 M Repo : installed From repo : anaconda-InstallationRepo-200911081904.x86_64 Summary : Python bindings for GTK+ URL : http://www.pygtk.org/ License : LGPLv2+ Description: PyGTK is an extension module for Python that gives you access to : the GTK+ widget set. Just about anything you can write in C with : GTK+ you can write in Python with PyGTK (within reason), but with : all the benefits of using a high-level scripting language. muelli@bigbox ~/svn/gnome2/gtk+/gtk $
Doesn't happen anymore. Hence closing.
Please reopen this bug. It is still happening.
(In reply to comment #12) > Please reopen this bug. It is still happening. Please provide version information, etc.
It happens with: GTK+ 2.24.10-1 PyGTK Version: 2.24.0 Here's Gajim's link about bunch of people having the same problem: https://trac.gajim.org/ticket/6903 I can reproduce all the time I want.
Jefry, can you try to run under valgrind like in an earlier comment?
I ran it with: "valgrind ./launch" Gajim doesn't crash, it just freezes. I don't know what am I supposed to expect or how to use valgrind.
> I've downloaded an HG copy of Gajim, gtk.accel_group_activate() is not called > directly so I suspect is not a wrapping mistake but rather something that > happens inside GTK+ itself. > > Tobias try running gajim using G_SLICE=debug-blocks instead of > G_SLICE=always-malloc and see if it helps in finding the problem. Agree. Moving to GTK
Here's the output I get with strace: recvfrom(4, 0x1cbf2c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) recvfrom(4, 0x1cbf2c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=4, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}]) writev(4, [{"(\0\4\0P\3\300\2\255\0\0\0\0\0\0\0", 16}, {NULL, 0}, {"", 0}], 3) = 16 poll([{fd=4, events=POLLIN}], 1, -1) = 1 ([{fd=4, revents=POLLIN}]) recvfrom(4, "\1\1~!\0\0\0\0\373B\326\0a\3n\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32 recvfrom(4, 0x1cbf2c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) recvfrom(4, 0x1cbf2c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) open("/home/zimio/.config/gajim/.config.test", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 18 fstat(18, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 fstat(18, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff1312a6000 write(18, "sounddnd = False\nuse_notif_daemo"..., 4096) = 4096 write(18, "n_other_resource\nsingle-msg-heig"..., 4096) = 4096 write(18, "es.default.grouptextcolor = \nthe"..., 4096) = 4096 write(18, "s.thiessen.im.name = jtest\naccou"..., 4096) = 4096 write(18, "\naccounts.jabber.org.resource = "..., 4096) = 4096 write(18, "e = Gajim\naccounts.prosody.im.na"..., 4096) = 4096 futex(0x1e21a50, FUTEX_WAKE_PRIVATE, 1) = 1 write(18, "\naccounts.Local.subscribe_mood ="..., 4096) = 4096 write(18, "activity = \nstatusmsg._last_dnd."..., 3832) = 3832 fsync(18) = 0 close(18) = 0 munmap(0x7ff1312a6000, 4096) = 0 stat("/home/zimio/.config/gajim/config.test", {st_mode=S_IFREG|0600, st_size=32504, ...}) = 0 rename("/home/zimio/.config/gajim/.config.test", "/home/zimio/.config/gajim/config.test") = 0 chmod("/home/zimio/.config/gajim/config.test", 0600) = 0 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 stat("gajim.py", {st_mode=S_IFREG|0644, st_size=15497, ...}) = 0 open("gajim.py", O_RDONLY) = 18 fstat(18, {st_mode=S_IFREG|0644, st_size=15497, ...}) = 0 fstat(18, {st_mode=S_IFREG|0644, st_size=15497, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff1312a6000 read(18, "# -*- coding:utf-8 -*-\n## src/ga"..., 8192) = 8192 read(18, "SD', 'OpenBSD', 'NetBSD'):\n "..., 4096) = 4096 read(18, "find('gajim') < 0:\n r"..., 4096) = 3209 read(18, "", 4096) = 0 close(18) = 0 munmap(0x7ff1312a6000, 4096) = 0 write(2, "gajim.py:456: GtkWarning: IA__gt"..., 121gajim.py:456: GtkWarning: IA__gtk_accel_group_activate: assertion `GTK_IS_ACCEL_GROUP (accel_group)' failed gtk.main() ) = 121 futex(0x1e21a50, FUTEX_WAKE_PRIVATE, 1) = 1 The last system call is futex, and then it freezes and never wakes up.So maybe the thread never gets woken up?
FYI: I just got a crash on a recent Fedora 17. $ yum deplist gajim Loaded plugins: presto, priorities, refresh-packagekit package: gajim.noarch 0.15-5.fc17 dependency: /bin/sh provider: bash.x86_64 4.2.37-2.fc17 dependency: avahi-ui-tools provider: avahi-ui-tools.x86_64 0.6.31-5.fc17 dependency: bind-utils provider: bind-utils.x86_64 32:9.9.1-5.P2.fc17 dependency: dbus-python provider: dbus-python.x86_64 0.83.0-9.fc17 dependency: farstream-python provider: farstream-python.x86_64 0.1.2-2.fc17 dependency: gnome-python2-bonobo provider: gnome-python2-bonobo.x86_64 2.28.1-8.fc17 dependency: gnome-python2-desktop provider: gnome-python2-desktop.x86_64 2.32.0-9.fc17 dependency: gnome-python2-gnome provider: gnome-python2-gnome.x86_64 2.28.1-8.fc17 dependency: gnupg provider: gnupg.x86_64 1.4.12-1.fc17 dependency: gstreamer-python provider: gstreamer-python.x86_64 0.10.22-2.fc17 provider: gstreamer-python.i686 0.10.22-2.fc17 dependency: gtkspell provider: gtkspell.x86_64 2.0.16-4.fc17 provider: gtkspell.i686 2.0.16-4.fc17 dependency: gupnp-igd-python provider: gupnp-igd-python.x86_64 0.2.1-1.fc17 dependency: hicolor-icon-theme provider: hicolor-icon-theme.noarch 0.12-4.fc17 dependency: libXScrnSaver provider: libXScrnSaver.x86_64 1.2.2-1.fc17 provider: libXScrnSaver.i686 1.2.2-1.fc17 dependency: notify-python provider: notify-python.x86_64 0.1.1-20.fc17 dependency: pyOpenSSL provider: pyOpenSSL.x86_64 0.12-2.fc17 dependency: python-GnuPGInterface provider: python-GnuPGInterface.noarch 0.3.2-9.fc17 dependency: python-crypto provider: python-crypto.x86_64 2.6-1.fc17 dependency: python-kerberos provider: python-kerberos.x86_64 1.1-8.1.fc17 dependency: python-libasyncns provider: python-libasyncns.x86_64 0.7.1-6.fc17 The report is here: https://bugzilla.redhat.com/show_bug.cgi?id=859507 FWIW: Googling for gtk_accel_groups_activate reveals things like https://lists.launchpad.net/gtg-contributors/msg00902.html or https://bugs.launchpad.net/ubuntu/+source/gtg/+bug/744409 or https://bugs.launchpad.net/ubuntu/+source/gajim/+bug/361072 so there are some people that are affected. (In reply to comment #7) > Tobias try running gajim using G_SLICE=debug-blocks instead of > G_SLICE=always-malloc and see if it helps in finding the problem. Hm. Valgrind doesn't show anything interesting from what I can see. I ran G_SLICE=debug-blocks G_DEBUG=gc-friendly valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=valgrind.log gajim, gajim crashed but the log is essentially what is given in comment #8. I reported some of my (not so interesting) findings here: https://trac.gajim.org/ticket/5371#comment:6 FWIW: My gnome-settings-daemon is somewhat dysfunctional due to bug 679151. That may or may affect the crashyness.
So the issue is apparently fixed upstream with a bit of a weird patch: https://trac.gajim.org/changeset/fdd7c9b81c1b that fixes it for me. But is it true that one has to return True in order to not make it crash? Couldn't PyGTK check whether no return value was given and at least print a warning in that case?
FWOW: I am suspecting either https://dev.gajim.org/gajim/gajim/commit/52b2b17c7c38c22afeb38259cc890e705a56a0f0 or https://dev.gajim.org/gajim/gajim/commit/f801ecab11087756cb870b90454dfbdbb6c635bc to be the new Git commit of the old mercurial revision.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/327.