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 673529 - zenity 3.4.0 dumps core when called with --list option
zenity 3.4.0 dumps core when called with --list option
Status: RESOLVED FIXED
Product: zenity
Classification: Core
Component: general
3.8.x
Other Linux
: High critical
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
: 675830 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-04-04 19:16 UTC by korobkin+lpad
Modified: 2014-05-20 13:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix segmentation fault (1.27 KB, patch)
2012-04-17 19:53 UTC, Arx Cruz
none Details | Review
patch for busy loop (1.42 KB, patch)
2012-05-08 20:15 UTC, Julian Taylor
none Details | Review

Description korobkin+lpad 2012-04-04 19:16:46 UTC
Hi, 

This is zenity 3.4.0 rebuilt with symbols, running with this command line on Ubuntu 12.04 x64:

/usr/bin/zenity --list --text "Will Zenity dump core?" --radiolist --column "Click Here" --column "Answer" FALSE Yes FALSE No

Here is a stack trace from gdb: 


(gdb) file zenity
Reading symbols from /usr/bin/zenity...done.
(gdb) set args --list --text "Will Zenity dump core?" --radiolist --column "Click Here" --column "Answer" FALSE Yes FALSE No
(gdb) show args
Argument list to give program being debugged when it is started is "--list --text "Will Zenity dump core?" --radiolist --column "Click Here" --column "Answer" FALSE Yes FALSE No".
(gdb) run
Starting program: /usr/bin/zenity --list --text "Will Zenity dump core?" --radiolist --column "Click Here" --column "Answer" FALSE Yes FALSE No
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe9204700 (LWP 14972)]
[New Thread 0x7fffe8a03700 (LWP 14973)]
No

Program received signal SIGSEGV, Segmentation fault.
0x000000000040fb21 in zenity_tree_dialog_response (widget=0x781010, response=-5, data=0x76f040) at tree.c:648
648	  if (channel->is_readable == TRUE)
(gdb) bt
  • #0 zenity_tree_dialog_response
    at tree.c line 648
  • #1 g_closure_invoke
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #2 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #3 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #4 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #5 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #6 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #7 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #8 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #9 g_closure_invoke
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #10 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #11 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #12 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #13 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #14 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #15 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #16 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #17 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #18 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #19 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #20 gtk_main_do_event
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #21 ??
    from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
  • #22 g_main_context_dispatch
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #23 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #24 g_main_loop_run
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #25 gtk_main
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #26 zenity_tree
    at tree.c line 525
  • #27 main
    at main.c line 76

libc6 version: 2.15-0ubuntu6
libgdk-pixbuf2.0-0 version: 2.26.0-1
libglib2.0-0 version: 2.32.0-0ubuntu1
libgtk-3-0 version: 3.4.0-0ubuntu1
libnotify4 version: 0.7.5-1
libpango1.0-0 version: 1.30.0-0ubuntu1
libwebkitgtk-3.0-0 version: 1.8.0-0ubuntu2
libx11-6 version: 2:1.4.99.1-0ubuntu2
zenity-common version: 3.4.0-0ubuntu1

Let me know please if more info is needed.
Comment 1 André Klapper 2012-04-05 09:07:42 UTC
Thanks for taking the time to report this bug.
Unfortunately, that stack trace is missing some elements that will help a lot to solve the problem, so it will be hard for the developers to fix that crash. Can you get us a stack trace with debugging symbols by installing debug packages for (lib)glib2 and (lib)gtk3? Please see http://live.gnome.org/GettingTraces for more information on how to do so and reopen this bug or report a new one. Thanks in advance!
Comment 2 Arx Cruz 2012-04-10 13:26:20 UTC
I wasn' t able to reproduce this error. I just compile zenity from git using libgtk 3.4.0-0ubuntu3~oneiric1 package, and everything works as expected. Which version of ubuntu are you using? Perhaps is something wrong with this gtk/zenity version/package...
Comment 3 André Klapper 2012-04-11 17:50:13 UTC
NEEDINFO status as per last comment
Comment 4 korobkin+lpad 2012-04-11 18:06:51 UTC
Hi all, 

here is a new stack trace with libglib2.0-0-dbg and libgtk-3-0-dbg. 
Same commands were used. hth. 

