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 107590 - segmentation fault on GB18030
segmentation fault on GB18030
Status: RESOLVED DUPLICATE of bug 103634
Product: pango
Classification: Platform
Component: general
1.2.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-03-04 23:18 UTC by Felipe Heidrich
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Felipe Heidrich 2003-03-04 23:18:10 UTC
Gtk application dies when certain gb18030 character are used.

I've encoded one of these chars to utf16 in order to show the bug.
The only pattern I found was that those char that causes gtk to die are
encoded in 3 bytes when g_utf16_to_utf8 is used.
For chars that are encode in 2 bytes in UTF-8 the problem doesn't happens.
(I've used the items_written param of g_utf16_to_utf8 to check this);

I believe the conversion process is Ok though.
Be sure that the locale of your machine is set to gb18030 before running
the test code.

Here is my Test Code:

#include <gtk/gtk.h>

int main (int argc, char** argv) {
	GtkWidget *shellHandle, *textHandle;
   	gunichar2 buffer[] = {'a', 0xfb4e, 'b'};  //doesn't works
//   	gunichar2 buffer[] = {'a', 0x628, 'b'};   //works
	gchar* utf8;

        gtk_init_check (&argc, &argv);
	shellHandle = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	textHandle  = gtk_entry_new();
	gtk_container_add (GTK_CONTAINER (shellHandle), textHandle);

	utf8 = g_utf16_to_utf8 (buffer, 3, NULL, NULL, NULL);
	gtk_entry_set_text (GTK_ENTRY(textHandle), utf8);
	g_free (utf8);
	g_signal_connect (G_OBJECT (shellHandle), "destroy", G_CALLBACK
(gtk_main_quit), NULL);
	g_signal_connect (G_OBJECT (shellHandle), "delete_event",G_CALLBACK
(gtk_main_quit), NULL);
	gtk_widget_show_all (shellHandle);
	gtk_main();

}
Comment 1 Felipe Heidrich 2003-03-06 15:51:42 UTC
After some more testing I verified that the crash happens on the 
following funcions:
pango_layout_get_size, gdk_draw_layout


this is more likely a pango bug I think.

Comment 2 Owen Taylor 2003-03-06 21:48:26 UTC

*** This bug has been marked as a duplicate of 103634 ***