I've traced down some locale-related coredumps to the following code
in _XimPreConnectionIM (xc/lib/X11/imDefIm.c) when LANG=C and the
*inputMethod: X resource is set.
/* locale name check */
_XGetLCValues(lcd, XlcNLanguage, &language, XlcNTerritory, &territory,
XlcNCodeset, &codeset, NULL);
llen = strlen( language );
tlen = strlen( territory ); /* <=== Crash occurs here, territory is */
/* NULL */
clen = strlen( codeset );
As near as I can tell, when LANG=C, both territory and codeset are
explicitly and unconditionally set to nil in _XlcResolveLocaleName
(xc/lib/X11/lcFile.c):
if (sinamelen == 1 && pub->siname[0] == 'C') {
pub->language = pub->siname;
pub->territory = pub->codeset = NULL;
return 1;
}
So why doesn't XEmacs drop core when linked against XIM/XLib (it does
with Lesstif)? Both commercial Motif (as linked with Netscape and
Java) and Lesstif blow chunks and die.