Re: GTK+-2.1.1 released [unstable]



Hi, I compiled gtk+-2.1.1 just now, but the gtkimcontextxim.c also has some 
problem, I use the gtk-demo app to debug and the backtrace is list below:

Starting program: /opt/src/gnome2/gtk+-2.1.1/demos/gtk-demo/.libs/gtk-demo
my environment is Redhat 8.0 and use gcc 3.2 to compile it.
I have installed pango 1.1.2 already.

Program received signal SIGSEGV, Segmentation fault.
0x40856231 in reinitialize_all_ics (info=0x8133bd8) at gtkimcontextxim.c:176
176         reinitialize_ic (tmp_list->data, TRUE);
(gdb) bt
#0  0x40856231 in reinitialize_all_ics (info=0x8133bd8) at 
gtkimcontextxim.c:176
#1  0x408562b1 in status_style_change (info=0x8133bd8) at 
gtkimcontextxim.c:196
#2  0x408565a4 in setup_im (info=0x8133bd8) at gtkimcontextxim.c:281
#3  0x40856889 in get_im (client_window=0x8118328, locale=0x810f368 
"zh_CN.GB2312") at gtkimcontextxim.c:374
#4  0x40856aba in set_ic_client_window (context_xim=0x8110670, 
client_window=0x8118328, send_signal=1) at gtkimcontextxim.c:455
#5  0x40856b04 in gtk_im_context_xim_set_client_window (context=0x8110670, 
client_window=0x8118328) at gtkimcontextxim.c:466
#6  0x40140818 in gtk_im_context_set_client_window (context=0x8110670, 
window=0x8118328) at gtkimcontext.c:260
#7  0x4014288f in gtk_im_multicontext_set_client_window (context=0x80b0188, 
window=0x8118328) at gtkimmulticontext.c:258
#8  0x40140818 in gtk_im_context_set_client_window (context=0x80b0188, 
window=0x8118328) at gtkimcontext.c:260
#9  0x401d7691 in text_window_realize (win=0x80b0260, parent=0x8118268) at 
gtktextview.c:6650
#10 0x401d1991 in gtk_text_view_realize (widget=0x80afb58) at 
gtktextview.c:3352
#11 0x4049ad01 in g_cclosure_marshal_VOID__VOID () from 
/usr/lib/libgobject-2.0.so.0
#12 0x40486467 in g_type_class_meta_marshal () from 
/usr/lib/libgobject-2.0.so.0

I think this is caused by the get_im method in gtkimcontextxim.c:361,
it use g_new to allocate the buffer for GtkXIMInfo, but doesn't clear the 
memory, so the info->ics is a invalid address, and in the function 
reinitialize_ics it use info->ics, so core dump.

I have tried to change g_new with g_new0, this can show the gtk_demo app 
window, but when I put the mouse in the edit window, it still segment fault.
the backtrace is listed below:


Starting program: /opt/src/gnome2/gtk+-2.1.1/demos/gtk-demo/.libs/gtk-demo

