After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779605 - GLib-CRITICAL Source ID xxx was not found when attempting to remove it
GLib-CRITICAL Source ID xxx was not found when attempting to remove it
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-03-05 08:55 UTC by David C. Rankin
Modified: 2017-08-07 05:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sourcefile for testcase used to create backtraces (8.39 KB, text/x-csrc)
2017-08-04 05:36 UTC, David C. Rankin
Details

Description David C. Rankin 2017-03-05 08:55:23 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
Comment 1 Daniel Boles 2017-08-04 02:45:17 UTC
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?
Comment 2 David C. Rankin 2017-08-04 04:59:50 UTC
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
  • #0 0x00007f3befca5411 in
  • #1 g_logv
  • #2 g_log
  • #3 g_source_remove
  • #4 0x00007f3bf177301c in
  • #5 0x00007f3bf135d448 in
  • #6 0x00007f3befc9c258 in
  • #7 0x00007f3befc9cd1c in
  • #8 g_main_context_dispatch
  • #9 0x00007f3befc9fc88 in
  • #10 g_main_loop_run
  • #11 gtk_dialog_run
  • #12 open_recent_file
    at recentfiles_tstcase.c line 205
  • #13 g_closure_invoke
  • #14 0x00007f3beff8a4ae in
  • #15 g_signal_emit_valist
  • #16 g_signal_emit_by_name
  • #17 g_closure_invoke
  • #18 0x00007f3beff8a4ae in
  • #19 g_signal_emit_valist
  • #20 g_signal_emit
  • #21 0x00007f3bf1680025 in
  • #22 g_closure_invoke
  • #23 0x00007f3beff8a57e in
  • #24 g_signal_emit_valist
  • #25 g_signal_emit
  • #26 0x00007f3bf167ef89 in
  • #27 0x00007f3bf17247ac in
  • #28 g_closure_invoke
  • #29 0x00007f3beff89f28 in
  • #30 g_signal_emit_valist
  • #31 g_signal_emit
  • #32 0x00007f3bf183c8cc in
  • #33 gtk_propagate_event
  • #34 gtk_main_do_event
  • #35 0x00007f3bf139a46c in
  • #36 g_main_context_dispatch
  • #37 0x00007f3befc9fc88 in
  • #38 g_main_loop_run
  • #39 gtk_main
  • #40 main
    at recentfiles_tstcase.c line 78
  • #0 g_logv
  • #1 g_log
  • #2 g_source_remove
  • #3 0x00007ffff79255fc in
  • #4 0x00007ffff750e2d8 in
  • #5 0x00007ffff5e75e68 in
  • #6 0x00007ffff5e76847 in
  • #7 g_main_context_dispatch
  • #8 0x00007ffff5e79388 in
  • #9 g_main_loop_run
  • #10 gtk_dialog_run
  • #11 open_recent_file
    at recentfiles_tstcase.c line 205
  • #12 0x00007ffff614db37 in
  • #13 g_signal_emit_valist
  • #14 g_signal_emit_by_name
  • #15 0x00007ffff614db37 in
  • #16 g_signal_emit_valist
  • #17 g_signal_emit
  • #18 0x00007ffff78389f5 in
  • #19 g_closure_invoke
  • #20 0x00007ffff615eb37 in
  • #21 g_signal_emit_valist
  • #22 g_signal_emit
  • #23 0x00007ffff7837909 in
  • #24 0x00007ffff78d8b65 in
  • #25 g_closure_invoke
  • #26 0x00007ffff615f0cb in
  • #27 g_signal_emit_valist
  • #28 g_signal_emit
  • #29 0x00007ffff79e8884 in
  • #30 gtk_propagate_event
  • #31 gtk_main_do_event
  • #32 0x00007ffff7549c1c in
  • #33 g_main_context_dispatch
  • #34 0x00007ffff5e79388 in
  • #35 g_main_loop_run
  • #36 gtk_main
  • #37 main
    at recentfiles_tstcase.c line 78
A debugging session is active.

        Inferior 1 [process 14017] will be killed.

