Hello,
Given a KDE 3.1 environment under the zh_HK.Big5-HKSCS locale (hence
using BIG5HKSCS-0:GLGR) on an GNU/Linux system, when an application
(say Gimp) is started under zh_TW.Big5 locale (using BIG5-0:GLGR),
KDE's kwin would crash while attempting to display text in the window
title.
GDB shows the crash at "if (ctextseg->charset == charset) {" on line
663 in _XlcGetCodeSetFromCharSet() xc/lib/X11/lcGenConv.c.
ctextseg is NULL at this point.
I took a brief look at related codes. If I understand correctly, a
codeset's ctextseg would always be NULL unless ct_extended_segment is
defined in XLC_LOCALE. Curiously, ct_extended_segment does not appear
to be officially documented, and I couldn't find this keyword in any
XFree86 XLC_LOCALE files.
I was perplex as to why others hadn't experienced the same problem. My
guess is that perhaps we had been lucky that the line was hardly ever
reached. And indeed, if I use XFree86's vanilla
zh_HK.big5hkscs/XLC_LOCALE, kwin wouldn't crash at all in this
situation:
Before:
cs0: ISO8859-1:GL, cs1: BIG5-0:GLGR, ..., cs4: BIG5HKSCS-0:GLGR
After:
cs0: ISO8859-1:GL, cs1: BIG5HKSCS-0:GLGR, cs2: BIG5HKSCS-0:GLGR, ...
I moved BIG5HKSCS-0:GLGR up higher so that my zh_HK.UTF-8 term would
work properly (UTF-8<->BIG5HKSCS-0 instead of UTF-8<->BIG5-0).
The GDB backtrace and a patch for lcGenConv.c is attached. I hope this
fix may get into XFree86-4.3.0. :-)
Best regards,
Anthony
--
Anthony Fok Tung-Ling
ThizLinux Laboratory <[EMAIL PROTECTED]> http://www.thizlinux.com/
Debian Chinese Project <[EMAIL PROTECTED]> http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp! http://www.olvc.ab.ca/
--- XFree86-4.2.99.902/xc/lib/X11/lcGenConv.c.original 2002-11-01 17:10:37.000000000
+0800
+++ XFree86-4.2.99.902/xc/lib/X11/lcGenConv.c 2003-02-25 16:23:07.000000000 +0800
@@ -660,7 +660,7 @@
}
if (glyph_index_tmp != *glyph_index) {
- if (ctextseg->charset == charset) {
+ if (ctextseg && ctextseg->charset == charset) {
goto end_loop;
}
}
(no debugging symbols found)...[New Thread 8192 (LWP 19115)]
0x410051c9 in wait4 () from /lib/libc.so.6
#0 0x410051c9 in wait4 () from /lib/libc.so.6
#1 0x4107c754 in __DTOR_END__ () from /lib/libc.so.6
#2 0x40e447f3 in waitpid () from /lib/libpthread.so.0
#3 0x405e0570 in KCrash::defaultCrashHandler(int) ()
from /usr/lib/libkdecore.so.4
#4 <signal handler called>
#5 0x420fa68a in _XlcGetCodeSetFromCharSet (lcd=0xfffffe00,
charset=0xbfffed0c, codeset=0xbfffed10, glyph_index=0xbfffec74)
at lcGenConv.c:663
#6 0x420fb3df in ctstowcs (conv=0x8066dd8, from=0xbfffed0c,
from_left=0xbfffed10, to=0xbfffec74, to_left=0xbfffec78, args=0x0,
num_args=0) at lcGenConv.c:1380
#7 0x420fc81f in ctstombs (conv=0x811cd68, from=0xbfffed0c,
from_left=0xbfffed0c, to=0xbfffed14, to_left=0xbfffed18, args=0x0,
num_args=0) at lcGenConv.c:2351
#8 0x40daf567 in _XlcConvert () from /usr/X11R6/lib/libX11.so.6
#9 0x40db56ee in _XlcDeInitLoader () from /usr/X11R6/lib/libX11.so.6
#10 0x40db57b3 in _XmbTextPropertyToTextList () from /usr/X11R6/lib/libX11.so.6
#11 0x40d8f56a in XmbTextPropertyToTextList () from /usr/X11R6/lib/libX11.so.6
#12 0x4130dbea in KWinInternal::Client::fetchName() () from /usr/lib/kwin.so
#13 0x4130b063 in KWinInternal::Client::Client(KWinInternal::Workspace*, unsigned
long, QWidget*, char const*, unsigned) () from /usr/lib/kwin.so
#14 0x421af503 in KWinInternal::KeramikClient::KeramikClient(KWinInternal::Workspace*,
unsigned long, QWidget*, char const*) ()
from /usr/lib/kde3/kwin_keramik.so
#15 0x421b2257 in allocate () from /usr/lib/kde3/kwin_keramik.so
#16 0x4131b44c in KWinInternal::PluginMgr::createClient(KWinInternal::Workspace*,
unsigned long, NET::WindowType) () from /usr/lib/kwin.so
#17 0x412f118c in KWinInternal::Workspace::clientFactory(unsigned long) ()
from /usr/lib/kwin.so
#18 0x412f368e in KWinInternal::Workspace::workspaceEvent(_XEvent*) ()
from /usr/lib/kwin.so
#19 0x413152c5 in Application::x11EventFilter(_XEvent*) ()
from /usr/lib/kwin.so
#20 0x4087e453 in qt_x11EventFilter(_XEvent*) ()
from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#21 0x40886d1a in QApplication::x11ProcessEvent(_XEvent*) ()
from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#22 0x4089ae86 in QEventLoop::processEvents(unsigned) ()
from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#23 0x408f0c4f in QEventLoop::enterLoop() ()
from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#24 0x408f0b04 in QEventLoop::exec() () from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#25 0x408de6b0 in QApplication::exec() ()
from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#26 0x41315600 in kdemain () from /usr/lib/kwin.so
#27 0x0804c96c in launch(int, char const*, char const*, char const*, int, char const*,
bool, char const*, bool, char const*) ()
#28 0x0804d4e6 in handle_launcher_request(int) ()
#29 0x0804d95b in handle_requests(int) ()
#30 0x0804e515 in main ()
#31 0x40f7299c in __libc_start_main () from /lib/libc.so.6