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 318797 - gnome-terminal crashes if you start too many too quickly
gnome-terminal crashes if you start too many too quickly
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
2.13.x
Other Linux
: High critical
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
: 329700 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-10-13 20:21 UTC by Sebastien Bacher
Modified: 2006-03-04 06:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
fix crash (hopefully) (611 bytes, patch)
2006-02-18 10:54 UTC, Jeff
none Details | Review
bigger, better, badder (852 bytes, patch)
2006-02-18 20:55 UTC, Jeff
committed Details | Review

Description Sebastien Bacher 2005-10-13 20:21:36 UTC
This bug has been opened here: https://bugzilla.ubuntu.com/show_bug.cgi?id=17247

"I was trying to find a reliable way to reproduce bug 17137.  It only seems to
happen when the window list at the bottom is full.  So I decided to run a few
gnome-terminals to fill it up.

I often run terminals, so I have put an icon on the top panel to allow me to run
them easily.  I started with nothing showing in the window list at all and then
clicked the gnome-terminal icon on my top panel 4 times quickly - like a double
click on the mouse, only 4 of them, really quite fast.  Only 3 of the 4 windows
I requested appeared, and then I heard a clunking noise and saw a dialog telling
me that "The Application "gnome-terminal" has quit unexpectedly.  I told it to
close, and the 3 windows all disappeared.

This doesn't happen every time I try it, but about 1 in 10 times it does.  I
compiled gnome-terminal from the sources so I could bring you a stack trace.  I
waited for gnome-terminal to crash, then attached to it with gdb which the
dialog telling me that it had crashed was still displayed.

The processes running at the time looked like this:

UID        PID  PPID  C STIME TTY          TIME CMD
chris    32763     1  0 17:14 ?        00:00:00 sh -c cd
/home/chris/src/gnome-terminal/gnome-terminal-2.12.0/src; ./gnome-terminal
chris    32764 32763  0 17:14 ?        00:00:00 ./gnome-terminal
chris      340 32764  0 17:14 ?        00:00:00 /usr/lib/libgnomeui-0/gnome_segv
gnome-terminal 11 2.12.0

I attached to the process like this: "gdb ./gnome-terminal 32764"

