Re: gucharmap makes qtk-query-immodules segfault



Noah Levitt wrote:
> 
> Well, the CFLAGS I normally use are "-Wall -pipe -g -O2",
> but I wouldn't expect that to be important, though Im not
> sure.

Well, yesterday I did a lot of recompiles and gdb sessions and now I am
positive that with gcc 3.3, the switch -O3 (or -On wuth n > 2) will
miscompile *any* gtk input module, including gucharmap.so. So mu problem
is not specific to gucharmap at all. At least that is my situation.

I suppose this must be known but I can hardly check sicnce
http://bugzilla.gnome.org/query.cgi is very slow from here (and not
exactly straightforward to use for the non-developers).

First, a sum up of my findings:

Whenever any input module is compiled with -O3 present, then the problem
arises. -O3 has no bad influence on the functionality of the rest of
GTK, including gtk-query-immodules-2.0.

The bug causes query-immodules-2.0 receiving SIGSEGV as soon as it
parses any immodule which had been compiled with -O3. Again, it does not
matter how gtk-query-immodules-2.0 itself was compiled. It does also not
matter whether or not a module was given as command line argument.
 
I have attached 3 logs of gdb sessions. In particular:

gdb-nocflags
============
Everything works fine. All components compiled with CFLAGS unset.
gucharmap installed. No problems at all. Just to show that my intall is
working fine.


gdb-g-O3-pipe
=============
GTK compiled with CFLAGS unset. gucharmap compiled with

CFLAGS=-g -O3 -pipe.

make install *not* called. The resulting gucharmap moved by hand to 
/usr/local/lib/gtk-2.0/2.2.0/immodules/im-gucharmap.so". Withing gdb,
call of gtk-query-immodules-2.0.


gdb-g-O3-pipe-gtkdir
====================
A session within the build dir of GTK. Has nothing to do with gucharmap.
Again,

CFLAGS=-g -O3 -pipe

Called ./configure with no switches. Then make. Then called the freshly
compiled version of gtk-query-immodules-2.0 with the path to the new
im-xim.so as argument. I do know that in this case gtk-query-immodules
is linked against my installed version of GTK but this does not matter
(trust me).


In all cases, something as simple as looping over a structure containing
only strings seems to yield junk, instead of pointers to *char. And why
does "name" hold junk? queryimmodules.c is very simple code, after all!

I simply don't understand that!!

cheers,

Frank

-- 
Dr Frank Boehme                      | Email: f boehme cs ucc ie
National University of Ireland, Cork | phone: +353-21-4903163
Dept of Computer Science             |   fax: +353-21-4903113
Cork, Ireland                        |

Please avoid mailing Word or Power Point attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
Script started on Tue Aug 19 22:48:46 2003
$ gdb gtk-query-immodules-2.0
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-mandrake-linux"...(no debugging symbols found)...
(gdb) run
Starting program: /usr/local/bin/gtk-query-immodules-2.0
# GTK+ Input Method Modules file
# Automatically generated file, do not edit
#
# ModulesPath = /home/frank/.gtk-2.0/2.2.0/i686-pc-linux-gnu/immodules:/home/frank/.gtk-2.0/2.2.0/immodules:/home/frank/.gtk-2.0/i686-pc-linux-gnu/immodules:/home/frank/.gtk-2.0/immodules:/usr/local/lib/gtk-2.0/2.2.0/i686-pc-linux-gnu/immodules:/usr/local/lib/gtk-2.0/2.2.0/immodules:/usr/local/lib/gtk-2.0/i686-pc-linux-gnu/immodules:/usr/local/lib/gtk-2.0/immodules
#
"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-xim.so"
"xim" "X Input Method" "gtk20" "/usr/local/share/locale" "ko:ja:zh"

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-am-et.so"
"am_et" "Amharic (EZ+)" "gtk20" "/usr/local/share/locale" "am" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-cyrillic-translit.so"
"cyrillic_translit" "Cyrillic (Transliterated)" "gtk20" "/usr/local/share/locale" ""

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-hangul.so" 
"hangul" "Hangul (KSC 5601)" "gtk+" "" "" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-inuktitut.so" 
"inuktitut" "Inukitut (Transliterated)" "gtk20" "/usr/local/share/locale" "iu" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-ipa.so" 
"ipa" "IPA" "gtk20" "/usr/local/share/locale" "" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-thai-broken.so" 
"thai_broken" "Thai (Broken)" "gtk20" "/usr/local/share/locale" "" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-ti-er.so" 
"ti_er" "Tigrigna-Eritrean (EZ+)" "gtk20" "/usr/local/share/locale" "ti" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-ti-et.so" 
"ti_et" "Tigrigna-Ethiopian (EZ+)" "gtk20" "/usr/local/share/locale" "ti" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-viqr.so" 
"viqr" "Vietnamese (VIQR)" "gtk20" "/usr/local/share/locale" "vi" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-gucharmap.so" 
"imgucharmap" "Unicode Character Map" "gucharmap" "/usr/local/share/locale" "" 


