bug#3124: 23.0.92; emacs crash when start scim in shell

Yuanle Song <[email protected]>
Newsgroups gmane.emacs.bugs,gmane.emacs.pretest.bugs
Message-ID <[email protected]>
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the [email protected] mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

//Problem:
//scim doesn't work on latest emacs cvs version.

Summary:
The latest emacs gtk version started in locale en_US.UTF-8 crashes 
whenever scim is started!

How to reproduce:

1. start emacs gtk version in en_US.UTF-8 locale

   	 $ env LANG=en_US.UTF-8 emacs &

  I found that this bug disappear when emacs is started in zh_CN.UTF-8 locale.

2. start emacs shell

   	 M-x shell

3. start scim in emacs shell
  Note that you should quit scim if it is already started in X. You can do that
by right click on the scim icon in notification area and click quit.

   	 type "scim -d" in emacs shell

4. expected result:
  Scim start successfully with output similar to:
	~ $ scim -d
	Smart Common Input Method 1.4.7

	Launching a SCIM daemon with Socket FrontEnd...
	Loading simple Config module ...
	Creating backend ...
	Loading socket FrontEnd module ...
	Starting SCIM as daemon ...
	Launching a SCIM process with x11...
	Loading socket Config module ...
	Creating backend ...
	Loading x11 FrontEnd module ...
	GTK Panel of SCIM 1.4.7

	Starting SCIM as daemon ...
	SCIM has been successfully launched.
	~ $ 

5. what happend
  Scim is started, but emacs crashed with Segmentation fault.

gdb bt full and xbacktrace attached. emacs is compiled with -g -O2, if -O0 is
appreciated please tell me to recompile.

Additional info:
* If emacs is started with -nw option in a terminal. "scim -d" casue no error 
  and is able to start successfully. emacs won't crash.
* If emacs gtk version is started. Then scim is started at terminal outside
  emacs. emacs crash with segmentation fault.
* I have used emacs-snapshot package for debian before. It crashes when scim
  is started at emacs shell as well. The difference is scim is not start when 
  emacs-snapshot crashes.


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/local/share/emacs/23.0.92/etc/DEBUG for instructions.


In GNU Emacs 23.0.92.1 (i686-pc-linux-gnu, GTK+ Version 2.14.7)
 of 2009-04-26 on sylecn
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--infodir=/home/sylecn/helps/info' '--without-xaw3d' '--without-toolkit-scroll-bars''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=SCIM
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t

Recent input:
M-x r e p o r <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

===File ~/texts/bugs/gdb-bt-xbacktrace-output===============
~/fromsource/build/emacs/src $ gdb /usr/local/bin/emacs
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
SIGINT is used by the debugger.
Are you sure you want to change it? (y or n) [answered Y; input not from terminal]
DISPLAY = :0.0
TERM = dumb
Breakpoint 1 at 0x8124046: file /home/sylecn/fromsource/emacs/src/emacs.c, line 432.
Breakpoint 2 at 0x8140e09: file /home/sylecn/fromsource/emacs/src/sysdep.c, line 1146.
(gdb) c
The program is not being run.
(gdb) start
Breakpoint 3 at 0x8124498: file /home/sylecn/fromsource/emacs/src/emacs.c, line 788.
Starting program: /usr/local/bin/emacs 
[Thread debugging using libthread_db enabled]
[New Thread 0xb6ead750 (LWP 29501)]
[Switching to Thread 0xb6ead750 (LWP 29501)]
main (argc=1, argv=0xbfb2cc94)
    at /home/sylecn/fromsource/emacs/src/emacs.c:788
788	{
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0xb75aafef in XSetICValues () from /usr/lib/libX11.so.6
(gdb) bt full
#0  0xb75aafef in XSetICValues () from /usr/lib/libX11.so.6
No symbol table info available.
#1  0x080ec393 in xic_set_preeditarea (w=0x9ff6860, x=0, y=152)
    at /home/sylecn/fromsource/emacs/src/xfns.c:2357
	attr = <value optimized out>
	spot = {
  x = 10, 
  y = 167
}
#2  0x080dbac5 in xim_instantiate_callback (display=0x868f200, 
    client_data=0x8493920 "", call_data=0x0)
    at /home/sylecn/fromsource/emacs/src/xterm.c:8284
	w = (struct window *) 0x0
	f = (struct frame *) 0x9fd8fb0
	tail = <value optimized out>
	dpyinfo = <value optimized out>
#3  0xb75cdb9d in ?? () from /usr/lib/libX11.so.6
No symbol table info available.
#4  0x0868f200 in ?? ()
No symbol table info available.
#5  0x08493920 in ?? ()
No symbol table info available.
#6  0x00000000 in ?? ()
No symbol table info available.
(gdb) xbacktrace
(gdb) q
The program is running.  Exit anyway? (y or n) y
~/fromsource/build/emacs/src $ ============================================================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.