GNOME Bugzilla – Bug 567064
g-t crash with 'perl -e 'print "\xec\x98\x8c";' > /tmp/bug; less /tmp/bug'
Last modified: 2009-04-23 15:29:12 UTC
Found on https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/314826 . $ MALLOC_CHECK_=2 gdb --args ./gnome-terminal --disable-factory (gdb) run Now in the new terminal process, type $ perl -e 'print "\xec\x98\x8c";' > /tmp/bug; less /tmp/bug Program received signal SIGSEGV, Segmentation fault.
+ Trace 211396
Thread 3071256320 (LWP 17068)
g-t and vte from svn trunk.
The bug is in vteconv.c where _vte_conv_cu() returns -1 and sets inbytes to zero. The EILSEQ handler then decrements inbytes (which is an unsigned gsize).
Created attachment 133007 [details] [review] Stops the crash due to an invalid sequence (correction, the file changed is iso2022.c) This stops the crash, I'm not sure if it is the correct behaviour however.
Can't reproduce. And the code looks right to me. Is it on x86_64? Can you debug inside _vte_conv() and see why we consumed all the input but are returning -1?
Ok, reproduced. Need to set encoding to SHIFT_JIS first.
Looks like an iconv bug.
Iconv test and bug report: https://bugzilla.redhat.com/show_bug.cgi?id=497267
Ok, I committed your patch to work around the iconv bug.