From xemacs-m  Wed Jul 30 00:28:00 1997
Received: from turnbull.sk.tsukuba.ac.jp (root@turnbull.sk.tsukuba.ac.jp [130.158.99.4])
	by xemacs.org (8.8.5/8.8.5) with SMTP id AAA06028
	for <xemacs-beta@xemacs.org>; Wed, 30 Jul 1997 00:27:55 -0500 (CDT)
Received: from turnbull.sk.tsukuba.ac.jp(really [127.0.0.1]) by turnbull.sk.tsukuba.ac.jp
	via smtpd with esmtp
	id <m0wtRAb-00000wC@turnbull.sk.tsukuba.ac.jp>
	for <xemacs-beta@xemacs.org>; Wed, 30 Jul 1997 14:19:33 +0900 (JST)
	(Smail-3.2 1996-Jul-4 #3 built 1997-Jun-24)
Message-Id: <m0wtRAb-00000wC@turnbull.sk.tsukuba.ac.jp>
To: Kazuyuki IENAGA <ienaga@jsys.co.jp>
Subject: Re: 20.3-b14 input-method-xlib.c: null XIM status area crashes XEmacs 
In-reply-to: Your message of "29 Jul 1997 18:08:37 +0900."
             <rysg1syrzsa.fsf@skywalk.jsys.co.jp> 
Cc: xemacs-beta@xemacs.org
Date: Wed, 30 Jul 1997 14:19:33 +0900
From: "Stephen J. Turnbull" <turnbull@turnbull.sk.tsukuba.ac.jp>

(hajimemashite)

>>>>> "Kazuyuki" == Kazuyuki IENAGA <ienaga@jsys.co.jp> writes:

    KI> I tested Stephen's patch on FreeBSD 2.2.2 and Berlin.  While
    KI> the kinput2 is running, it works fine, but if there's no input
    KI> method, XEmacs crashes as follows when the XEmacs got any key
    KI> press event and I could not get C backtrace.  But when I set
    KI> $LANG to "C" (other than "^ja.*"), it works.

If you use _only_ my patch, you _should_ get a SIGSEGV with that
procedure.  I tried starting up my patched "Vienna" with LANG=zh, and
got the crash on pressing Ctrl-X.  I don't understand why you don't
get a C backtrace, though; I got that as usual (Linux 2.0.29, libc
5.4.33, the "liblocale.so" hack, X11R6.3 (XFree86 3.3)).  Did you get
a core dump at all?

    KI> Martin Buchholz <mrb@Eng.Sun.COM> writes:

    >> I have also modified event-Xt.c so that XLookupString will get
    >> used instead of XmbLookupString if the current frame has no
    >> input context.

Then I did this, too, (I'm not going to publish my patch because it
introduced compiler warnings where there weren't any before, and
Martin says his will be in b16), and now I get fail-safe behavior:
XEmacs complains "XOpenIM() failed..." and proceeds in "ISO8" mode.  I 
get the same "fail-safe" behavior with "LANG=MiddleEarth" (a
nonexistent locale on my system).

    >> This is tricky code and hard to test.  I have no convenient
    >> access to kinput2 or non-Solaris xlib.  In my opinion both
    >> kinput2 and xlib are buggy.

"Buggy" I don't have an opinion on, kinput2 I don't understand well
enough to say anything about, but Xlib is definitely not robust in
this area.  Look for more XEmacs crashes in this code....

    KI> xemacs-beta% ./src/xemacs -q -no-site-file
    KI> "f-e-r-i-1:  /pub/compile/emacs/xemacs-beta/src/xemacs
    KI> ""Find: /etc/xemacs
    KI> ""Find: /homes/skywalk/ienaga/.xemacs
    KI> Warning: locale not supported by C library, locale unchanged

On second thought, yes, kinput2 is buggy:  you shouldn't be able to
connect to kinput2 at all in this case.  But LOCALE=ja_JP is hardwired
in to kinput2, so it works.

    KI> Warning: XOpenIM() failed...no input server available
    KI> "

    KI> Fatal error (11).

Trying to execute code which isn't inside of any function gdb can
identify....

Steve

-- 
                            Stephen J. Turnbull
Institute of Policy and Planning Sciences                    Yaseppochi-Gumi
University of Tsukuba                      http://turnbull.sk.tsukuba.ac.jp/
Tel: +81 (298) 53-5091;  Fax: 55-3849              turnbull@sk.tsukuba.ac.jp

