With a little finagling, I've managed to produce a backtrace by using
Quentin's suggested flag modifications to config.mk. This is attached.
It seems to me only to confirm what we've already learned: the failure
occurs in XmbLookupString. Perhaps with the additional diagnostic
information Patrick was able to provide we'll figure it out.
As an aside: thanks to everyone who has patiently helped me figure out
how to provide debugging information! Sorry I can't be more help.
On Sun, Feb 10, 2019 at 5:39 PM Patrick Smith <[email protected]> wrote:
>
> I'm experiencing a problem that appears very similar to this one, and
> I can add a bit of information.
>
> Summary: When I have scim+anthy installed as an input method, the call
> to XOpenIM fails, returning a null pointer. But I don't know much
> about the internals of X, so can't be 100% sure this is the root of
> the problem. Nor do I know what to look at next.
>
> My environment: up to date Arch Linux, dmenu 4.9. For X input methods,
> using scim and anthy by setting environment variables:
>
> export XMODIFIERS=@im=SCIM
> export GTK_IM_MODULE=scim
> export QT_IM_MODULE=scim
>
> To reproduce the crash, I can do
>
> printf 'foo\nbar' | dmenu
>
> and then press return. With the Arch Linux 4.9, this produces a
> segmentation fault. After I downgraded to the Arch version of dmenu
> 4.8, it works correctly.
>
> So I downloaded the 4.9 source code and built it myself, with no
> changes to config.mk or anything else. This version produces still
> produces the segfault.
>
> Then I added debugging code to print some information to stderr. From
> this, I see that the crash seems to be inside XmbLookupString, as
> reported previously; the xic pointer returned from XCreateIC and
> passed to XmbLookupString is null, and the xim pointer returned from
> XOpenIM and passed to XCreateIC is also null.
>
> After this, I restarted X with scim disabled by commenting out the
> exports mentioned above, and retried the printf into dmenu. Now it
> works correctly, and reports that both XOpenIM and XCreateIC return
> non-null pointers.
>
> I'm not sure what to look at next, so I hope that helps someone else
> to diagnose the problem...
>
#0 0x00007f25b05b3560 in XmbLookupString () from /usr/lib/libX11.so.6
No symbol table info available.
#1 0x00005620c9f3d861 in keypress (ev=0x7ffe62443e50) at dmenu.c:315
buf = "P>Db\376\177\000\000P>Db\376\177\000\000PLH\312
V\000\000\000\000\000\000\000\000\000"
len = 32766
ksym = 139799849240050
status = 1648640192
#2 0x00005620c9f3e66b in run () at dmenu.c:574
ev = {type = 2, xany = {type = 2, serial = 76, send_event = 0, display
= 0x5620ca484c50,
window = 14680068}, xkey = {type = 2, serial = 76, send_event = 0,
display = 0x5620ca484c50,
window = 14680068, root = 467, subwindow = 0, time = 86032878, x =
1078, y = 1918, x_root = 1078,
y_root = 1918, state = 0, keycode = 38, same_screen = 1}, xbutton =
{type = 2, serial = 76,
send_event = 0, display = 0x5620ca484c50, window = 14680068, root =
467, subwindow = 0,
time = 86032878, x = 1078, y = 1918, x_root = 1078, y_root = 1918,
state = 0, button = 38,
same_screen = 1}, xmotion = {type = 2, serial = 76, send_event = 0,
display = 0x5620ca484c50,
window = 14680068, root = 467, subwindow = 0, time = 86032878, x =
1078, y = 1918, x_root = 1078,
y_root = 1918, state = 0, is_hint = 38 '&', same_screen = 1},
xcrossing = {type = 2, serial = 76,
send_event = 0, display = 0x5620ca484c50, window = 14680068, root =
467, subwindow = 0,
time = 86032878, x = 1078, y = 1918, x_root = 1078, y_root = 1918,
mode = 0, detail = 38,
same_screen = 1, focus = 22048, state = 3393959744}, xfocus = {type
= 2, serial = 76, send_event = 0,
display = 0x5620ca484c50, window = 14680068, mode = 467, detail =
0}, xexpose = {type = 2, serial = 76,
send_event = 0, display = 0x5620ca484c50, window = 14680068, x =
467, y = 0, width = 0, height = 0,
count = 86032878}, xgraphicsexpose = {type = 2, serial = 76,
send_event = 0, display = 0x5620ca484c50,
drawable = 14680068, x = 467, y = 0, width = 0, height = 0, count =
86032878, major_code = 0,
minor_code = 1078}, xnoexpose = {type = 2, serial = 76, send_event
= 0, display = 0x5620ca484c50,
drawable = 14680068, major_code = 467, minor_code = 0}, xvisibility
= {type = 2, serial = 76,
send_event = 0, display = 0x5620ca484c50, window = 14680068, state
= 467}, xcreatewindow = {type = 2,
serial = 76, send_event = 0, display = 0x5620ca484c50, parent =
14680068, window = 467, x = 0, y = 0,
width = 86032878, height = 0, border_width = 1078,
override_redirect = 1918}, xdestroywindow = {
type = 2, serial = 76, send_event = 0, display = 0x5620ca484c50,
event = 14680068, window = 467},
xunmap = {type = 2, serial = 76, send_event = 0, display =
0x5620ca484c50, event = 14680068,
window = 467, from_configure = 0}, xmap = {type = 2, serial = 76,
send_event = 0,
display = 0x5620ca484c50, event = 14680068, window = 467,
override_redirect = 0}, xmaprequest = {
type = 2, serial = 76, send_event = 0, display = 0x5620ca484c50,
parent = 14680068, window = 467},
xreparent = {type = 2, serial = 76, send_event = 0, display =
0x5620ca484c50, event = 14680068,
window = 467, parent = 0, x = 86032878, y = 0, override_redirect =
1078}, xconfigure = {type = 2,
serial = 76, send_event = 0, display = 0x5620ca484c50, event =
14680068, window = 467, x = 0, y = 0,
width = 86032878, height = 0, border_width = 1078, above =
8237747274806, override_redirect = 0},
xgravity = {type = 2, serial = 76, send_event = 0, display =
0x5620ca484c50, event = 14680068,
window = 467, x = 0, y = 0}, xresizerequest = {type = 2, serial =
76, send_event = 0,
display = 0x5620ca484c50, window = 14680068, width = 467, height =
0}, xconfigurerequest = {type = 2,
serial = 76, send_event = 0, display = 0x5620ca484c50, parent =
14680068, window = 467, x = 0, y = 0,
width = 86032878, height = 0, border_width = 1078, above =
8237747274806, detail = 0,
value_mask = 94695438942209}, xcirculate = {type = 2, serial = 76,
send_event = 0,
display = 0x5620ca484c50, event = 14680068, window = 467, place =
0}, xcirculaterequest = {type = 2,
serial = 76, send_event = 0, display = 0x5620ca484c50, parent =
14680068, window = 467, place = 0},
xproperty = {type = 2, serial = 76, send_event = 0, display =
0x5620ca484c50, window = 14680068,
atom = 467, time = 0, state = 86032878}, xselectionclear = {type =
2, serial = 76, send_event = 0,
display = 0x5620ca484c50, window = 14680068, selection = 467, time
= 0}, xselectionrequest = {type = 2,
serial = 76, send_event = 0, display = 0x5620ca484c50, owner =
14680068, requestor = 467,
selection = 0, target = 86032878, property = 8237747274806, time =
8237747274806}, xselection = {
type = 2, serial = 76, send_event = 0, display = 0x5620ca484c50,
requestor = 14680068, selection = 467,
target = 0, property = 86032878, time = 8237747274806}, xcolormap =
{type = 2, serial = 76,
send_event = 0, display = 0x5620ca484c50, window = 14680068,
colormap = 467, new = 0, state = 0},
xclient = {type = 2, serial = 76, send_event = 0, display =
0x5620ca484c50, window = 14680068,
message_type = 467, format = 0, data = {
b = "\356\301
\005\000\000\000\000\066\004\000\000~\a\000\000\066\004\000", s = {-15890,
1312, 0, 0,
1078, 0, 1918, 0, 1078, 0}, l = {86032878, 8237747274806,
8237747274806, 163208757248,
94695438942209}}}, xmapping = {type = 2, serial = 76,
send_event = 0, display = 0x5620ca484c50,
window = 14680068, request = 467, first_keycode = 0, count = 0},
xerror = {type = 2, display = 0x4c,
resourceid = 94695438942208, serial = 94698832677968, error_code =
4 '\004', request_code = 0 '\000',
minor_code = 224 '\340'}, xkeymap = {type = 2, serial = 76,
send_event = 0, display = 0x5620ca484c50,
window = 14680068,
key_vector = "\323\001", '\000' <repeats 14 times>, "\356\301
\005\000\000\000\000\066\004\000\000~\a\000"}, xgeneric = {type = 2, serial =
76, send_event = 0, display = 0x5620ca484c50, extension = 14680068, evtype =
0},
xcookie = {type = 2, serial = 76, send_event = 0, display =
0x5620ca484c50, extension = 14680068,
evtype = 0, cookie = 467, data = 0x0}, pad = {94695438942210, 76,
94695438942208, 94698832677968,
14680068, 467, 0, 86032878, 8237747274806, 8237747274806,
163208757248, 94695438942209, 94698832901952,
94698832848528, 94698832854560, 94698832848464, 94698832848336,
94698832852640, 94698832893936,
94698832850752, 94698832896672, 94698832918784, 94698832850832,
94698832838240}}
#3 0x00005620c9f3f8f2 in main (argc=1, argv=0x7ffe624440c8) at dmenu.c:768
wa = {x = 0, y = 0, width = 2160, height = 3840, border_width = 0,
depth = 24, visual = 0x5620ca490340,
root = 467, class = 1, bit_gravity = 0, win_gravity = 1,
backing_store = 0, backing_planes = 4294967295,
backing_pixel = 0, save_under = 0, colormap = 32, map_installed = 1,
map_state = 2,
all_event_masks = 5898292, your_event_mask = 0, do_not_propagate_mask
= 0, override_redirect = 0,
screen = 0x5620ca486e20}
i = 1
fast = 0