GNOME Bugzilla – Bug 779605
GLib-CRITICAL Source ID xxx was not found when attempting to remove it
Last modified: 2017-08-07 05:14:51 UTC
This may be part of Bug 729800 (https://bugzilla.gnome.org/show_bug.cgi?id=729800) that was not caught when it was marked fixed. This relates to the GtkRecentChooser. This bug can be triggered running the code straight from the manual page, e.g.: GtkWidget *dialog; dialog = gtk_recent_chooser_dialog_new ("Recent Documents", parent_window), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { GtkRecentInfo *info; info = gtk_recent_chooser_get_current_item (GTK_RECENT_CHOOSER (dialog)); gtk_recent_info_unref (info); } gtk_widget_destroy (dialog); Activating the dialog results in, e.g.: (gtkwrite:2352): GLib-CRITICAL **: Source ID 137 was not found when attempting to remove it
Can you please run the test case as G_DEBUG=fatal-warnings gdb ./program then reproduce the given situation and get a backtrace from the ensuing critical?
Thanks Daniel, Sure, I'm happy too. Here are two testcases. The first on Archlinux, the second on openSuSE Leap 42.2: Archlinux: $ G_DEBUG=fatal-warnings gdb ./bin/recentfiles_tstcase GNU gdb (GDB) 8.0 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./bin/recentfiles_tstcase...done. (gdb) run Starting program: /home/david/dev/src-c/ui/gtk/bin/recentfiles_tstcase [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7f3be9568700 (LWP 28954)] (recentfiles_tstcase:28950): GLib-CRITICAL **: Source ID 56 was not found when attempting to remove it Thread 1 "recentfiles_tst" received signal SIGTRAP, Trace/breakpoint trap. 0x00007f3befca5411 in ?? () from /usr/lib/libglib-2.0.so.0 (gdb) backtrace
+ Trace 237752
A debugging session is active. Inferior 1 [process 14017] will be killed. Quit anyway? (y or n) y
I don't know why the openSuSE Leap backtrace wasn't also shown (it was in my comment). Here it is again: $ G_DEBUG=fatal-warnings gdb ./bin/recentfiles_tstcase GNU gdb (GDB; openSUSE Leap 42.2) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-suse-linux". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://bugs.opensuse.org/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./bin/recentfiles_tstcase...done. (gdb) run Starting program: /home/david/dev/src-c/ui/gtk/bin/recentfiles_tstcase warning: the debug information found in "/usr/lib/debug//lib64/ld-2.22.so.debug" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch). Missing separate debuginfos, use: zypper install glibc-debuginfo-2.22-4.9.1.x86_64 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". warning: the debug information found in "/usr/lib/debug//lib64/libc-2.22.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch). [New Thread 0x7fffec33a700 (LWP 14021)] [New Thread 0x7fffebb39700 (LWP 14022)] Detaching after fork from child process 14023. (recentfiles_tstcase:14017): GLib-CRITICAL **: Source ID 192 was not found when attempting to remove it Thread 1 "recentfiles_tst" received signal SIGTRAP, Trace/breakpoint trap. 0x00007ffff5e7f713 in g_logv () from /usr/lib64/libglib-2.0.so.0 Missing separate debuginfos, use: zypper install fontconfig-debuginfo-2.11.1-2.2.x86_64 gtk2-engine-clearlooks-debuginfo-2.20.2-30.1.x86_64 gtk2-engine-crux-debuginfo-2.20.2-30.1.x86_64 gvfs-debuginfo-1.28.3-2.2.x86_64 libFLAC8-debuginfo-1.3.0-12.1.x86_64 libX11-6-debuginfo-1.6.3-7.1.x86_64 libXau6-debuginfo-1.0.8-7.4.x86_64 libXcomposite1-debuginfo-0.4.4-11.3.x86_64 libXcursor1-debuginfo-1.1.14-7.3.x86_64 libXdamage1-debuginfo-1.1.4-10.3.x86_64 libXext6-debuginfo-1.3.3-4.19.x86_64 libXfixes3-debuginfo-5.0.1-8.1.x86_64 libXi6-debuginfo-1.7.5-5.3.1.x86_64 libXinerama1-debuginfo-1.1.3-6.3.x86_64 libXrandr2-debuginfo-1.5.0-5.1.x86_64 libXrender1-debuginfo-0.9.9-4.1.x86_64 libasound2-debuginfo-1.1.3-8.9.1.x86_64 libatk-1_0-0-debuginfo-2.20.0-1.5.x86_64 libbz2-1-debuginfo-1.0.6-32.53.x86_64 libcairo2-debuginfo-1.15.2-5.3.1.x86_64 libcanberra-gtk0-debuginfo-0.30-12.2.x86_64 libcanberra-gtk2-module-debuginfo-0.30-12.2.x86_64 libcanberra0-debuginfo-0.30-12.2.x86_64 libcap2-debuginfo-2.22-16.55.x86_64 libdatrie1-debuginfo-0.2.4-20.5.x86_64 libdbus-1-3-debuginfo-1.8.22-3.1.x86_64 libexpat1-debuginfo-2.1.0-19.1.x86_64 libffi4-debuginfo-5.3.1+r233831-8.3.1.x86_64 libgcrypt20-debuginfo-1.6.1-34.6.1.x86_64 libgdk_pixbuf-2_0-0-debuginfo-2.34.0-5.1.x86_64 libgio-2_0-0-debuginfo-2.48.2-1.10.x86_64 libglib-2_0-0-debuginfo-2.48.2-1.10.x86_64 libgmodule-2_0-0-debuginfo-2.48.2-1.10.x86_64 libgobject-2_0-0-debuginfo-2.48.2-1.10.x86_64 libgpg-error0-debuginfo-1.13-4.19.x86_64 libgraphite2-3-debuginfo-1.3.1-4.3.1.x86_64 libgtk-2_0-0-debuginfo-2.24.31-12.1.x86_64 libharfbuzz0-debuginfo-1.4.5-5.3.1.x86_64 libjson-c2-debuginfo-0.12-5.4.x86_64 libltdl7-debuginfo-2.4.2-18.3.1.x86_64 liblzma5-debuginfo-5.2.2-1.11.x86_64 libogg0-debuginfo-1.3.0-4.3.x86_64 libopenssl1_0_0-debuginfo-1.0.2j-4.1.x86_64 libpango-1_0-0-debuginfo-1.40.1-1.5.x86_64 libpcre1-debuginfo-8.39-6.1.x86_64 libpixman-1-0-debuginfo-0.34.0-2.2.x86_64 libpng16-16-debuginfo-1.6.8-9.3.1.x86_64 libpulse0-debuginfo-9.0-1.2.x86_64 libselinux1-debuginfo-2.5-2.12.x86_64 libsndfile1-debuginfo-1.0.25-26.6.1.x86_64 libspeex1-debuginfo-1.2~rc2-2.5.x86_64 libsystemd0-debuginfo-228-25.9.1.x86_64 libthai0-debuginfo-0.1.25-1.2.x86_64 libvorbis0-debuginfo-1.3.3-4.18.x86_64 libvorbisenc2-debuginfo-1.3.3-4.18.x86_64 libvorbisfile3-debuginfo-1.3.3-4.18.x86_64 libwayland-client0-debuginfo-1.9.0-2.5.x86_64 libwayland-server0-debuginfo-1.9.0-2.5.x86_64 libxcb-render0-debuginfo-1.11.1-2.25.x86_64 libxcb-shm0-debuginfo-1.11.1-2.25.x86_64 libxcb1-debuginfo-1.11.1-2.25.x86_64 libz1-debuginfo-1.2.8-10.1.x86_64 (gdb) backtrace
+ Trace 237753
Also, I evidently don't have the option of changing the flag from 'NEEDINFO' on this bug, so I guess that is something you will have to handle. Thanks.
Created attachment 356909 [details] Sourcefile for testcase used to create backtraces This attachment contains the source code used to generate the testcase bactraces. The bug occurs in the function open_recent_file().
(In reply to Daniel Boles from comment #1) > Can you please run the test case as > G_DEBUG=fatal-warnings gdb ./program > then reproduce the given situation and get a backtrace from the ensuing > critical? Daniel, Sorry, I posted to the backtraces as comments instead of in the reply. Also note, the line numbers in the backtraces may be off by a few from the sourcefile attached (I cleaned it up before attaching from the base reference manual testcase so it would go ahead and open the file in the textview.) The bug occurs regardless what you do with the dialog.
Thanks! No worries, replies are just comments with quotes in them, and the quotes are only needed if it'd otherwise be hard to follow what you're replying to. Sorry, I should've mentioned this before: Can you can get the debug symbols installed (or even compile a debug GTK+ if you're feeling brave) then get a bt with those? At the moment, there are a block of unknown functions, which make it still quite unclear where the error is coming from.
Sure, I'll give it a go. I can pull the PKGBUILD on Arch and compile with debug (it may take an hour or two to get it all figured out), I'll post a fresh backtrace from the testcase source as soon as I get it compiled. I take my hat off to you. I've picked through the GTK+ source a bit, and it is a task for the brave....
It is times like these when you wish you were building on a fast SSD instead of a RAID1 array of SATA-III platters :) I rebuilt gtk2 on Archlinux with: CXX=/bin/false ./configure --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-xinput=yes \ --enable-gtk-doc \ --enable-debug=yes I rebuilt recentfiles_tstcase.c and obtained the following backtrace: $ G_DEBUG=fatal-warnings gdb ./bin/recentfiles_tstcase GNU gdb (GDB) 8.0 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./bin/recentfiles_tstcase...done. (gdb) run Starting program: /home/david/dev/src-c/ui/gtk/bin/recentfiles_tstcase [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7f9d8f10b700 (LWP 20221)] (recentfiles_tstcase:20217): GLib-CRITICAL **: Source ID 66 was not found when attempting to remove it Thread 1 "recentfiles_tst" received signal SIGTRAP, Trace/breakpoint trap. 0x00007f9d95848411 in ?? () from /usr/lib/libglib-2.0.so.0 (gdb) backtrace
+ Trace 237756
A debugging session is active. Inferior 1 [process 20217] will be killed. Quit anyway? (y or n) y Hopefully that provides the needed additional symbol names, but if it doesn't just let me know and I'm happy to rebuild Gtk+2 with any additional options I missed. I checked https://developer.gnome.org/gtk2/stable/gtk-building.html for the options available and --enable-debug=yes was the only thing I found.
It looks like there are still some () functions missing from libgtk-xll and libgdk. Do I need to find the packages that provide those and recompile with --enable-debug=yes also? I'm not sure what additional packages are implicated, but I'm sure I could poke around on the Arch svntogit server and find out. Let me know if more rebuilds are needed.
OK, now I think we are getting somewhere, I rebuilt glib2-2.52.3 with: ./configure --prefix=/usr --libdir=/usr/lib \ --sysconfdir=/etc \ --with-pcre=system \ --disable-fam \ --enable-gtk-doc \ --enable-debug=yes I rebuilt and reran the testcase and got another (new and different) backtrace which points the arrow at an invalid shared-segment parameter: $ G_DEBUG=fatal-warnings gdb ./bin/recentfiles_tstcase GNU gdb (GDB) 8.0 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./bin/recentfiles_tstcase...done. (gdb) run Starting program: /home/david/dev/src-c/ui/gtk/bin/recentfiles_tstcase [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7fe3dc32f700 (LWP 1100)] (recentfiles_tstcase:1096): Gdk-ERROR **: The program 'recentfiles_tstcase' received an X Window System error. This probably reflects a bug in the program. The error was 'BadShmSeg (invalid shared segment parameter)'. (Details: serial 968 error_code 128 request_code 130 minor_code 3) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) Thread 1 "recentfiles_tst" received signal SIGTRAP, Trace/breakpoint trap. 0x00007fe3e2a6c6f2 in ?? () from /usr/lib/libglib-2.0.so.0 (gdb) backtrace
+ Trace 237757
A debugging session is active. Inferior 1 [process 1096] will be killed. Quit anyway? (y or n) y I don't understand the additional gdb 'run it with the --sync command line' statement. I tried, but had no luck adding the --sync option. Let me know if you think I need to try something else in that regard.
This is getting weird. I just reran the gdb testcase, without any additional changes and did not get the same BadShmSeg error. The backtrace obtained (which looks like the normal backtraces we have been getting) is: (gdb) run Starting program: /home/david/dev/src-c/ui/gtk/bin/recentfiles_tstcase [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7f5d3f32c700 (LWP 1164)] (recentfiles_tstcase:1160): GLib-CRITICAL **: Source ID 109 was not found when attempting to remove it Thread 1 "recentfiles_tst" received signal SIGTRAP, Trace/breakpoint trap. 0x00007f5d45a696f2 in ?? () from /usr/lib/libglib-2.0.so.0 (gdb) backtrace
+ Trace 237758
Thanks for your help. Let me know if there is something further I can provide.
(In reply to Daniel Boles from comment #7) > Thanks! No worries, replies are just comments with quotes in them, and the > quotes are only needed if it'd otherwise be hard to follow what you're > replying to. > > Sorry, I should've mentioned this before: Can you can get the debug symbols > installed (or even compile a debug GTK+ if you're feeling brave) then get a > bt with those? At the moment, there are a block of unknown functions, which > make it still quite unclear where the error is coming from. Hah! I think I finally got a useful backtrace for you!! I installed ALL the debug files on openSuSE and was able to fill in the missing functions. I don't know why the hours of gtk+2 and glib2 rebuilds with --enable-debug=yes didn't produce the same thing, but it didn't. Here is something that I think will be more useful: $ G_DEBUG=fatal-warnings gdb ./bin/recentfiles_tstcase GNU gdb (GDB; openSUSE Leap 42.2) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-suse-linux". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://bugs.opensuse.org/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./bin/recentfiles_tstcase...done. (gdb) run Starting program: /home/david/dev/src-c/ui/gtk/bin/recentfiles_tstcase warning: the debug information found in "/usr/lib/debug//lib64/ld-2.22.so.debug" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch). Missing separate debuginfos, use: zypper install glibc-debuginfo-2.22-4.9.1.x86_64 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". warning: the debug information found in "/usr/lib/debug//lib64/libc-2.22.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch). [New Thread 0x7fffec33a700 (LWP 431)] [New Thread 0x7fffebb39700 (LWP 432)] Detaching after fork from child process 433. (recentfiles_tstcase:427): GLib-CRITICAL **: Source ID 105 was not found when attempting to remove it Thread 1 "recentfiles_tst" received signal SIGTRAP, Trace/breakpoint trap. g_logv (log_domain=0x7ffff5ebd4ce "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffc7f8) at gmessages.c:1085 1085 gmessages.c: No such file or directory. (gdb) backtrace
+ Trace 237759
A debugging session is active. Inferior 1 [process 427] will be killed. Quit anyway? (y or n) y Let me know if this is what you needed.
Hah! again. I managed to rebuild gtk2 and glib2 again on Archlinux and preserve the symbols (the default value for `options` in the PKGBUILD silently stripped them even though the debug build was requested. Adding '!strip' fixed the problem. I was able to get a full-backtrace on Arch as well (slightly different) so maybe this will help further: $ G_DEBUG=fatal-warnings gdb ./bin/recentfiles_tstcase GNU gdb (GDB) 8.0 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./bin/recentfiles_tstcase...done. (gdb) run Starting program: /home/david/dev/src-c/ui/gtk/bin/recentfiles_tstcase [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7feb8015b700 (LWP 17994)] (recentfiles_tstcase:17990): GLib-CRITICAL **: Source ID 125 was not found when attempting to remove it Thread 1 "recentfiles_tst" received signal SIGTRAP, Trace/breakpoint trap. _g_log_abort (breakpoint=breakpoint@entry=1) at gmessages.c:549 549 } (gdb) backtrace
+ Trace 237760
A debugging session is active. Inferior 1 [process 17990] will be killed. Quit anyway? (y or n) y Let me know if you need anything else.
Oh... I should've been clear again; I was indicating that you should've been able to download the debug symbols as packages from your distros. :/ But thanks a lot for the effort you made to compile all that, and sorry it was a hassle; hope it was educational at least. :D The traces look great and will hopefully help figure this out. > I installed ALL the debug files on openSuSE and was able to > fill in the missing functions. I don't know why the hours of > gtk+2 and glib2 rebuilds with --enable-debug=yes didn't > produce the same thing, but it didn't. --enable-debug is used for GTK+ specific debugging stuff; it doesn't control any compiler optimisation/debug flags; see https://developer.gnome.org/gtk2/stable/gtk-running.html If you wanted to override the default compiler flags, you would also need to call autogen.sh with the relevant CFLAGS set.
It ended up being simpler than all that. :D I found Javier's commit 96d2eeb6baff70363e1a4510f197d32da7f2df6e in GTK+ 3/4 and can confirm that it fixes this warning. Pushed to gtk-2-24: https://git.gnome.org/browse/gtk+/commit/?h=gtk-2-24&id=491d79d54083044a5de3bfa2d7afe9cced3974f0 Thanks for the report and traces!
(In reply to Daniel Boles from comment #16) > I found Javier's commit 96d2eeb6baff70363e1a4510f197d32da7f2df6e Ahem, Jasper, that is. :)
Daniel, you are the man! Thank you for your help. Now as soon as the new version of 2.24.xx is released, I can re-enable the recent chooser in the toolbar for a little editor project that I've been dabbling with. Arch will have the new version out immediately, but I'll have to rebuild the openSuSE rpm with the new source. It is a good feeling to be able to put a check mark in the FIXED column for this one.
You're welcome. Note that I can't speculate on when a new point release of 2.24 will be made, but it's quite overdue. You might want to agitate for a new release if it doesn't arrive before too long - via the maintainers of your distro might be a good way, as there are quite a few significant fixes since 2.24.31, which they might want. I'd say also that you needn't necessarily let this stop you from using the widget in the meantime: I don't believe this is likely to cause a crash in any case, so as long as you can tolerate - or explain away to your users - this warning, then you're probably good to go already.
As a final note, I built gtk2 again incorporating the patch and it works fine, the error is gone! I'm impatient, so I just went with the rebuild you own route on both Arch and openSuSE :) Thanks again. Now on to my other bug squashing.