GNOME Bugzilla – Bug 546940
Crash when selecting text
Last modified: 2008-08-13 22:28:02 UTC
Bug reported on Mandriva at https://qa.mandriva.com/show_bug.cgi?id=42607 Program received signal SIGSEGV, Segmentation fault. vte_terminal_extend_selection (terminal=<value optimized out>, x=<value optimized out>, y=<value optimized out>, always_grow=<value optimized out>, force=<value optimized out>) at vte.c:6178 6178 if (cell->attr.fragment || cell->c != 0) Missing debug package(s), you should install: GConf2-debug ORBit2-debug alsa-plugins-debug at-spi-debug audiofile-debug avahi-debug dbus-debug dbus-glib-debug esound-debug freetype2-debug gamin-debug gnome-keyring-debug gnome-panel-debug gnome-vfs2-debug gvfs-debug ia_ora-gnome-debug libalsa2-debug libart_lgpl-debug libbonobo-debug libbonoboui-debug libcanberra-debug libcroco0.6-debug libgail-gnome-debug libgnome2-debug libgnomecanvas-debug libgnomeui2-debug libgsf-debug libice-debug libogg-debug librsvg-debug libsm-debug libtool-debug libvorbis-debug libx11-debug libxau-debug libxcb-debug libxcursor-debug libxdmcp-debug libxinerama-debug libxml2-debug libxrandr-debug libxrender-debug openssl-debug pcre-debug pixman-debug pulseaudio-debug startup-notification-debug zlib-debug (gdb) bt
+ Trace 204853
6173 if (rowdata != NULL) { 6174 /* Find the last non-empty character on the last line. */ 6175 for (i = rowdata->cells->len - 1; i >= 0; i--) { 6176 cell = &g_array_index(rowdata->cells, 6177 struct vte_charcell, i); 6178 if (cell->attr.fragment || cell->c != 0) 6179 break; 6180 } 6181 /* If the end point is to its right, then extend the 6182 * endpoint as far right as we can expect. */
Hi, I'm hit by the same bug (and I'm also using mandriva cooker). It turns out to be very easy to reproduce: select a line which is empty. For instance, type # echo Then select the empty line (either part of it or all of it, it doesn't matter).
Looking at the log, it seems it's a regression introduced by Behdad Esfahbod in revision 2079 (to fix bug 546366). BTW, last_nonempty is now unsused.
As the original reporter (in MDV bug), I think it's more difficult to reproduce than you think. In order to reproduce it, I usually had to flow out quite a big amount of text (like "find /" output) and then try to select some lines. For information, I was using gnome-terminal-2.23.6. Original GDB backtrace is available unmangled at https://qa.mandriva.com/attachment.cgi?id=10460
There's an Ubuntu bug about it too here: https://bugs.edge.launchpad.net/ubuntu/+source/vte/+bug/256769
Fedora bug on the same: https://bugzilla.redhat.com/show_bug.cgi?id=458544
Thanks all. This was a very tricky 64bit-only crash. I've committed a fix now. 2008-08-13 Behdad Esfahbod <behdad@gnome.org> Bug 546940 – Crash when selecting text * src/vte.c (vte_terminal_extend_selection): Fix crash with 64-bit systems. Note to self: unsigned int len = 0; long i = len - 1; assert (i < 0); fails on 64-bit systems. Will make a release soon, after auditing the code for similar issues.
Here's the patch for the lazy: http://pastebin.ca/raw/1170460