Quit anyway? (y or n) y
Comment 3 David C. Rankin 2017-08-04 05:02:42 UTC
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
  • #0 g_logv
  • #1 g_log
  • #2 g_source_remove
  • #3 0x00007ffff79255fc in
  • #4 0x00007ffff750e2d8 in
  • #5 0x00007ffff5e75e68 in
  • #6 0x00007ffff5e76847 in
  • #7 g_main_context_dispatch
  • #8 0x00007ffff5e79388 in
  • #9 g_main_loop_run
  • #10 gtk_dialog_run
  • #11 open_recent_file
    at recentfiles_tstcase.c line 205
  • #12 0x00007ffff614db37 in
  • #13 g_signal_emit_valist
  • #14 g_signal_emit_by_name
  • #15 0x00007ffff614db37 in
  • #16 g_signal_emit_valist
  • #17 g_signal_emit
  • #18 0x00007ffff78389f5 in
  • #19 g_closure_invoke
  • #20 0x00007ffff615eb37 in
  • #21 g_signal_emit_valist
  • #22 g_signal_emit
  • #23 0x00007ffff7837909 in
  • #24 0x00007ffff78d8b65 in
  • #25 g_closure_invoke
  • #26 0x00007ffff615f0cb in
  • #27 g_signal_emit_valist
  • #28 g_signal_emit
  • #29 0x00007ffff79e8884 in
  • #30 gtk_propagate_event
  • #31 gtk_main_do_event
  • #32 0x00007ffff7549c1c in
  • #33 g_main_context_dispatch
  • #34 0x00007ffff5e79388 in
  • #35 g_main_loop_run
  • #36 gtk_main
  • #37 main
    at recentfiles_tstcase.c line 78
A debugging session is active.

        Inferior 1 [process 14017] will be killed.

