GNOME Bugzilla – Bug 106583
( <Delete> ) crashes gcalctool.
Last modified: 2004-12-22 21:47:04 UTC
Reported against v4.2.52. Start up gcalctool. Enter: ( <Delete> ) i.e. left parenthis, delete then right parenthesis. You will get two: (gcalctool:10872): Gtk-CRITICAL **: file gtktextbuffer.c: line 548: assertion `g_utf8_validate (text, len, NULL)' failed Followed by a SEGV: Program received signal SIGSEGV, Segmentation fault. 0x2cff8 in mpstr (x=0xfffffffc, y=0x57914) at mp.c:4226 4226 j = x[1]; (gdb) where
+ Trace 34041
$1 = (int *) 0xfffffffc (gdb) print x[1] Cannot access memory at address 0x0 (gdb)
Rich, Here is a patch to clean up the Gtk-CRITICAL messages. (gcalctool:10872): Gtk-CRITICAL **: file gtktextbuffer.c: line 548: assertion `g_utf8_validate (text, len, NULL)' failed -- Dennis
Created attachment 14460 [details] [review] A patch to fix GTK-CRITICAL messages.
Rich, Also, make the below utf8 change in get_display(). Thanks, Dennis Index: gtk.c =================================================================== RCS file: /cvs/gnome/gcalctool/gcalctool/gtk.c,v retrieving revision 1.65 diff -u -p -r1.65 gtk.c --- gtk.c 19 Feb 2003 22:32:56 -0000 1.65 +++ gtk.c 20 Feb 2003 07:27:28 -0000 @@ -1218,7 +1218,7 @@ get_display() /* The Copy f if (v->shelf != NULL) { free(v->shelf); } - v->shelf = g_strdup(string); + v->shelf = g_locale_from_utf8(string, strlen(string), NULL, NULL, NULL);
Thanks Dennis. Those changes nicely fix the error messages. The crash was caused by the paren_disp() function in display.c not correctly checking for when a Delete character was entered. Fixed in v4.2.55.