Program received signal SIGSEGV, Segmentation fault.
0x420741ce in malloc_consolidate () from /lib/i686/libc.so.6
(gdb) bt
#0  0x420741ce in malloc_consolidate () from /lib/i686/libc.so.6
#1  0x42073ab7 in _int_malloc () from /lib/i686/libc.so.6
#2  0x42073155 in malloc () from /lib/i686/libc.so.6
#3  0x4201658c in __gconv_open () from /lib/i686/libc.so.6
#4  0x4201602e in iconv_open () from /lib/i686/libc.so.6
#5  0x404cbf16 in try_conversion () from /usr/lib/libglib-2.0.so.0
#6  0x404cbfc3 in g_iconv_open () from /usr/lib/libglib-2.0.so.0
#7  0x404cc5c5 in open_converter () from /usr/lib/libglib-2.0.so.0
#8  0x404cc84d in g_convert () from /usr/lib/libglib-2.0.so.0
#9  0x404cccd9 in g_convert_with_fallback () from /usr/lib/libglib-2.0.so.0
#10 0x404e8569 in strdup_convert () from /usr/lib/libglib-2.0.so.0
#11 0x404e8ac5 in g_log_default_handler () from /usr/lib/libglib-2.0.so.0
#12 0x404e82a9 in g_logv () from /usr/lib/libglib-2.0.so.0
#13 0x404e84b4 in g_log () from /usr/lib/libglib-2.0.so.0
#14 0x4048881c in g_object_freeze_notify () from /usr/lib/libgobject-2.0.so.0
#15 0x402130dc in gtk_window_set_policy (window=0x80b1f58, allow_shrink=0, 
allow_grow=0, auto_shrink=0) at gtkwindow.c:1197
#16 0x4021813a in gtk_window_set_resizable (window=0x80b1f58, resizable=0) at 
gtkwindow.c:5653
#17 0x408580f0 in status_window_get (context_xim=0x8110670, create=1) at 
gtkimcontextxim.c:1247
#18 0x4085827a in status_window_show (context_xim=0x8110670) at 
gtkimcontextxim.c:1287
#19 0x40856fb5 in gtk_im_context_xim_focus_in (context=0x8110670) at 
gtkimcontextxim.c:602
#20 0x4014088f in gtk_im_context_focus_in (context=0x8110670) at 
gtkimcontext.c:337
#21 0x401429dd in gtk_im_multicontext_focus_in (context=0x80b0188) at 
gtkimmulticontext.c:311
#22 0x4014088f in gtk_im_context_focus_in (context=0x80b0188) at 
gtkimcontext.c:337
#23 0x401d2c21 in gtk_text_view_focus_in_event (widget=0x80afb58, 
event=0x819597c) at gtktextview.c:3984
#24 0x40158a90 in _gtk_marshal_BOOLEAN__BOXED (closure=0x808a2d8, 
return_value=0xbfffe520, n_param_values=2, param_values=0xbfffe640,
    invocation_hint=0xbfffe548, marshal_data=0x401d2b62) at gtkmarshalers.c:82
#25 0x40486467 in g_type_class_meta_marshal () from 
/usr/lib/libgobject-2.0.so.0
#26 0x404860c0 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#27 0x4049a369 in signal_emit_unlocked_R () from /usr/lib/libgobject-2.0.so.0
#28 0x40499689 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#29 0x40499af4 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#30 0x4020d4aa in gtk_widget_event_internal (widget=0x80afb58, 
event=0x819597c) at gtkwidget.c:3132
#31 0x4020d255 in gtk_widget_event (widget=0x80afb58, event=0x819597c) at 
gtkwidget.c:2993
#32 0x40216692 in do_focus_change (widget=0x80afb58, in=1) at gtkwindow.c:4097
#33 0x40216b6c in gtk_window_real_set_focus (window=0x808fe60, 
focus=0x80afb58) at gtkwindow.c:4293
#34 0x4049ba10 in g_cclosure_marshal_VOID__OBJECT () from 
/usr/lib/libgobject-2.0.so.0
#35 0x40486467 in g_type_class_meta_marshal () from 
/usr/lib/libgobject-2.0.so.0
#36 0x404860c0 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#37 0x4049a369 in signal_emit_unlocked_R () from /usr/lib/libgobject-2.0.so.0
#38 0x40499888 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#39 0x40499af4 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#40 0x40212f48 in _gtk_window_internal_set_focus (window=0x808fe60, 
focus=0x80afb58) at gtkwindow.c:1122
#41 0x4020db71 in gtk_widget_real_grab_focus (focus_widget=0x80afb58) at 
gtkwidget.c:3476
#42 0x401d3127 in gtk_text_view_grab_focus (widget=0x80afb58) at 
gtktextview.c:4210
#43 0x4049ad01 in g_cclosure_marshal_VOID__VOID () from 
/usr/lib/libgobject-2.0.so.0
#44 0x40486467 in g_type_class_meta_marshal () from 
/usr/lib/libgobject-2.0.so.0
#45 0x404860c0 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#46 0x4049a369 in signal_emit_unlocked_R () from /usr/lib/libgobject-2.0.so.0
#47 0x40499888 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0

hope the info can help.

younker






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]