gnome-terminal aborts if too many windows opened
Submitted by devsk
Link to original bug (#123526)
Description
I had a lot of windows and tabs open. Then I tried to open a new one and there went my gnome-terminal taking down all my thousands(OK, tens...) of windows.
relevant stack is attached.
`#6` 0x32ae0 in show_fork_error_dialog (screen=0xc2aa18, err=0x0)
at terminal-screen.c:789
`#7` 0x33378 in terminal_screen_launch_child (screen=0xc2aa18)
at terminal-screen.c:994
`#8` 0x25a14 in new_terminal_with_options ()
`#9` 0x26420 in handle_new_terminal_event ()
`#10` 0x25044 in handle_new_terminal_events ()
`#11` 0xef3b4c20 in bonobo_marshal_VOID__STRING_BOXED_BOXED ()
--------------------------
Reason: Unimplemented code allowed to crash the g-t. g-t asks vte to fork another child with a (GError **)NULL to be assigned by terminal_widget_fork_command(). It never sets it, never passes it to VTE(VTE is supposed to know about the actual error, so it should support that argument, but it doesn't). The result: crash at terminal-screen.c:789 if fork command failed for some reason(like max threads reached or too many files open).
attached patch doesn't try to create a new GError because I don't think anybody has worked on the domains and error codes as strictly as glib would like. It just gets rid of the sigsegv and displays a simple one line message.
Also included in the patch is a performance bugfix which I have talked
about in bug #122656
but nobody seems to care about. Every time a button is
clicked, we don't need to match all stored patterns. We should match only
if required i.e. if CTRL is pressed or 3rd button is pressed. It
dramatically improved selection performance on systems where regex library
is slow.
Version: 2.4.x
Resolution: RESOLVED FIXED