Program exited normally.
(gdb) q

Script started on Tue Aug 19 23:25:44 2003
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-mandrake-linux"...
(gdb) run
Starting program: /usr/src/GTK/gtk+-2.2.2/gtk/.libs/./gtk-query-immodules-2.0 
# GTK+ Input Method Modules file
# Automatically generated file, do not edit
#
# ModulesPath = /root/.gtk-2.0/2.2.0/i686-pc-linux-gnu/immodules:/root/.gtk-2.0/2.2.0/immodules:/root/.gtk-2.0/i686-pc-linux-gnu/immodules:/root/.gtk-2.0/immodules:/usr/local/lib/gtk-2.0/2.2.0/i686-pc-linux-gnu/immodules:/usr/local/lib/gtk-2.0/2.2.0/immodules:/usr/local/lib/gtk-2.0/i686-pc-linux-gnu/immodules:/usr/local/lib/gtk-2.0/immodules
#
"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-xim.so" 
"xim" "X Input Method" "gtk20" "/usr/local/share/locale" "ko:ja:zh" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-am-et.so" 
"am_et" "Amharic (EZ+)" "gtk20" "/usr/local/share/locale" "am" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-cyrillic-translit.so" 
"cyrillic_translit" "Cyrillic (Transliterated)" "gtk20" "/usr/local/share/locale" "" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-hangul.so" 
"hangul" "Hangul (KSC 5601)" "gtk+" "" "" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-inuktitut.so" 
"inuktitut" "Inukitut (Transliterated)" "gtk20" "/usr/local/share/locale" "iu" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-ipa.so" 
"ipa" "IPA" "gtk20" "/usr/local/share/locale" "" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-thai-broken.so" 
"thai_broken" "Thai (Broken)" "gtk20" "/usr/local/share/locale" "" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-ti-er.so" 
"ti_er" "Tigrigna-Eritrean (EZ+)" "gtk20" "/usr/local/share/locale" "ti" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-ti-et.so" 
"ti_et" "Tigrigna-Ethiopian (EZ+)" "gtk20" "/usr/local/share/locale" "ti" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-viqr.so" 
"viqr" "Vietnamese (VIQR)" "gtk20" "/usr/local/share/locale" "vi" 

"/usr/local/lib/gtk-2.0/2.2.0/immodules/im-gucharmap.so" 

Program received signal SIGSEGV, Segmentation fault.
0x08048f55 in query_module (dir=0x40326c <Address 0x40326c out of bounds>, 
    name=0x80648e8 "ŘE\006\bXF\006\b\001") at queryimmodules.c:123
123		  print_escaped (contexts[i]->context_id);
(gdb) bt
#0  0x08048f55 in query_module (dir=0x40326c <Address 0x40326c out of bounds>, 
    name=0x80648e8 "ŘE\006\bXF\006\b\001") at queryimmodules.c:123
#1  0x0804912f in main (argc=134528592, argv=0xbffff694) at queryimmodules.c:179
#2  0x405fe280 in __libc_start_main () from /lib/libc.so.6
(gdb) q
The program is running.  Exit anyway? (y or n) y
Script done on Tue Aug 19 23:27:15 2003
Script started on Wed Aug 20 04:32:08 2003
@localhost .libs]# pwd 
/usr/src/GTK/gtk+-2.2.2/gtk/.libs
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-mandrake-linux"...
(gdb) run ../../modules/input/.libs/im-xim.so
Starting program: /usr/src/GTK/gtk+-2.2.2/gtk/.libs/./gtk-query-immodules-2.0 ../../modules/input/.libs/im-xim.so
# GTK+ Input Method Modules file
# Automatically generated file, do not edit
#
"/usr/src/GTK/gtk+-2.2.2/gtk/.libs/../../modules/input/.libs/im-xim.so" 

Program received signal SIGSEGV, Segmentation fault.
0x0804903d in query_module (dir=0x0, name=0x4031ff35 "˙1@") at queryimmodules.c:74
74	{
(gdb) where
#0  0x0804903d in query_module (dir=0x0, name=0x4031ff35 "˙1@") at queryimmodules.c:74
#1  0x08048d83 in main (argc=2, argv=0xbffff674) at queryimmodules.c:191
#2  0x405fe280 in __libc_start_main () from /lib/libc.so.6
(gdb) bt
#0  0x0804903d in query_module (dir=0x0, name=0x4031ff35 "˙1@") at queryimmodules.c:74
#1  0x08048d83 in main (argc=2, argv=0xbffff674) at queryimmodules.c:191
#2  0x405fe280 in __libc_start_main () from /lib/libc.so.6
(gdb) q
The program is running.  Exit anyway? (y or n) y


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