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 117945 - vte hangs often when using screen
vte hangs often when using screen
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.11.x
Other other
: High major
: ---
Assigned To: VTE Maintainers
VTE Maintainers
: 138866 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-07-19 21:26 UTC by Jon Nelson
Modified: 2008-11-26 12:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jon Nelson 2003-07-20 23:00:00 UTC
Distribution: Unknown
Package: vte
Severity: major
Version: GNOME2.3.4 0.11.x
Gnome-Distributor: GNOME.Org
Synopsis: vte hangs often
Bugzilla-Product: vte
Bugzilla-Component: VteTerminal
Bugzilla-Version: 0.11.x
Description:
Description of the crash:

gnome-terminal (by way of vte) hangs often.
One such means is to ssh to a host and run pine.
Eventually (it seems after a limited amount of inactivity at the
keyboard), gnome-terminal will hang.

I ran gdb on gnome-terminal, and this is what I've got:

0x40bf27d1 in g_array_maybe_expand () from /usr/lib/libglib-2.0.so.0
(gdb) 
Single stepping until exit from function g_array_maybe_expand, 
which has no line number information.
0x40bf1fda in g_array_sized_new () from /usr/lib/libglib-2.0.so.0
(gdb) 
Single stepping until exit from function g_array_sized_new, 
which has no line number information.
0x405f341e in vte_new_row_data_sized () from /usr/lib/libvte.so.4
(gdb) 
Single stepping until exit from function vte_new_row_data_sized, 
which has no line number information.
0x405f61b0 in vte_insert_line_internal () from /usr/lib/libvte.so.4
(gdb) 
Single stepping until exit from function vte_insert_line_internal, 
which has no line number information.
0x405f84cf in vte_sequence_handler_sf () from /usr/lib/libvte.so.4
(gdb) 
Single stepping until exit from function vte_sequence_handler_sf, 
which has no line number information.



and it's hung at vte_sequence_handler_sf.








0x405f84cf in vte_sequence_handler_sf () from /usr/lib/libvte.so.4
(gdb) 
Single stepping until exit from function vte_sequence_handler_sf, 
which has no line number information.




------- Bug moved to this database by unknown@bugzilla.gnome.org 2003-07-20 19:00 -------

Reassigning to the default owner of the component, nalin@redhat.com.

Comment 1 Jon Nelson 2003-08-25 03:51:56 UTC
I'd like the priority of this bug to be stepped up.
It severely limits my ability to get work done, and it happens very
very easily.  When I use xterm, I have never run into a similar
problem, but when I use gnome-terminal (latest as of today, but always
latest as of end-of-day) I run into the bug perhaps a dozen or more
times in a 2-3 hour session.  Pine seems to be the easiest way to
trigger the bug, especially involving highlighted text and fast scrolling.

Comment 2 Fernando Herrera 2004-02-12 09:08:38 UTC
Is this still happening with 2.4/2.5 series?
Comment 3 Jon Nelson 2004-02-12 14:35:23 UTC
Yes.  It doesn't seem to be happening as often, but many times I've
recognized the "signs" that it's about to weird out and I take action.

Here's what I do:

I notice that much of the terminal is "missing" (completely black).
I use 'screen' very frequently, and running the "redisplay" command
sometimes, but not always, fixes it.  This usually happens when
viewing a message index in pine and scrolling up or down using the
arrow keys, and scrolling very fast.  When it goes to a new "page" I
get this behavior.  When the terminal starts doign the "not painting"
thing more frequently, I know there is a very good chance it will hang
shortly.  What's odd here is that if I exit pine and start it up
again, things work fine for a while again.  Pine just uses curses, and
I can run pine for *weeks* at a time in an xterm without other
problems, so the blame must lie with vte and/or gnome-terminal.  My
basic debugging efforts short that it's in vte, however.