Quit anyway? (y or n) y
Comment 4 David C. Rankin 2017-08-04 05:07:55 UTC
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.
Comment 5 David C. Rankin 2017-08-04 05:36:22 UTC
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().
Comment 6 David C. Rankin 2017-08-04 05:40:57 UTC
(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.
Comment 7 Daniel Boles 2017-08-04 07:20:17 UTC
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.
Comment 8 David C. Rankin 2017-08-05 03:13:14 UTC
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....
Comment 9 David C. Rankin 2017-08-05 03:51:30 UTC
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
  • #0 0x00007f9d95848411 in
  • #1 g_logv
  • #2 g_log
  • #3 g_source_remove
  • #4 0x00007f9d97341372 in
  • #5 0x00007f9d96efe288 in
  • #6 0x00007f9d9583f258 in
  • #7 0x00007f9d9583fd1c in
  • #8 g_main_context_dispatch
  • #9 0x00007f9d95842c88 in
  • #10 g_main_loop_run
  • #11 gtk_dialog_run
  • #12 open_recent_file
    at recentfiles_tstcase.c line 205
  • #13 g_closure_invoke
  • #14 0x00007f9d95b2d4ae in
  • #15 g_signal_emit_valist
  • #16 g_signal_emit_by_name
  • #17 g_closure_invoke
  • #18 0x00007f9d95b2d4ae in
  • #19 g_signal_emit_valist
  • #20 g_signal_emit
  • #21 0x00007f9d9722dbf5 in
  • #22 g_closure_invoke
  • #23 0x00007f9d95b2d57e in
  • #24 g_signal_emit_valist
  • #25 g_signal_emit
  • #26 0x00007f9d9722c80e in
  • #27 0x00007f9d972e8f0f in
  • #28 g_closure_invoke
  • #29 0x00007f9d95b2cf28 in
  • #30 g_signal_emit_valist
  • #31 g_signal_emit
  • #32 0x00007f9d9741c5a5 in
  • #33 gtk_propagate_event
  • #34 gtk_main_do_event
  • #35 0x00007f9d96f4181e in
  • #36 g_main_context_dispatch
  • #37 0x00007f9d95842c88 in
  • #38 g_main_loop_run
  • #39 gtk_main
  • #40 main
    at recentfiles_tstcase.c line 78
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.
Comment 10 David C. Rankin 2017-08-05 03:55:30 UTC
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.
Comment 11 David C. Rankin 2017-08-05 06:02:35 UTC
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
  • #0 0x00007fe3e2a6c6f2 in
  • #1 g_log_default_handler
  • #2 g_logv
  • #3 g_log
  • #4 0x00007fe3e4184d94 in
  • #5 _XError
  • #6 0x00007fe3e1a4b617 in
  • #7 0x00007fe3e1a4b6d5 in
  • #8 _XReply
  • #9 XQueryPointer
  • #10 0x00007fe3e4193882 in
  • #11 0x00007fe3e413b173 in
  • #12 gdk_window_get_pointer
  • #13 gdk_device_get_state
  • #14 gdk_event_request_motions
  • #15 0x00007fe3e456c3b7 in
  • #16 0x00007fe3e4523f0f in
  • #17 g_closure_invoke
  • #18 0x00007fe3e2d53d5a in
  • #19 g_signal_emit_valist
  • #20 g_signal_emit
  • #21 0x00007fe3e46575a5 in
  • #22 gtk_propagate_event
  • #23 gtk_main_do_event
  • #24 0x00007fe3e417c81e in
  • #25 g_main_context_dispatch
  • #26 0x00007fe3e2a66dd9 in
  • #27 g_main_loop_run
  • #28 gtk_main
  • #29 main
    at recentfiles_tstcase.c line 78
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.
Comment 12 David C. Rankin 2017-08-05 06:08:07 UTC
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
  • #0 0x00007f5d45a696f2 in
  • #1 g_logv
  • #2 g_log
  • #3 g_source_remove
  • #4 0x00007f5d47579372 in
  • #5 0x00007f5d47136288 in
  • #6 0x00007f5d45a602e8 in
  • #7 0x00007f5d45a60dbe in
  • #8 g_main_context_dispatch
  • #9 0x00007f5d45a63dd9 in
  • #10 g_main_loop_run
  • #11 gtk_dialog_run
  • #12 open_recent_file
    at recentfiles_tstcase.c line 205
  • #13 g_closure_invoke
  • #14 0x00007f5d45d51300 in
  • #15 g_signal_emit_valist
  • #16 g_signal_emit_by_name
  • #17 g_closure_invoke
  • #18 0x00007f5d45d51300 in
  • #19 g_signal_emit_valist
  • #20 g_signal_emit
  • #21 0x00007f5d47465bf5 in
  • #22 g_closure_invoke
  • #23 0x00007f5d45d513d8 in
  • #24 g_signal_emit_valist
  • #25 g_signal_emit
  • #26 0x00007f5d4746480e in
  • #27 0x00007f5d47520f0f in
  • #28 g_closure_invoke
  • #29 0x00007f5d45d50d5a in
  • #30 g_signal_emit_valist
  • #31 g_signal_emit
  • #32 0x00007f5d476545a5 in
  • #33 gtk_propagate_event
  • #34 gtk_main_do_event
  • #35 0x00007f5d4717981e in
  • #36 g_main_context_dispatch
  • #37 0x00007f5d45a63dd9 in
  • #38 g_main_loop_run
  • #39 gtk_main
  • #40 main
    at recentfiles_tstcase.c line 78

Thanks for your help. Let me know if there is something further I can provide.
Comment 13 David C. Rankin 2017-08-05 06:19:03 UTC
(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
  • #0 g_logv
    at gmessages.c line 1085
  • #1 g_log
    at gmessages.c line 1119
  • #2 g_source_remove
    at gmain.c line 2284
  • #3 cleanup_after_load
    at gtkrecentchooserdefault.c line 879
  • #4 gdk_threads_dispatch_free
    at gdk.c line 547
  • #5 g_source_callback_unref
    at gmain.c line 1561
  • #6 g_source_destroy_internal
    at gmain.c line 1207
  • #7 g_main_context_dispatch
    at gmain.c line 3177
  • #8 g_main_context_dispatch
    at gmain.c line 3769
  • #9 g_main_context_iterate
    at gmain.c line 3840
  • #10 g_main_loop_run
    at gmain.c line 4034
  • #11 IA__gtk_dialog_run
    at gtkdialog.c line 1094
  • #12 open_recent_file
    at recentfiles_tstcase.c line 206
  • #13 _g_closure_invoke_va
    at gclosure.c line 867
  • #14 g_signal_emit_valist
    at gsignal.c line 3294
  • #15 g_signal_emit_by_name
    at gsignal.c line 3481
  • #16 _g_closure_invoke_va
    at gclosure.c line 867
  • #17 g_signal_emit_valist
    at gsignal.c line 3294
  • #18 g_signal_emit
    at gsignal.c line 3441
  • #19 gtk_real_button_released
    at gtkbutton.c line 1712
  • #23 <emit signal ??? on instance 0x7269e0 [GtkButton]>
    at gsignal.c line 3441
  • #24 gtk_button_button_release
    at gtkbutton.c line 1604
  • #29 <emit signal ??? on instance 0x7269e0 [GtkButton]>
    at gsignal.c line 3441
  • #30 gtk_widget_event_internal
    at gtkwidget.c line 5017
  • #31 IA__gtk_widget_event
    at gtkwidget.c line 4814
  • #32 IA__gtk_propagate_event
    at gtkmain.c line 2501
  • #33 IA__gtk_main_do_event
    at gtkmain.c line 1696
  • #34 gdk_event_dispatch
    at gdkevents-x11.c line 2425
  • #35 g_main_context_dispatch
    at gmain.c line 3154
  • #36 g_main_context_dispatch
    at gmain.c line 3769
  • #37 g_main_context_iterate
    at gmain.c line 3840
  • #38 g_main_loop_run
    at gmain.c line 4034
  • #39 IA__gtk_main
    at gtkmain.c line 1268
  • #40 main
    at recentfiles_tstcase.c line 77
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.
Comment 14 David C. Rankin 2017-08-05 07:18:37 UTC
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
  • #0 _g_log_abort
    at gmessages.c line 549
  • #1 g_logv
    at gmessages.c line 1357
  • #2 g_log
    at gmessages.c line 1398
  • #3 g_source_remove
    at gmain.c line 2357
  • #4 cleanup_after_load
  • #5 gdk_threads_dispatch_free
  • #6 g_source_callback_unref
    at gmain.c line 1566
  • #7 g_source_destroy_internal
    at gmain.c line 1255
  • #8 g_main_dispatch
    at gmain.c line 3258
  • #9 g_main_context_dispatch
    at gmain.c line 3899
  • #10 g_main_context_iterate
    at gmain.c line 3972
  • #11 g_main_loop_run
    at gmain.c line 4168
  • #12 gtk_dialog_run
  • #13 open_recent_file
    at recentfiles_tstcase.c line 205
  • #17 <emit signal 0x7feb88520818 "clicked" on instance 0x1002d3110 [GtkMenuToolButton]>
    at gsignal.c line 3487
  • #21 <emit signal ??? on instance 0x1002c71c0 [GtkButton]>
    at gsignal.c line 3447
  • #22 gtk_real_button_released.part
  • #26 <emit signal ??? on instance 0x1002c71c0 [GtkButton]>
    at gsignal.c line 3447
  • #27 gtk_button_button_release
  • #28 _gtk_marshal_BOOLEAN__BOXED
  • #32 <emit signal ??? on instance 0x1002c71c0 [GtkButton]>
    at gsignal.c line 3447
  • #33 gtk_widget_event_internal
  • #34 gtk_propagate_event
  • #35 gtk_main_do_event
  • #36 gdk_event_dispatch
  • #37 g_main_dispatch
    at gmain.c line 3234
  • #38 g_main_context_dispatch
    at gmain.c line 3899
  • #39 g_main_context_iterate
    at gmain.c line 3972
  • #40 g_main_loop_run
    at gmain.c line 4168
  • #41 gtk_main
  • #42 main
    at recentfiles_tstcase.c line 78
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.
Comment 15 Daniel Boles 2017-08-05 08:44:32 UTC
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.
Comment 16 Daniel Boles 2017-08-05 18:25:48 UTC
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!
Comment 17 Daniel Boles 2017-08-05 19:12:07 UTC
(In reply to Daniel Boles from comment #16)
> I found Javier's commit 96d2eeb6baff70363e1a4510f197d32da7f2df6e

Ahem, Jasper, that is. :)
Comment 18 David C. Rankin 2017-08-06 07:39:23 UTC
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.
Comment 19 Daniel Boles 2017-08-06 11:20:06 UTC
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.
Comment 20 David C. Rankin 2017-08-07 05:14:51 UTC
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.