Re: [dev] [PATCH] dmenu: Fix segfault on systems with broken locale support

From: Ismael Luceno <>
Date: Thu, 21 Nov 2013 18:32:33 -0300

On Thu, 21 Nov 2013 19:37:15 +0100
Martti K├╝hne <> wrote:
> On Thu, Nov 21, 2013 at 1:32 PM, Ismael Luceno
> <> wrote:
> >
> > On my system, UTF-8 locale support is somehow broken for X; with
> > LANG set to an UTF-8 locale, XOpenIM fails, and this causes a
> > segfault (I guess it's libx11's fault after all). Other locales do
> > work.
> >
> So, how about st's handling of XOpenIM? Does it break too?

|ismael_AT_pirotess:~$ st
|XOpenIM failed. Could not open input device.

Well, consistency is good, but I'm not sure if failing is the right
thing to do here. It would mean you can't use it even when it's just the
locale support that is broken.

> On the tcl/tk forums I also found some info on which I based my last
> email [0], assuming your setup doesn't set X_LOCALE.

That's a good question, seems libx11 is compiled with
--enable-xlocale (will try disabling it and rebuilding everything), but
including Xlocale.h and defining X_LOCALE causes linking issues (seems
_Xsetlocale is not being exported by libX11).

> A segfault may also mean that you haven't finished setting up your
> system. I'd like to see an strace log, what distro you set up how far
> and if you have to run locale-gen manually on it... with the
> uncommented utf-8 locale in /etc/locale.gen.

UTF-8 locales seem to be generated correctly and work fine on the
console / xterm. It seems to be some issue with X locale support (I
have no idea about how it works :/).

BTW, the segfault happens within XmbLookupString, when xic==0. I guess
it's not doing any checking on the parameter.
Received on Thu Nov 21 2013 - 22:32:33 CET

This archive was generated by hypermail 2.3.0 : Thu Nov 21 2013 - 22:36:07 CET