What would you like me to do?  I'd *love* to have this bug resolved. 
I am positive it is related to the "not painting" behavior I see.
Comment 4 Fernando Herrera 2004-02-12 14:48:58 UTC
Yes, I've tried gnome-terminal with screen, and it usually screws up,
I didn't get any crash, because I switched
gnome-teminal -> ssh -> screen -> 3 shells to:
gnome-terminal -> tab -> ssh 
               -> tab -> ssh
               -> tab -> ssh 

But this is not a solution, so marking high priority.
BTW if you can gdb gnome-terminal with debuggins symbols and source
code, you'll get a more usefull stack trace. If so, please, attach it
here.
Comment 5 Jon Nelson 2004-02-15 03:15:01 UTC
Here's another stack trace.

  • #0 memcpy
    from /lib/libc.so.6
  • #1 g_array_append_vals
    at garray.c line 140
  • #2 vte_g_array_fill
    at vte.c line 497
  • #3 vte_new_row_data_sized
    at vte.c line 523
  • #4 vte_terminal_ensure_cursor
    at vte.c line 2822
  • #5 vte_terminal_insert_char
    at vte.c line 6469
  • #6 vte_terminal_process_incoming
    at vte.c line 7185
  • #7 g_timeout_dispatch
    at gmain.c line 3125
  • #8 g_main_dispatch
    at gmain.c line 1752
  • #9 g_main_context_dispatch
    at gmain.c line 2300
  • #10 g_main_context_iterate
    at gmain.c line 2381
  • #11 g_main_loop_run
    at gmain.c line 2601
  • #12 gtk_main
    at gtkmain.c line 1171
  • #13 main
    at terminal.c line 1669

Comment 6 Jorge Castro 2004-02-26 16:27:55 UTC
Reporter has provided good information, marking NEW to move this forward.
Comment 7 Eric Hopper 2004-05-23 16:48:22 UTC
This bug reported against gnome-terminal is a duplicate of this bug.  It also
has a stack trace in the comments.

http://bugzilla.gnome.org/show_bug.cgi?id=140289
Comment 8 Eric Hopper 2004-09-09 03:49:58 UTC
Another couple of stack traces...

Fedora Core 2:
% rpm -q gnome-terminal vte
gnome-terminal-2.6.0-2
vte-0.11.10-5.1

-----------------------

  • #0 g_array_sort_with_data
    from /usr/lib/libglib-2.0.so.0
  • #1 g_array_append_vals
    from /usr/lib/libglib-2.0.so.0
  • #2 vte_g_array_fill
    at vte.c line 498
  • #3 vte_new_row_data_sized
    at vte.c line 524
  • #4 vte_insert_line_internal
    at vte.c line 2001
  • #5 vte_sequence_handler_delete_lines
    at vte.c line 5130
  • #6 vte_terminal_handle_sequence
    at vte.c line 6657
  • #7 vte_terminal_process_incoming
    at vte.c line 7117
  • #8 g_main_context_wakeup
    from /usr/lib/libglib-2.0.so.0
  • #9 g_main_depth
    from /usr/lib/libglib-2.0.so.0
  • #10 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #11 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #12 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #13 gtk_message_dialog_get_type
    from /usr/lib/libgtk-x11-2.0.so.0
  • #14 ??
  • #15 ??
  • #16 ??
    from /usr/lib/libglib-2.0.so.0
  • #17 ??

-----------------------

Going after it with gdb tells me that it's stuck in this loop....

In vte.c in the function vte_insert_line_internal:

	/* Pad out the line data to the insertion point. */
	while (_vte_ring_next(terminal->pvt->screen->row_data) < position) {
		row = vte_new_row_data_sized(terminal, TRUE);
		_vte_ring_append(terminal->pvt->screen->row_data, row);
	}

(gdb) print terminal->pvt->screen->row_data->delta +
terminal->pvt->screen->row_data->length
$7 = 515507842
(gdb) print position
$8 = 543584853