(gdb) bt
  • #0 zenity_tree_dialog_response
    at tree.c line 648
  • #1 g_closure_invoke
    at /build/buildd/glib2.0-2.32.0/./gobject/gclosure.c line 777
  • #2 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.32.0/./gobject/gsignal.c line 3547
  • #3 g_signal_emit_valist
    at /build/buildd/glib2.0-2.32.0/./gobject/gsignal.c line 3296
  • #4 g_signal_emit
    at /build/buildd/glib2.0-2.32.0/./gobject/gsignal.c line 3352
  • #5 _g_closure_invoke_va
    at /build/buildd/glib2.0-2.32.0/./gobject/gclosure.c line 840
  • #6 g_signal_emit_valist
    at /build/buildd/glib2.0-2.32.0/./gobject/gsignal.c line 3207
  • #7 g_signal_emit
    at /build/buildd/glib2.0-2.32.0/./gobject/gsignal.c line 3352
  • #8 gtk_real_button_released
    at /build/buildd/gtk+3.0-3.4.0/./gtk/gtkbutton.c line 2007
  • #9 g_closure_invoke
    at /build/buildd/glib2.0-2.32.0/./gobject/gclosure.c line 777
  • #10 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.32.0/./gobject/gsignal.c line 3477
  • #11 g_signal_emit_valist
    at /build/buildd/glib2.0-2.32.0/./gobject/gsignal.c line 3296
  • #12 g_signal_emit
    at /build/buildd/glib2.0-2.32.0/./gobject/gsignal.c line 3352
  • #13 gtk_button_button_release
    at /build/buildd/gtk+3.0-3.4.0/./gtk/gtkbutton.c line 1842
  • #14 gtk_button_button_release
  • #15 _gtk_marshal_BOOLEAN__BOXEDv
    at /build/buildd/gtk+3.0-3.4.0/./gtk/gtkmarshalers.c line 130
  • #16 _g_closure_invoke_va
    at /build/buildd/glib2.0-2.32.0/./gobject/gclosure.c line 840
  • #17 g_signal_emit_valist
    at /build/buildd/glib2.0-2.32.0/./gobject/gsignal.c line 3207
  • #18 g_signal_emit
    at /build/buildd/glib2.0-2.32.0/./gobject/gsignal.c line 3352
  • #19 gtk_widget_event_internal
    at /build/buildd/gtk+3.0-3.4.0/./gtk/gtkwidget.c line 6380
  • #20 propagate_event_up
    at /build/buildd/gtk+3.0-3.4.0/./gtk/gtkmain.c line 2404
  • #21 propagate_event
  • #22 gtk_main_do_event
    at /build/buildd/gtk+3.0-3.4.0/./gtk/gtkmain.c line 1717
  • #23 gdk_event_source_dispatch
    at /build/buildd/gtk+3.0-3.4.0/./gdk/x11/gdkeventsource.c line 358
  • #24 g_main_dispatch
    at /build/buildd/glib2.0-2.32.0/./glib/gmain.c line 2515
  • #25 g_main_context_dispatch
    at /build/buildd/glib2.0-2.32.0/./glib/gmain.c line 3052
  • #26 g_main_context_iterate
    at /build/buildd/glib2.0-2.32.0/./glib/gmain.c line 3123
  • #27 g_main_context_iterate
    at /build/buildd/glib2.0-2.32.0/./glib/gmain.c line 3060
  • #28 g_main_loop_run
    at /build/buildd/glib2.0-2.32.0/./glib/gmain.c line 3317
  • #29 gtk_main
    at /build/buildd/gtk+3.0-3.4.0/./gtk/gtkmain.c line 1165
  • #30 zenity_tree
    at tree.c line 525
  • #31 main
    at main.c line 76

Comment 5 Arx Cruz 2012-04-17 19:53:04 UTC
Created attachment 212236 [details] [review]
Fix segmentation fault

I wasn't able to reproduce the bug in my machine, however, I verify that the code was using channel->is_readable which isn't the correct way.
Comment 6 Arx Cruz 2012-04-17 19:53:51 UTC
Korobkin,

Can you please apply this patch and verify if will still get the segmentation fault?
Comment 7 korobkin+lpad 2012-04-17 20:14:30 UTC
Thanks, no segfaults with the patch!
Comment 8 Arx Cruz 2012-04-19 14:33:23 UTC
Cool. the patch is already applied on master. I'm closing this bug.
Thanks for open the bug.
Comment 9 Julian Taylor 2012-05-08 20:05:32 UTC
the fix for this causes endless loops
see: https://bugs.launchpad.net/ubuntu/+source/zenity/+bug/995435