And saw this stack trace:

  • #0 __kernel_vsyscall
  • #1 __waitpid_nocancel
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 libgnomeui_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #3 <signal handler called>
  • #4 option_parsing_results_init
    at terminal.c line 1232
  • #5 handle_new_terminal_events
    at terminal.c line 3661
  • #6 bonobo_marshal_VOID__STRING_BOXED_BOXED
    from /usr/lib/libbonobo-2.so.0
  • #7 IA__g_closure_invoke
    at gclosure.c line 492
  • #8 bonobo_closure_invoke_va_list
    from /usr/lib/libbonobo-2.so.0
  • #9 bonobo_closure_invoke
    from /usr/lib/libbonobo-2.so.0
  • #10 bonobo_listener_get_type
    from /usr/lib/libbonobo-2.so.0
  • #11 _ORBIT_skel_small_Bonobo_Listener_event
    from /usr/lib/libbonobo-2.so.0
  • #12 ORBit_POA_setup_root
    from /usr/lib/libORBit-2.so.0
  • #13 ORBit_OAObject_invoke
    from /usr/lib/libORBit-2.so.0
  • #14 ORBit_small_invoke_adaptor
    from /usr/lib/libORBit-2.so.0
  • #15 ORBit_POAObject_post_invoke
    from /usr/lib/libORBit-2.so.0
  • #16 ORBit_POAObject_post_invoke
    from /usr/lib/libORBit-2.so.0
  • #17 ORBit_c_stub_invoke
    from /usr/lib/libORBit-2.so.0
  • #18 ORBit_handle_request
    from /usr/lib/libORBit-2.so.0
  • #19 giop_connection_handle_input
    from /usr/lib/libORBit-2.so.0
  • #20 link_connection_set_max_buffer
    from /usr/lib/libORBit-2.so.0
  • #21 link_servers_move_io_T
    from /usr/lib/libORBit-2.so.0
  • #22 IA__g_main_context_dispatch
    at gmain.c line 1934
  • #23 g_main_context_iterate
    at gmain.c line 2565
  • #24 IA__g_main_context_iteration
    at gmain.c line 2624
  • #25 link_main_iteration
    from /usr/lib/libORBit-2.so.0
  • #26 giop_recv_buffer_get
    from /usr/lib/libORBit-2.so.0
  • #27 ORBit_small_invoke_stub
    from /usr/lib/libORBit-2.so.0
  • #28 ORBit_small_invoke_stub_n
    from /usr/lib/libORBit-2.so.0
  • #29 ORBit_c_stub_invoke
    from /usr/lib/libORBit-2.so.0
  • #30 Accessibility_EventListener_notifyEvent
    from /usr/lib/libspi.so.0
  • #31 gnome_accessibility_module_shutdown
    from /usr/lib/gtk-2.0/modules/libatk-bridge.so
  • #32 gnome_accessibility_module_shutdown
    from /usr/lib/gtk-2.0/modules/libatk-bridge.so
  • #33 signal_emit_unlocked_R
    at gsignal.c line 2451
  • #34 IA__g_signal_emit_valist
    at gsignal.c line 2244
  • #35 IA__g_signal_emit
    at gsignal.c line 2288
  • #36 atk_object_initialize
    from /usr/lib/libatk-1.0.so.0
  • #37 IA__g_cclosure_marshal_VOID__PARAM
    at gmarshal.c line 531
  • #38 g_type_class_meta_marshal
    at gclosure.c line 569
  • #39 IA__g_closure_invoke
    at gclosure.c line 492
  • #40 signal_emit_unlocked_R
    at gsignal.c line 2415
  • #41 IA__g_signal_emit_valist
    at gsignal.c line 2244
  • #42 IA__g_signal_emit
    at gsignal.c line 2288
  • #43 g_object_dispatch_properties_changed
    at gobject.c line 557
  • #44 g_object_notify_dispatcher
    at gobject.c line 238
  • #45 IA__g_object_notify
    at gobjectnotifyqueue.c line 123
  • #46 atk_object_set_parent
    from /usr/lib/libatk-1.0.so.0
  • #47 gail_toplevel_new
    from /usr/lib/gtk-2.0/modules/libgail.so
  • #48 signal_emit_unlocked_R
    at gsignal.c line 2451
  • #49 IA__g_signal_emit_valist
    at gsignal.c line 2244
  • #50 IA__g_signal_emit
    at gsignal.c line 2288
  • #51 gtk_widget_show
    from /usr/lib/libgtk-x11-2.0.so.0
  • #52 gtk_window_present_with_time
    from /usr/lib/libgtk-x11-2.0.so.0
  • #53 gtk_window_present
    from /usr/lib/libgtk-x11-2.0.so.0
  • #54 terminal_app_new_terminal
    at terminal.c line 1980
  • #55 new_terminal_with_options
    at terminal.c line 1432
  • #56 handle_new_terminal_events
    at terminal.c line 3693
  • #57 bonobo_marshal_VOID__STRING_BOXED_BOXED
    from /usr/lib/libbonobo-2.so.0
  • #58 IA__g_closure_invoke
    at gclosure.c line 492
  • #59 bonobo_closure_invoke_va_list
    from /usr/lib/libbonobo-2.so.0
  • #60 bonobo_closure_invoke
    from /usr/lib/libbonobo-2.so.0
  • #61 bonobo_listener_get_type
    from /usr/lib/libbonobo-2.so.0
  • #62 _ORBIT_skel_small_Bonobo_Listener_event
    from /usr/lib/libbonobo-2.so.0
  • #63 ORBit_POA_setup_root
    from /usr/lib/libORBit-2.so.0
  • #64 ORBit_OAObject_invoke
    from /usr/lib/libORBit-2.so.0
  • #65 ORBit_small_invoke_adaptor
    from /usr/lib/libORBit-2.so.0
  • #66 ORBit_POAObject_post_invoke
    from /usr/lib/libORBit-2.so.0
  • #67 ORBit_POAObject_post_invoke
    from /usr/lib/libORBit-2.so.0
  • #68 ORBit_c_stub_invoke
    from /usr/lib/libORBit-2.so.0
  • #69 ORBit_handle_request
    from /usr/lib/libORBit-2.so.0
  • #70 giop_connection_handle_input
    from /usr/lib/libORBit-2.so.0
  • #71 link_connection_set_max_buffer
    from /usr/lib/libORBit-2.so.0
  • #72 link_servers_move_io_T
    from /usr/lib/libORBit-2.so.0
  • #73 IA__g_main_context_dispatch
    at gmain.c line 1934
  • #74 g_main_context_iterate
    at gmain.c line 2565
  • #75 IA__g_main_loop_run
    at gmain.c line 2769
  • #76 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #77 main
    at terminal.c line 1770

I notice that no matter how many gnome-terminals you run, there's only one
process.  Perhaps starting 2 "at the same time" triggers a race condition."
Comment 1 Fabio Bonelli 2006-02-03 09:35:54 UTC
*** Bug 329700 has been marked as a duplicate of this bug. ***
Comment 2 Fabio Bonelli 2006-02-03 09:38:25 UTC
Confirming, I can reproduce this bug with gnome-terminal 2.13.90 as well.
Comment 3 Sebastien Bacher 2006-02-04 15:57:14 UTC
Can we target that bug for that cycle? The crash happens quite often (got several people from the Ubuntu distro team facing it today), is easy to reproduce and is pretty annoying since it crash all your running jobs with it
Comment 4 Jeff 2006-02-18 10:53:27 UTC
I am seeing the bug in 2.13.91.

It looks like handle_new_terminal_events couldn't cope with being called recursively. this was happening because someone recently added a call to some gconf stuff in get_child_environment.  gconf uses bonobo too, so bonobo was taking the opportunity to deliver any backlogged "new_terminal" requests.

I'll attach a patch that fixes.
For the future, can no longer assume that terminal_new_event won't be called recursively.
Comment 5 Jeff 2006-02-18 10:54:24 UTC
Created attachment 59633 [details] [review]
fix crash (hopefully)

this is my fix apply to CVS head
Comment 6 Guilherme de Siqueira Pastore 2006-02-18 14:18:13 UTC
Thanks for your work! =)
I'll be reviewing this in a few moments.
Comment 7 Guilherme de Siqueira Pastore 2006-02-18 19:27:25 UTC
Makes me wonder... ok, it doesn't freeze anymore, but doesn't fix the problem either (i.e. only one g-t will be launched).
Comment 8 Jeff 2006-02-18 20:55:57 UTC
Created attachment 59670 [details] [review]
bigger, better, badder

You're right -- I missed the difference between having 100 terminals open and 99 terminals open....
Comment 9 Guilherme de Siqueira Pastore 2006-03-04 06:08:45 UTC
Now the problem's fixed! Thank you very much! =)