Somehow, position ended up being somewhere upwards of 518 * 2^20.  And that
seems rather large.  I'm not sure how much scrollback I have, but it's
definitely not more than 2000 lines.

Of course, I'm not sure what position means there.
Comment 9 Eric Hopper 2004-09-09 04:03:33 UTC
More stuff....

vte.c: vte_terminal_handle_sequence

It calls g_tree_lookup to get a handler function.

Then if it found one, it does:

		handler(terminal, match_s, match, params);

(gdb) print terminal, match_s, match, params
$15 = (GValueArray *) 0x89cb8f8
(gdb) print terminal
$16 = (VteTerminal *) 0x8a869c8
(gdb) print match_s
$17 = 0x86b31d8 "delete-lines"
(gdb) print match
$18 = 917
(gdb) print params
$19 = (GValueArray *) 0x89cb8f8
(gdb) print params[0]
$20 = {n_values = 144492004, values = 0x0, n_prealloced = 0}
(gdb) down
  • #1 vte_sequence_handler_delete_lines
    at vte.c line 5130

So, the arguments the handler function gets are not exactly the same as were
passed in.  Of course, that could be the optimizer's doing.  I caught the
function after it had been running a good long while.

Anyway, enough debugging unless I actually have a patch to submit.
Comment 10 Sebastien Bacher 2005-01-16 20:49:12 UTC
*** Bug 138866 has been marked as a duplicate of this bug. ***
Comment 11 Kalle Raiskila 2005-07-15 09:32:53 UTC
I'm using vte as a component in my own program (http://yaog.sf.net/), and I
constantly get a similar freeze. I noted that it appears when the
vte_terminal_feed_child-function has been called. 
If I commented out the call to vte_terminal_feed_child, vte doesn't hang.
Input from keyboard doesn't hang vte. Vte does not consume the CPU when hung.
The child process still works, it just doesn't get anything from its stdin.
I've seen this on RHEL 3 and 4, a Debian, a generic GNU and MacOSX.

HTH, Kalle
Comment 12 Mike Lundy 2005-08-05 06:33:26 UTC
As much as I hate to "me too", I'm seeing this same behavior with vte-0.11.13-r2
and xfce terminal 0.2.4 from gentoo. It's happened quite a few times. The
terminal tab stops paying attention to stdin. I know it's not completely frozen
because i can send a "wall" message that shows up. This has only ever happened
when I'm connected over ssh. That's about half the time I'm using it, so it's
statistically significant. It doesn't happen quite often enough (heh) but I've
rebuilt terminal and vte with debugging in the hopes that I'll get a chance to
get a new backtrace.
Comment 13 Chris Wilson 2007-01-31 22:34:42 UTC
* Tries to attract the attention of anyone who can still reproduce this bug.

I checked vte_sequence_handler_delete_lines() [as mentioned above] and found its use of the GValue inconsistent with the majority of the other sequence handlers - it was missing a type check. So I corrected that; and I ask for people to check trunk/HEAD in order to see if they can reproduce the crash.

r1598: 2007-01-31  Chris Wilson  <chris@chris-wilson.co.uk>

	In a few places the contents of a GValue were being used without
	checking that they were of the expected type.

	cf Bug 117945 which mentions stack corruption inside
	vte_sequence_handler_delete_lines() - one of the corrected instances.

	* src/vteseq.c: (vte_sequence_handler_al),
	(vte_sequence_handler_cs), (vte_sequence_handler_cS),
	(vte_sequence_handler_dl),
	(vte_sequence_handler_character_attributes),
	(vte_sequence_handler_insert_lines),
	(vte_sequence_handler_delete_lines),
	(vte_sequence_handler_device_status_report),
	(vte_sequence_handler_dec_device_status_report):
		Check that the GValue holds a long before dereference.

Comment 14 Christian Persch 2008-11-26 12:21:41 UTC
Closing old NEEDINFO bugs.

I think we can safely assume this is fixed.