you must mask the result of g_io_channel_get_flags not just compare for equality as more than one can be set (in this case is_seekable.

e.g. if(g_io_channel_get_flags(channel) & G_IO_FLAG_IS_READABLE)



  • #4 zenity_tree_handle_stdin
    at tree.c line 123
$2 = {
  ref_count = 2, 
  funcs = 0x7ffff6e1abc0, 
  encoding = 0x0, 
  read_cd = 0xffffffffffffffff, 
  write_cd = 0xffffffffffffffff, 
  line_term = 0x0, 
  line_term_len = 0, 
  buf_size = 1024, 
  read_buf = 0x0, 
  encoded_read_buf = 0x0, 
  write_buf = 0x0, 
  partial_write_buf = "\000\000\000\000\000", 
  use_buffer = 1, 
  do_encode = 0, 
  close_on_unref = 0, 
  is_readable = 1, 
  is_writeable = 0, 
  is_seekable = 1, 
  reserved1 = 0x0, 
  reserved2 = 0x0
}
(gdb) p (int)G_IO_FLAG_IS_READABLE
$4 = 4
(gdb) p g_io_channel_get_flags(channel)
$5 = 22
Comment 10 Julian Taylor 2012-05-08 20:15:51 UTC
Created attachment 213706 [details] [review]
patch for busy loop

attached a patch against git head that fixes the issue for me
Comment 11 Arx Cruz 2012-05-08 20:30:57 UTC
Thanks for the patch. It's already applied in the master.
Comment 12 Arx Cruz 2012-05-10 20:09:26 UTC
*** Bug 675830 has been marked as a duplicate of this bug. ***
Comment 13 Alkis Georgopoulos 2013-12-14 15:48:30 UTC
The endless loop with 100% CPU usage is still happening here in Ubuntu Trusty with Zenity 3.8.0-1.

Just run:

$ zenity --list --column X </dev/null

...and try to close Zenity, it won't close but stderr will be full of those:

(zenity:26465): GLib-WARNING **: /build/buildd/glib2.0-2.39.1/./glib/giounix.c:412Error while getting flags for FD: Bad file descriptor (9)
Comment 14 Alkis Georgopoulos 2013-12-14 16:19:14 UTC
In the patch sent by Julian, I tried adding a sleep:

    while ((g_io_channel_get_flags(channel) & G_IO_FLAG_IS_READABLE) != G_IO_FLAG_IS_READABLE)
+        g_usleep(1000000);
      ;

...and after compiling and running:

$ zenity --list --column X </dev/null

...I only got one message per second on stderr, so I guess that "while" needs to also check if "channel" is a valid descriptor.
Comment 15 Alkis Georgopoulos 2013-12-17 21:08:19 UTC
Could someone with enough rights change the bug status to *REOPENED*?

The fix for the initial problem caused an endless loop regression, and the patch by Julian doesn't eliminate all the cases where the endless loop happens.

Please reopen the bug report until the loop that I mentioned in comment #14 also checks if the file descriptor is valid.

In real life use, the endless loops happens about once per hour in a classroom of 10 students working with scratch/squeak (the squeak launcher calls zenity), and it's causing 100% CPU usage even after the zenity window is closed with xkill, so the students then complain that their workstation is too slow and the teacher needs to reboot it.
Comment 16 André Klapper 2013-12-17 22:37:01 UTC
I can confirm comment 13 on Fedora 20.
Comment 17 Arx Cruz 2014-04-18 20:35:14 UTC
Is it possible for you guys check the latest git code? I've tested here and it's working. I also test the Fedora 20, and the version shipped have this problem. I will release a new tarball soon with all the fixes, but meanwhile, I would like you guys to check the master instead of the version shipped with ubuntu and fedora.
Comment 18 Alkis Georgopoulos 2014-04-21 08:12:50 UTC
I could not reproduce comment 13 with the latest git code, there's no problem there.
I can reproduce it in the latest version shipped with Ubuntu.

Thanks, please release the new tarball.
Comment 19 Arx Cruz 2014-05-20 13:58:15 UTC
There's a new zenity tarball (3.12.1) who fix this problem, and a new one is on the way.
I'm closing this bug.