cwm: libX11: SIGBUS

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

cwm: libX11: SIGBUS

Klemens Nanni-2
kern.version=3DOpenBSD 6.5-current (GENERIC.MP) #77: Fri Jun 28 10:59:55 MD=
T 2019
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

Running on a docked X230 with two external monitors, the internal one
being turned off.  See output of xrandr(1) at the end.

        $ cat ~/.cwmrc # redacted
        command foo "..."
        command bar "..."
        snapdist 8

In my usual workflow, I wanted to spawn a new terminal using the default
keybinding CM-Return but cwm(1) dumped core instead.

X kept running, just the window manager died.

Note that this is unpatched -current cwm(1);  mentioning it to clarify
since I sent diffs to tech@ just recently.

$ cd /usr/xenocara/app/cwm ; make DEBUG=3D-g
$ egdb -c ~/cwm.core -se ./obj/cwm -batch -ex bt full
[New process 350922]
Core was generated by `cwm'.
Program terminated with signal SIGBUS, Bus error.
#0  0x0000125b593cb2f9 in XAddExtension () from /usr/X11R6/lib/libX11.so.16=
=2E1
#0  0x0000125b593cb2f9 in XAddExtension () from /usr/X11R6/lib/libX11.so.16=
=2E1
No symbol table info available.
#1  0x0000125b65705f85 in _XftDisplayInfoGet () from /usr/X11R6/lib/libXft.=
so.11.0
No symbol table info available.
#2  0x0000125b65707db4 in XftDrawSrcPicture () from /usr/X11R6/lib/libXft.s=
o.11.0
No symbol table info available.
#3  0x0000125b657081a9 in XftDrawGlyphs () from /usr/X11R6/lib/libXft.so.11=
=2E0
No symbol table info available.
#4  0x0000125b65708852 in XftDrawStringUtf8 () from /usr/X11R6/lib/libXft.s=
o.11.0
No symbol table info available.
#5  0x00001258f140ee47 in menu_draw (mc=3D<optimized out>, menuq=3D0x7f7fff=
fd3970, resultq=3D<optimized out>) at /usr/xenocara/app/cwm/menu.c:399
        mi =3D <optimized out>
        extents =3D {width =3D 79, height =3D 11, x =3D 0, y =3D 11, xOff =
=3D 79, yOff =3D 0}
        sc =3D 0x125bc150ba00
        area =3D <optimized out>
        xsave =3D <optimized out>
        ysave =3D <optimized out>
        n =3D <error reading variable n (Cannot access memory at address 0x=
1)>
#6  menu_filter (sc=3D0x125bc150ba00, menuq=3D0x7f7ffffd3970, prompt=3D<opt=
imized out>, initial=3D<optimized out>, flags=3D<optimized out>, match=3D<o=
ptimized out>, print=3D0x1258f140fef0 <search_print_client>) at /usr/xenoca=
ra/app/cwm/menu.c:153
        mi =3D <optimized out>
        xsave =3D <optimized out>
        ysave =3D <optimized out>
        focuswin =3D 60817411
        focusrevert =3D 1
        e =3D <optimized out>
        resultq =3D <optimized out>
        xcur =3D <optimized out>
        ycur =3D <optimized out>
#7  0x00001258f1415572 in kbfunc_menu_client (ctx=3D0x125bc150ba00, cargs=
=3D<optimized out>) at /usr/xenocara/app/cwm/kbfunc.c:487
        sc =3D 0x125bc150ba00
        mflags =3D 0
        old_cc =3D 0x125afa722500
        cc =3D 0x7f7ffffd3970
        menuq =3D {tqh_first =3D 0x125b13253000, tqh_last =3D 0x125b13253a0=
0}
        mi =3D 0x125bad3a1000
#8  0x00001258f1413d6d in xev_process () at /usr/xenocara/app/cwm/xevents.c=
:491
        e =3D {type =3D 2, xany =3D {type =3D 2, serial =3D 48022, send_eve=
nt =3D 0, display =3D 0x125bc7c6a000, window =3D 316}, xkey =3D {type =3D 2=
, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =
=3D 316, root =3D 316, subwindow =3D 60817588, time =3D 233280998, x =3D 25=
44, y =3D 197, x_root =3D 2544, y_root =3D 197, state =3D 8, keycode =3D 61=
, same_screen =3D 1}, xbutton =3D {type =3D 2, serial =3D 48022, send_event=
 =3D 0, display =3D 0x125bc7c6a000, window =3D 316, root =3D 316, subwindow=
 =3D 60817588, time =3D 233280998, x =3D 2544, y =3D 197, x_root =3D 2544, =
y_root =3D 197, state =3D 8, button =3D 61, same_screen =3D 1}, xmotion =3D=
 {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a00=
0, window =3D 316, root =3D 316, subwindow =3D 60817588, time =3D 233280998=
, x =3D 2544, y =3D 197, x_root =3D 2544, y_root =3D 197, state =3D 8, is_h=
int =3D 61 '=3D', same_screen =3D 1}, xcrossing =3D {type =3D 2, serial =3D=
 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, root =
=3D 316, subwindow =3D 60817588, time =3D 233280998, x =3D 2544, y =3D 197,=
 x_root =3D 2544, y_root =3D 197, mode =3D 8, detail =3D 61, same_screen =
=3D 1, focus =3D 0, state =3D 0}, xfocus =3D {type =3D 2, serial =3D 48022,=
 send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, mode =3D 316=
, detail =3D 0}, xexpose =3D {type =3D 2, serial =3D 48022, send_event =3D =
0, display =3D 0x125bc7c6a000, window =3D 316, x =3D 316, y =3D 0, width =
=3D 60817588, height =3D 0, count =3D 233280998}, xgraphicsexpose =3D {type=
 =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, dra=
wable =3D 316, x =3D 316, y =3D 0, width =3D 60817588, height =3D 0, count =
=3D 233280998, major_code =3D 0, minor_code =3D 2544}, xnoexpose =3D {type =
=3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, draw=
able =3D 316, major_code =3D 316, minor_code =3D 0}, xvisibility =3D {type =
=3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, wind=
ow =3D 316, state =3D 316}, xcreatewindow =3D {type =3D 2, serial =3D 48022=
, send_event =3D 0, display =3D 0x125bc7c6a000, parent =3D 316, window =3D =
316, x =3D 60817588, y =3D 0, width =3D 233280998, height =3D 0, border_wid=
th =3D 2544, override_redirect =3D 197}, xdestroywindow =3D {type =3D 2, se=
rial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, event =3D 316=
, window =3D 316}, xunmap =3D {type =3D 2, serial =3D 48022, send_event =3D=
 0, display =3D 0x125bc7c6a000, event =3D 316, window =3D 316, from_configu=
re =3D 60817588}, xmap =3D {type =3D 2, serial =3D 48022, send_event =3D 0,=
 display =3D 0x125bc7c6a000, event =3D 316, window =3D 316, override_redire=
ct =3D 60817588}, xmaprequest =3D {type =3D 2, serial =3D 48022, send_event=
 =3D 0, display =3D 0x125bc7c6a000, parent =3D 316, window =3D 316}, xrepar=
ent =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125b=
c7c6a000, event =3D 316, window =3D 316, parent =3D 60817588, x =3D 2332809=
98, y =3D 0, override_redirect =3D 2544}, xconfigure =3D {type =3D 2, seria=
l =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, event =3D 316, w=
indow =3D 316, x =3D 60817588, y =3D 0, width =3D 233280998, height =3D 0, =
border_width =3D 2544, above =3D 846108559856, override_redirect =3D 8}, xg=
ravity =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x1=
25bc7c6a000, event =3D 316, window =3D 316, x =3D 60817588, y =3D 0}, xresi=
zerequest =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D =
0x125bc7c6a000, window =3D 316, width =3D 316, height =3D 0}, xconfigurereq=
uest =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125=
bc7c6a000, parent =3D 316, window =3D 316, x =3D 60817588, y =3D 0, width =
=3D 233280998, height =3D 0, border_width =3D 2544, above =3D 846108559856,=
 detail =3D 8, value_mask =3D 1}, xcirculate =3D {type =3D 2, serial =3D 48=
022, send_event =3D 0, display =3D 0x125bc7c6a000, event =3D 316, window =
=3D 316, place =3D 60817588}, xcirculaterequest =3D {type =3D 2, serial =3D=
 48022, send_event =3D 0, display =3D 0x125bc7c6a000, parent =3D 316, windo=
w =3D 316, place =3D 60817588}, xproperty =3D {type =3D 2, serial =3D 48022=
, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, atom =3D 31=
6, time =3D 60817588, state =3D 233280998}, xselectionclear =3D {type =3D 2=
, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =
=3D 316, selection =3D 316, time =3D 60817588}, xselectionrequest =3D {type=
 =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, own=
er =3D 316, requestor =3D 316, selection =3D 60817588, target =3D 233280998=
, property =3D 846108559856, time =3D 846108559856}, xselection =3D {type =
=3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, requ=
estor =3D 316, selection =3D 316, target =3D 60817588, property =3D 2332809=
98, time =3D 846108559856}, xcolormap =3D {type =3D 2, serial =3D 48022, se=
nd_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, colormap =3D 31=
6, new =3D 60817588, state =3D 0}, xclient =3D {type =3D 2, serial =3D 4802=
2, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, message_ty=
pe =3D 316, format =3D 60817588, data =3D {b =3D "\346\225\347\r\000\000\00=
0\000\360\t\000\000\305\000\000", <incomplete sequence \360\011\000>, s =3D=
 {-27162, 3559, 0, 0, 2544, 0, 197, 0, 2544, 0}, l =3D {233280998, 84610855=
9856, 846108559856, 261993005064, 1}}}, xmapping =3D {type =3D 2, serial =
=3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, re=
quest =3D 316, first_keycode =3D 0, count =3D 60817588}, xerror =3D {type =
=3D 2, display =3D 0xbb96, resourceid =3D 16131858539135107072, serial =3D =
20185403006976, error_code =3D 60 '<', request_code =3D 1 '\001', minor_cod=
e =3D 0 '\000'}, xkeymap =3D {type =3D 2, serial =3D 48022, send_event =3D =
0, display =3D 0x125bc7c6a000, window =3D 316, key_vector =3D "<\001\000\00=
0\000\000\000\000\264\000\240\003\000\000\000\000\346\225\347\r\000\000\000=
\000\360\t\000\000\305\000\000"}, xgeneric =3D {type =3D 2, serial =3D 4802=
2, send_event =3D 0, display =3D 0x125bc7c6a000, extension =3D 316, evtype =
=3D 0}, xcookie =3D {type =3D 2, serial =3D 48022, send_event =3D 0, displa=
y =3D 0x125bc7c6a000, extension =3D 316, evtype =3D 0, cookie =3D 316, data=
 =3D 0x3a000b4}, pad =3D {-2314885534574444542, 48022, -2314885534574444544=
, 20185403006976, 316, 316, 60817588, 233280998, 846108559856, 846108559856=
, 261993005064, 1, -2314885534574444544, -2314885530818453537 <repeats 11 t=
imes>}}
#9  0x00001258f140a605 in main (argc=3D<optimized out>, argv=3D<optimized o=
ut>) at /usr/xenocara/app/cwm/calmwm.c:114
        nflag =3D 0
        display_name =3D 0x0
        fallback =3D 0x125af7ba2490 "cwm"
        ch =3D <optimized out>
        xfd =3D <optimized out>
        pfd =3D <error reading variable pfd (Cannot access memory at addres=
s 0x0)>


$ xrandr
Screen 0: minimum 320 x 200, current 3000 x 1920, maximum 8192 x 8192
LVDS-1 connected primary (normal left inverted right x axis y axis)
   1366x768      60.10 +
   1280x720      60.00    59.99    59.86    59.74 =20
   1024x768      60.04    60.00 =20
   960x720       60.00 =20
   928x696       60.05 =20
   896x672       60.01 =20
   1024x576      59.95    59.96    59.90    59.82 =20
   960x600       59.93    60.00 =20
   960x540       59.96    59.99    59.63    59.82 =20
   800x600       60.00    60.32    56.25 =20
   840x525       60.01    59.88 =20
   864x486       59.92    59.57 =20
   700x525       59.98 =20
   800x450       59.95    59.82 =20
   640x512       60.02 =20
   700x450       59.96    59.88 =20
   640x480       60.00    59.94 =20
   720x405       59.51    58.99 =20
   684x384       59.88    59.85 =20
   640x400       59.88    59.98 =20
   640x360       59.86    59.83    59.84    59.32 =20
   512x384       60.00 =20
   512x288       60.00    59.92 =20
   480x270       59.63    59.82 =20
   400x300       60.32    56.34 =20
   432x243       59.92    59.57 =20
   320x240       60.05 =20
   360x202       59.51    59.13 =20
   320x180       59.84    59.32 =20
VGA-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)
HDMI-3 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 5=
09mm x 286mm
   1920x1080     60.00*+
   1600x900      60.00 =20
   1280x1024     75.02    60.02 =20
   1152x864      75.00 =20
   1024x768      75.03    60.00 =20
   800x600       75.00    60.32 =20
   640x480       75.00    59.94 =20
   720x400       70.08 =20
DP-2 connected 1080x1920+1920+0 left (normal left inverted right x axis y a=
xis) 509mm x 286mm
   1920x1080     60.00*+
   1600x900      60.00 =20
   1280x1024     75.02    60.02 =20
   1152x864      75.00 =20
   1024x768      75.03    60.00 =20
   800x600       75.00    60.32 =20
   640x480       75.00    59.94 =20
   720x400       70.08 =20
DP-3 disconnected (normal left inverted right x axis y axis)

Reply | Threaded
Open this post in threaded view
|

Re: cwm: libX11: SIGBUS

Klemens Nanni-2
On Tue, Jul 09, 2019 at 08:59:24AM +0200, Klemens Nanni wrote:
> $ cd /usr/xenocara/app/cwm ; make DEBUG=3D3D-g
> $ egdb -c ~/cwm.core -se ./obj/cwm -batch -ex bt full
> [New process 350922]
> Core was generated by `cwm'.
> Program terminated with signal SIGBUS, Bus error.
Pardon me for botching long lines here.  Resending anew for better
readability.

[New process 350922]
Core was generated by `cwm'.
Program terminated with signal SIGBUS, Bus error.
#0  0x0000125b593cb2f9 in XAddExtension () from /usr/X11R6/lib/libX11.so.16=
=2E1
#0  0x0000125b593cb2f9 in XAddExtension () from /usr/X11R6/lib/libX11.so.16=
=2E1
No symbol table info available.
#1  0x0000125b65705f85 in _XftDisplayInfoGet () from /usr/X11R6/lib/libXft.=
so.11.0
No symbol table info available.
#2  0x0000125b65707db4 in XftDrawSrcPicture () from /usr/X11R6/lib/libXft.s=
o.11.0
No symbol table info available.
#3  0x0000125b657081a9 in XftDrawGlyphs () from /usr/X11R6/lib/libXft.so.11=
=2E0
No symbol table info available.
#4  0x0000125b65708852 in XftDrawStringUtf8 () from /usr/X11R6/lib/libXft.s=
o.11.0
No symbol table info available.
#5  0x00001258f140ee47 in menu_draw (mc=3D<optimized out>, menuq=3D0x7f7fff=
fd3970, resultq=3D<optimized out>) at /usr/xenocara/app/cwm/menu.c:399
        mi =3D <optimized out>
        extents =3D {width =3D 79, height =3D 11, x =3D 0, y =3D 11, xOff =
=3D 79, yOff =3D 0}
        sc =3D 0x125bc150ba00
        area =3D <optimized out>
        xsave =3D <optimized out>
        ysave =3D <optimized out>
        n =3D <error reading variable n (Cannot access memory at address 0x=
1)>
#6  menu_filter (sc=3D0x125bc150ba00, menuq=3D0x7f7ffffd3970, prompt=3D<opt=
imized out>, initial=3D<optimized out>, flags=3D<optimized out>, match=3D<o=
ptimized out>, print=3D0x1258f140fef0 <search_print_client>) at /usr/xenoca=
ra/app/cwm/menu.c:153
        mi =3D <optimized out>
        xsave =3D <optimized out>
        ysave =3D <optimized out>
        focuswin =3D 60817411
        focusrevert =3D 1
        e =3D <optimized out>
        resultq =3D <optimized out>
        xcur =3D <optimized out>
        ycur =3D <optimized out>
#7  0x00001258f1415572 in kbfunc_menu_client (ctx=3D0x125bc150ba00, cargs=
=3D<optimized out>) at /usr/xenocara/app/cwm/kbfunc.c:487
        sc =3D 0x125bc150ba00
        mflags =3D 0
        old_cc =3D 0x125afa722500
        cc =3D 0x7f7ffffd3970
        menuq =3D {tqh_first =3D 0x125b13253000, tqh_last =3D 0x125b13253a0=
0}
        mi =3D 0x125bad3a1000
#8  0x00001258f1413d6d in xev_process () at /usr/xenocara/app/cwm/xevents.c=
:491
        e =3D {type =3D 2, xany =3D {type =3D 2, serial =3D 48022, send_eve=
nt =3D 0, display =3D 0x125bc7c6a000, window =3D 316}, xkey =3D {type =3D 2=
, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =
=3D 316, root =3D 316, subwindow =3D 60817588, time =3D 233280998, x =3D 25=
44, y =3D 197, x_root =3D 2544, y_root =3D 197, state =3D 8, keycode =3D 61=
, same_screen =3D 1}, xbutton =3D {type =3D 2, serial =3D 48022, send_event=
 =3D 0, display =3D 0x125bc7c6a000, window =3D 316, root =3D 316, subwindow=
 =3D 60817588, time =3D 233280998, x =3D 2544, y =3D 197, x_root =3D 2544, =
y_root =3D 197, state =3D 8, button =3D 61, same_screen =3D 1}, xmotion =3D=
 {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a00=
0, window =3D 316, root =3D 316, subwindow =3D 60817588, time =3D 233280998=
, x =3D 2544, y =3D 197, x_root =3D 2544, y_root =3D 197, state =3D 8, is_h=
int =3D 61 '=3D', same_screen =3D 1}, xcrossing =3D {type =3D 2, serial =3D=
 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, root =
=3D 316, subwindow =3D 60817588, time =3D 233280998, x =3D 2544, y =3D 197,=
 x_root =3D 2544, y_root =3D 197, mode =3D 8, detail =3D 61, same_screen =
=3D 1, focus =3D 0, state =3D 0}, xfocus =3D {type =3D 2, serial =3D 48022,=
 send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, mode =3D 316=
, detail =3D 0}, xexpose =3D {type =3D 2, serial =3D 48022, send_event =3D =
0, display =3D 0x125bc7c6a000, window =3D 316, x =3D 316, y =3D 0, width =
=3D 60817588, height =3D 0, count =3D 233280998}, xgraphicsexpose =3D {type=
 =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, dra=
wable =3D 316, x =3D 316, y =3D 0, width =3D 60817588, height =3D 0, count =
=3D 233280998, major_code =3D 0, minor_code =3D 2544}, xnoexpose =3D {type =
=3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, draw=
able =3D 316, major_code =3D 316, minor_code =3D 0}, xvisibility =3D {type =
=3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, wind=
ow =3D 316, state =3D 316}, xcreatewindow =3D {type =3D 2, serial =3D 48022=
, send_event =3D 0, display =3D 0x125bc7c6a000, parent =3D 316, window =3D =
316, x =3D 60817588, y =3D 0, width =3D 233280998, height =3D 0, border_wid=
th =3D 2544, override_redirect =3D 197}, xdestroywindow =3D {type =3D 2, se=
rial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, event =3D 316=
, window =3D 316}, xunmap =3D {type =3D 2, serial =3D 48022, send_event =3D=
 0, display =3D 0x125bc7c6a000, event =3D 316, window =3D 316, from_configu=
re =3D 60817588}, xmap =3D {type =3D 2, serial =3D 48022, send_event =3D 0,=
 display =3D 0x125bc7c6a000, event =3D 316, window =3D 316, override_redire=
ct =3D 60817588}, xmaprequest =3D {type =3D 2, serial =3D 48022, send_event=
 =3D 0, display =3D 0x125bc7c6a000, parent =3D 316, window =3D 316}, xrepar=
ent =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125b=
c7c6a000, event =3D 316, window =3D 316, parent =3D 60817588, x =3D 2332809=
98, y =3D 0, override_redirect =3D 2544}, xconfigure =3D {type =3D 2, seria=
l =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, event =3D 316, w=
indow =3D 316, x =3D 60817588, y =3D 0, width =3D 233280998, height =3D 0, =
border_width =3D 2544, above =3D 846108559856, override_redirect =3D 8}, xg=
ravity =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x1=
25bc7c6a000, event =3D 316, window =3D 316, x =3D 60817588, y =3D 0}, xresi=
zerequest =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D =
0x125bc7c6a000, window =3D 316, width =3D 316, height =3D 0}, xconfigurereq=
uest =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125=
bc7c6a000, parent =3D 316, window =3D 316, x =3D 60817588, y =3D 0, width =
=3D 233280998, height =3D 0, border_width =3D 2544, above =3D 846108559856,=
 detail =3D 8, value_mask =3D 1}, xcirculate =3D {type =3D 2, serial =3D 48=
022, send_event =3D 0, display =3D 0x125bc7c6a000, event =3D 316, window =
=3D 316, place =3D 60817588}, xcirculaterequest =3D {type =3D 2, serial =3D=
 48022, send_event =3D 0, display =3D 0x125bc7c6a000, parent =3D 316, windo=
w =3D 316, place =3D 60817588}, xproperty =3D {type =3D 2, serial =3D 48022=
, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, atom =3D 31=
6, time =3D 60817588, state =3D 233280998}, xselectionclear =3D {type =3D 2=
, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =
=3D 316, selection =3D 316, time =3D 60817588}, xselectionrequest =3D {type=
 =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, own=
er =3D 316, requestor =3D 316, selection =3D 60817588, target =3D 233280998=
, property =3D 846108559856, time =3D 846108559856}, xselection =3D {type =
=3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, requ=
estor =3D 316, selection =3D 316, target =3D 60817588, property =3D 2332809=
98, time =3D 846108559856}, xcolormap =3D {type =3D 2, serial =3D 48022, se=
nd_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, colormap =3D 31=
6, new =3D 60817588, state =3D 0}, xclient =3D {type =3D 2, serial =3D 4802=
2, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, message_ty=
pe =3D 316, format =3D 60817588, data =3D {b =3D "\346\225\347\r\000\000\00=
0\000\360\t\000\000\305\000\000", <incomplete sequence \360\011\000>, s =3D=
 {-27162, 3559, 0, 0, 2544, 0, 197, 0, 2544, 0}, l =3D {233280998, 84610855=
9856, 846108559856, 261993005064, 1}}}, xmapping =3D {type =3D 2, serial =
=3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, re=
quest =3D 316, first_keycode =3D 0, count =3D 60817588}, xerror =3D {type =
=3D 2, display =3D 0xbb96, resourceid =3D 16131858539135107072, serial =3D =
20185403006976, error_code =3D 60 '<', request_code =3D 1 '\001', minor_cod=
e =3D 0 '\000'}, xkeymap =3D {type =3D 2, serial =3D 48022, send_event =3D =
0, display =3D 0x125bc7c6a000, window =3D 316, key_vector =3D "<\001\000\00=
0\000\000\000\000\264\000\240\003\000\000\000\000\346\225\347\r\000\000\000=
\000\360\t\000\000\305\000\000"}, xgeneric =3D {type =3D 2, serial =3D 4802=
2, send_event =3D 0, display =3D 0x125bc7c6a000, extension =3D 316, evtype =
=3D 0}, xcookie =3D {type =3D 2, serial =3D 48022, send_event =3D 0, displa=
y =3D 0x125bc7c6a000, extension =3D 316, evtype =3D 0, cookie =3D 316, data=
 =3D 0x3a000b4}, pad =3D {-2314885534574444542, 48022, -2314885534574444544=
, 20185403006976, 316, 316, 60817588, 233280998, 846108559856, 846108559856=
, 261993005064, 1, -2314885534574444544, -2314885530818453537 <repeats 11 t=
imes>}}
#9  0x00001258f140a605 in main (argc=3D<optimized out>, argv=3D<optimized o=
ut>) at /usr/xenocara/app/cwm/calmwm.c:114
        nflag =3D 0
        display_name =3D 0x0
        fallback =3D 0x125af7ba2490 "cwm"
        ch =3D <optimized out>
        xfd =3D <optimized out>
        pfd =3D <error reading variable pfd (Cannot access memory at addres=
s 0x0)>

Reply | Threaded
Open this post in threaded view
|

Re: cwm: libX11: SIGBUS

Okan Demirmen
In reply to this post by Klemens Nanni-2
On Tue 2019.07.09 at 08:59 +0200, Klemens Nanni wrote:

> kern.version=3DOpenBSD 6.5-current (GENERIC.MP) #77: Fri Jun 28 10:59:55 MD=
> T 2019
>     [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>
> Running on a docked X230 with two external monitors, the internal one
> being turned off.  See output of xrandr(1) at the end.
>
> $ cat ~/.cwmrc # redacted
> command foo "..."
> command bar "..."
> snapdist 8
>
> In my usual workflow, I wanted to spawn a new terminal using the default
> keybinding CM-Return but cwm(1) dumped core instead.
>
> X kept running, just the window manager died.

Uhm; thanks for the report. I have a couple of questions.

I've never had a dock, thus never hooked up 2 addtional monitors;
however you note that the internal one is turned off - are you referring
to the LCD being off? in the xrandr output it is marked as primary.
Also, I'd have no idea how to turn off my lcd...is it just this
monitor configuration where cwm fails?

The trace below goes into menu_filter(), but you stated that the dump
came from the default CM-Return binding - that action does not touch any
of the menu paths, so how did you end up there, I wonder?

In the meantime I need to find a setup.

> Note that this is unpatched -current cwm(1);  mentioning it to clarify
> since I sent diffs to tech@ just recently.
>
> $ cd /usr/xenocara/app/cwm ; make DEBUG=3D-g
> $ egdb -c ~/cwm.core -se ./obj/cwm -batch -ex bt full
> [New process 350922]
> Core was generated by `cwm'.
> Program terminated with signal SIGBUS, Bus error.
> #0  0x0000125b593cb2f9 in XAddExtension () from /usr/X11R6/lib/libX11.so.16=
> =2E1
> #0  0x0000125b593cb2f9 in XAddExtension () from /usr/X11R6/lib/libX11.so.16=
> =2E1
> No symbol table info available.
> #1  0x0000125b65705f85 in _XftDisplayInfoGet () from /usr/X11R6/lib/libXft.=
> so.11.0
> No symbol table info available.
> #2  0x0000125b65707db4 in XftDrawSrcPicture () from /usr/X11R6/lib/libXft.s=
> o.11.0
> No symbol table info available.
> #3  0x0000125b657081a9 in XftDrawGlyphs () from /usr/X11R6/lib/libXft.so.11=
> =2E0
> No symbol table info available.
> #4  0x0000125b65708852 in XftDrawStringUtf8 () from /usr/X11R6/lib/libXft.s=
> o.11.0
> No symbol table info available.
> #5  0x00001258f140ee47 in menu_draw (mc=3D<optimized out>, menuq=3D0x7f7fff=
> fd3970, resultq=3D<optimized out>) at /usr/xenocara/app/cwm/menu.c:399
>         mi =3D <optimized out>
>         extents =3D {width =3D 79, height =3D 11, x =3D 0, y =3D 11, xOff =
> =3D 79, yOff =3D 0}
>         sc =3D 0x125bc150ba00
>         area =3D <optimized out>
>         xsave =3D <optimized out>
>         ysave =3D <optimized out>
>         n =3D <error reading variable n (Cannot access memory at address 0x=
> 1)>
> #6  menu_filter (sc=3D0x125bc150ba00, menuq=3D0x7f7ffffd3970, prompt=3D<opt=
> imized out>, initial=3D<optimized out>, flags=3D<optimized out>, match=3D<o=
> ptimized out>, print=3D0x1258f140fef0 <search_print_client>) at /usr/xenoca=
> ra/app/cwm/menu.c:153
>         mi =3D <optimized out>
>         xsave =3D <optimized out>
>         ysave =3D <optimized out>
>         focuswin =3D 60817411
>         focusrevert =3D 1
>         e =3D <optimized out>
>         resultq =3D <optimized out>
>         xcur =3D <optimized out>
>         ycur =3D <optimized out>
> #7  0x00001258f1415572 in kbfunc_menu_client (ctx=3D0x125bc150ba00, cargs=
> =3D<optimized out>) at /usr/xenocara/app/cwm/kbfunc.c:487
>         sc =3D 0x125bc150ba00
>         mflags =3D 0
>         old_cc =3D 0x125afa722500
>         cc =3D 0x7f7ffffd3970
>         menuq =3D {tqh_first =3D 0x125b13253000, tqh_last =3D 0x125b13253a0=
> 0}
>         mi =3D 0x125bad3a1000
> #8  0x00001258f1413d6d in xev_process () at /usr/xenocara/app/cwm/xevents.c=
> :491
>         e =3D {type =3D 2, xany =3D {type =3D 2, serial =3D 48022, send_eve=
> nt =3D 0, display =3D 0x125bc7c6a000, window =3D 316}, xkey =3D {type =3D 2=
> , serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =
> =3D 316, root =3D 316, subwindow =3D 60817588, time =3D 233280998, x =3D 25=
> 44, y =3D 197, x_root =3D 2544, y_root =3D 197, state =3D 8, keycode =3D 61=
> , same_screen =3D 1}, xbutton =3D {type =3D 2, serial =3D 48022, send_event=
>  =3D 0, display =3D 0x125bc7c6a000, window =3D 316, root =3D 316, subwindow=
>  =3D 60817588, time =3D 233280998, x =3D 2544, y =3D 197, x_root =3D 2544, =
> y_root =3D 197, state =3D 8, button =3D 61, same_screen =3D 1}, xmotion =3D=
>  {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a00=
> 0, window =3D 316, root =3D 316, subwindow =3D 60817588, time =3D 233280998=
> , x =3D 2544, y =3D 197, x_root =3D 2544, y_root =3D 197, state =3D 8, is_h=
> int =3D 61 '=3D', same_screen =3D 1}, xcrossing =3D {type =3D 2, serial =3D=
>  48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, root =
> =3D 316, subwindow =3D 60817588, time =3D 233280998, x =3D 2544, y =3D 197,=
>  x_root =3D 2544, y_root =3D 197, mode =3D 8, detail =3D 61, same_screen =
> =3D 1, focus =3D 0, state =3D 0}, xfocus =3D {type =3D 2, serial =3D 48022,=
>  send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, mode =3D 316=
> , detail =3D 0}, xexpose =3D {type =3D 2, serial =3D 48022, send_event =3D =
> 0, display =3D 0x125bc7c6a000, window =3D 316, x =3D 316, y =3D 0, width =
> =3D 60817588, height =3D 0, count =3D 233280998}, xgraphicsexpose =3D {type=
>  =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, dra=
> wable =3D 316, x =3D 316, y =3D 0, width =3D 60817588, height =3D 0, count =
> =3D 233280998, major_code =3D 0, minor_code =3D 2544}, xnoexpose =3D {type =
> =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, draw=
> able =3D 316, major_code =3D 316, minor_code =3D 0}, xvisibility =3D {type =
> =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, wind=
> ow =3D 316, state =3D 316}, xcreatewindow =3D {type =3D 2, serial =3D 48022=
> , send_event =3D 0, display =3D 0x125bc7c6a000, parent =3D 316, window =3D =
> 316, x =3D 60817588, y =3D 0, width =3D 233280998, height =3D 0, border_wid=
> th =3D 2544, override_redirect =3D 197}, xdestroywindow =3D {type =3D 2, se=
> rial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, event =3D 316=
> , window =3D 316}, xunmap =3D {type =3D 2, serial =3D 48022, send_event =3D=
>  0, display =3D 0x125bc7c6a000, event =3D 316, window =3D 316, from_configu=
> re =3D 60817588}, xmap =3D {type =3D 2, serial =3D 48022, send_event =3D 0,=
>  display =3D 0x125bc7c6a000, event =3D 316, window =3D 316, override_redire=
> ct =3D 60817588}, xmaprequest =3D {type =3D 2, serial =3D 48022, send_event=
>  =3D 0, display =3D 0x125bc7c6a000, parent =3D 316, window =3D 316}, xrepar=
> ent =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125b=
> c7c6a000, event =3D 316, window =3D 316, parent =3D 60817588, x =3D 2332809=
> 98, y =3D 0, override_redirect =3D 2544}, xconfigure =3D {type =3D 2, seria=
> l =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, event =3D 316, w=
> indow =3D 316, x =3D 60817588, y =3D 0, width =3D 233280998, height =3D 0, =
> border_width =3D 2544, above =3D 846108559856, override_redirect =3D 8}, xg=
> ravity =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x1=
> 25bc7c6a000, event =3D 316, window =3D 316, x =3D 60817588, y =3D 0}, xresi=
> zerequest =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D =
> 0x125bc7c6a000, window =3D 316, width =3D 316, height =3D 0}, xconfigurereq=
> uest =3D {type =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125=
> bc7c6a000, parent =3D 316, window =3D 316, x =3D 60817588, y =3D 0, width =
> =3D 233280998, height =3D 0, border_width =3D 2544, above =3D 846108559856,=
>  detail =3D 8, value_mask =3D 1}, xcirculate =3D {type =3D 2, serial =3D 48=
> 022, send_event =3D 0, display =3D 0x125bc7c6a000, event =3D 316, window =
> =3D 316, place =3D 60817588}, xcirculaterequest =3D {type =3D 2, serial =3D=
>  48022, send_event =3D 0, display =3D 0x125bc7c6a000, parent =3D 316, windo=
> w =3D 316, place =3D 60817588}, xproperty =3D {type =3D 2, serial =3D 48022=
> , send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, atom =3D 31=
> 6, time =3D 60817588, state =3D 233280998}, xselectionclear =3D {type =3D 2=
> , serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =
> =3D 316, selection =3D 316, time =3D 60817588}, xselectionrequest =3D {type=
>  =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, own=
> er =3D 316, requestor =3D 316, selection =3D 60817588, target =3D 233280998=
> , property =3D 846108559856, time =3D 846108559856}, xselection =3D {type =
> =3D 2, serial =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, requ=
> estor =3D 316, selection =3D 316, target =3D 60817588, property =3D 2332809=
> 98, time =3D 846108559856}, xcolormap =3D {type =3D 2, serial =3D 48022, se=
> nd_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, colormap =3D 31=
> 6, new =3D 60817588, state =3D 0}, xclient =3D {type =3D 2, serial =3D 4802=
> 2, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, message_ty=
> pe =3D 316, format =3D 60817588, data =3D {b =3D "\346\225\347\r\000\000\00=
> 0\000\360\t\000\000\305\000\000", <incomplete sequence \360\011\000>, s =3D=
>  {-27162, 3559, 0, 0, 2544, 0, 197, 0, 2544, 0}, l =3D {233280998, 84610855=
> 9856, 846108559856, 261993005064, 1}}}, xmapping =3D {type =3D 2, serial =
> =3D 48022, send_event =3D 0, display =3D 0x125bc7c6a000, window =3D 316, re=
> quest =3D 316, first_keycode =3D 0, count =3D 60817588}, xerror =3D {type =
> =3D 2, display =3D 0xbb96, resourceid =3D 16131858539135107072, serial =3D =
> 20185403006976, error_code =3D 60 '<', request_code =3D 1 '\001', minor_cod=
> e =3D 0 '\000'}, xkeymap =3D {type =3D 2, serial =3D 48022, send_event =3D =
> 0, display =3D 0x125bc7c6a000, window =3D 316, key_vector =3D "<\001\000\00=
> 0\000\000\000\000\264\000\240\003\000\000\000\000\346\225\347\r\000\000\000=
> \000\360\t\000\000\305\000\000"}, xgeneric =3D {type =3D 2, serial =3D 4802=
> 2, send_event =3D 0, display =3D 0x125bc7c6a000, extension =3D 316, evtype =
> =3D 0}, xcookie =3D {type =3D 2, serial =3D 48022, send_event =3D 0, displa=
> y =3D 0x125bc7c6a000, extension =3D 316, evtype =3D 0, cookie =3D 316, data=
>  =3D 0x3a000b4}, pad =3D {-2314885534574444542, 48022, -2314885534574444544=
> , 20185403006976, 316, 316, 60817588, 233280998, 846108559856, 846108559856=
> , 261993005064, 1, -2314885534574444544, -2314885530818453537 <repeats 11 t=
> imes>}}
> #9  0x00001258f140a605 in main (argc=3D<optimized out>, argv=3D<optimized o=
> ut>) at /usr/xenocara/app/cwm/calmwm.c:114
>         nflag =3D 0
>         display_name =3D 0x0
>         fallback =3D 0x125af7ba2490 "cwm"
>         ch =3D <optimized out>
>         xfd =3D <optimized out>
>         pfd =3D <error reading variable pfd (Cannot access memory at addres=
> s 0x0)>
>
>
> $ xrandr
> Screen 0: minimum 320 x 200, current 3000 x 1920, maximum 8192 x 8192
> LVDS-1 connected primary (normal left inverted right x axis y axis)
>    1366x768      60.10 +
>    1280x720      60.00    59.99    59.86    59.74 =20
>    1024x768      60.04    60.00 =20
>    960x720       60.00 =20
>    928x696       60.05 =20
>    896x672       60.01 =20
>    1024x576      59.95    59.96    59.90    59.82 =20
>    960x600       59.93    60.00 =20
>    960x540       59.96    59.99    59.63    59.82 =20
>    800x600       60.00    60.32    56.25 =20
>    840x525       60.01    59.88 =20
>    864x486       59.92    59.57 =20
>    700x525       59.98 =20
>    800x450       59.95    59.82 =20
>    640x512       60.02 =20
>    700x450       59.96    59.88 =20
>    640x480       60.00    59.94 =20
>    720x405       59.51    58.99 =20
>    684x384       59.88    59.85 =20
>    640x400       59.88    59.98 =20
>    640x360       59.86    59.83    59.84    59.32 =20
>    512x384       60.00 =20
>    512x288       60.00    59.92 =20
>    480x270       59.63    59.82 =20
>    400x300       60.32    56.34 =20
>    432x243       59.92    59.57 =20
>    320x240       60.05 =20
>    360x202       59.51    59.13 =20
>    320x180       59.84    59.32 =20
> VGA-1 disconnected (normal left inverted right x axis y axis)
> HDMI-1 disconnected (normal left inverted right x axis y axis)
> DP-1 disconnected (normal left inverted right x axis y axis)
> HDMI-2 disconnected (normal left inverted right x axis y axis)
> HDMI-3 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 5=
> 09mm x 286mm
>    1920x1080     60.00*+
>    1600x900      60.00 =20
>    1280x1024     75.02    60.02 =20
>    1152x864      75.00 =20
>    1024x768      75.03    60.00 =20
>    800x600       75.00    60.32 =20
>    640x480       75.00    59.94 =20
>    720x400       70.08 =20
> DP-2 connected 1080x1920+1920+0 left (normal left inverted right x axis y a=
> xis) 509mm x 286mm
>    1920x1080     60.00*+
>    1600x900      60.00 =20
>    1280x1024     75.02    60.02 =20
>    1152x864      75.00 =20
>    1024x768      75.03    60.00 =20
>    800x600       75.00    60.32 =20
>    640x480       75.00    59.94 =20
>    720x400       70.08 =20
> DP-3 disconnected (normal left inverted right x axis y axis)
>

Reply | Threaded
Open this post in threaded view
|

Re: cwm: libX11: SIGBUS

Klemens Nanni-2
On Tue, Jul 09, 2019 at 08:07:14AM -0400, Okan Demirmen wrote:
> I've never had a dock, thus never hooked up 2 addtional monitors;
> however you note that the internal one is turned off - are you referring
> to the LCD being off? in the xrandr output it is marked as primary.
Good catch, thanks.  Yes, I change display configuration through
arandr(1) to transition between notebook (LVDS-1) and workplace (HDMI-3,
DP-2) mode so to speak.  But I always forget marking one of the external
ones as primary - without noticing, that is.  So that's how the internal
LCD ends up off but still primary.

> Also, I'd have no idea how to turn off my lcd...is it just this
> monitor configuration where cwm fails?
`xrandr --output LVDS-1 --off ...' where ... ensure that at least one
other output is on.

It never crashed before and I do not know yet how to reproduce it.

> The trace below goes into menu_filter(), but you stated that the dump
> came from the default CM-Return binding - that action does not touch any
> of the menu paths, so how did you end up there, I wonder?
Oh, I must have striked another combination before knowlingly trying to
spawn a terminal as my last action before the crash, sorry for the
confusion.

> In the meantime I need to find a setup.
Sounds good;  I found other bugs related to multihead setups as well,
just didn't find the time to write proper reports.

Reply | Threaded
Open this post in threaded view
|

Re: cwm: libX11: SIGBUS

Klemens Nanni-2
In reply to this post by Klemens Nanni-2
Here is a reproducer as well as a complete backtrace.

My current setup consists of a X230 on a docking station with one
external monitor connected via DVI-D (shows up as HDMI-2 in xrandr).

This monitor is a bit special since it lacks proper EDID, so I have to
add modelines manually.  The two one-liners are included here for the
sake of completeness, but keep in mind that this crash also happens with
a completely different setup with completely distinct monitors which do
provide EDID and work out of the box.

Running snapshot from

        OpenBSD 6.5-current (GENERIC.MP) #170: Sat Aug  3 09:50:56 MDT 2019
            [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

with `vm.malloc_conf=CFGSU' and cwm, libX11, libXft built with `-g3 -O0'.

Steps to reproduce:

1. add manualmodeline

        xrandr --newmode "2560x1440_30.00"  146.27  2560 2680 2944 3328  1440 1441 1444 1465  -HSync +Vsync
        xrandr --addmode HDMI-2 2560x1440_30.00

2. enable external monitor, keep internal one as secondary

        xrandr --output HDMI-2 --primary --rotation inverted --above LVDS-1 --auto --output LVDS-1

3. run a fullscreen program (starts on primary)

        0ad

4. while in fullscreen, press M-/ (Alt slash with default cwm)

cwm crashes and I drop to the xenodm login.

Without restarting X itself, the external monitor seemingly keeps its
modelines configured since it continues to show all black, but it is not
configured as part of my screen any longer.

But strangely, I can see the half of my mouse cursor showing up on it
when moving along.  Simply rerunning step 2. to configure the screen
fails:

        xrandr: Output HDMI-2 is not disconnected but has no modes
        xrandr: cannot find preferred mode

Restarting X (read: xenodm) resets everything and I can run steps 1. and
2. to get everything working again.

My other setups include two external monitors with the internal one
turned off, I have yet to find a reproducer that does not include a
fullscreen program like 0ad, but it the same crash appeared there as
well.

See backtraced below and a full version attached.

[New process 212650]
Core was generated by `cwm'.
Program terminated with signal SIGBUS, Bus error.
#0  0x00000bbbe340a01d in XAddExtension (dpy=0xdfdfdfdfdfdfdfdf) at /usr/xenocara/lib/libX11/src/InitExt.c:73
73    LockDisplay (dpy);
#0  0x00000bbbe340a01d in XAddExtension (dpy=0xdfdfdfdfdfdfdfdf) at /usr/xenocara/lib/libX11/src/InitExt.c:73
#1  0x00000bbbd2ff48f9 in _XftDisplayInfoGet (dpy=0xdfdfdfdfdfdfdfdf, createIfNecessary=1) at /usr/xenocara/lib/libXft/src/xftdpy.c:91
#2  0x00000bbbd2ff6a19 in XftDrawSrcPicture (draw=0xbbb46fd7600, color=0xbbbed59cb28) at /usr/xenocara/lib/libXft/src/xftdraw.c:300
#3  0x00000bbbd2ff6fdb in XftDrawGlyphs (draw=0xbbb46fd7600, color=0xbbbed59cb28, pub=0xbbbfd21f000, x=0, y=13, glyphs=0x7f7fffff8ad0, nglyphs=8) at /usr/xenocara/lib/libXft/src/xftdraw.c:484
#4  0x00000bbbd2ff78ec in XftDrawStringUtf8 (draw=0xbbb46fd7600, color=0xbbbed59cb28, pub=0xbbbfd21f000, x=0, y=13, string=0x7f7fffff9eeb "", len=0) at /usr/xenocara/lib/libXft/src/xftdraw.c:621
#5  0x00000bb9389bdfdd in menu_draw (mc=0x7f7fffff9df0, menuq=0x7f7fffffa1c8, resultq=0x7f7fffff9de0) at /x/app/cwm/menu.c:399
#6  0x00000bb9389bd12f in menu_filter (sc=0xbbbed59ca00, menuq=0x7f7fffffa1c8, prompt=0xbb9389b349f "window", initial=0x0, flags=0, match=0xbb9389bef00 <search_match_client>, print=0xbb9389bfb20 <search_print_client>) at /x/app/cwm/menu.c:153
#7  0x00000bb9389c7a16 in kbfunc_menu_client (ctx=0xbbbed59ca00, cargs=0xbbb9b36c780) at /x/app/cwm/kbfunc.c:484
#8  0x00000bb9389c3ffa in xev_handle_keypress (ee=0x7f7fffffa2a8) at /x/app/cwm/xevents.c:336
#9  0x00000bb9389c519d in xev_process () at /x/app/cwm/xevents.c:491
#10 0x00000bb9389b763f in main (argc=0, argv=0x7f7fffffa450) at /x/app/cwm/calmwm.c:114

Reply | Threaded
Open this post in threaded view
|

Re: cwm: libX11: SIGBUS

Matthieu Herrb-3
On Sun, Aug 04, 2019 at 12:32:12PM +0200, Klemens Nanni wrote:
> Here is a reproducer as well as a complete backtrace.

Did you try with the updates to libX11 and libXft that I sent to tech@
a few weeks ago ? There is one change in libXft which may be relevant.

>
> My current setup consists of a X230 on a docking station with one
> external monitor connected via DVI-D (shows up as HDMI-2 in xrandr).
>
> This monitor is a bit special since it lacks proper EDID, so I have to
> add modelines manually.  The two one-liners are included here for the
> sake of completeness, but keep in mind that this crash also happens with
> a completely different setup with completely distinct monitors which do
> provide EDID and work out of the box.
>
> Running snapshot from
>
> OpenBSD 6.5-current (GENERIC.MP) #170: Sat Aug  3 09:50:56 MDT 2019
>    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>
> with `vm.malloc_conf=CFGSU' and cwm, libX11, libXft built with `-g3 -O0'.
>
> Steps to reproduce:
>
> 1. add manualmodeline
>
> xrandr --newmode "2560x1440_30.00"  146.27  2560 2680 2944 3328  1440 1441 1444 1465  -HSync +Vsync
> xrandr --addmode HDMI-2 2560x1440_30.00
>
> 2. enable external monitor, keep internal one as secondary
>
> xrandr --output HDMI-2 --primary --rotation inverted --above LVDS-1 --auto --output LVDS-1
>
> 3. run a fullscreen program (starts on primary)
>
> 0ad
>
> 4. while in fullscreen, press M-/ (Alt slash with default cwm)
>
> cwm crashes and I drop to the xenodm login.
>
> Without restarting X itself, the external monitor seemingly keeps its
> modelines configured since it continues to show all black, but it is not
> configured as part of my screen any longer.
>
> But strangely, I can see the half of my mouse cursor showing up on it
> when moving along.  Simply rerunning step 2. to configure the screen
> fails:
>
> xrandr: Output HDMI-2 is not disconnected but has no modes
> xrandr: cannot find preferred mode
>
> Restarting X (read: xenodm) resets everything and I can run steps 1. and
> 2. to get everything working again.
>
> My other setups include two external monitors with the internal one
> turned off, I have yet to find a reproducer that does not include a
> fullscreen program like 0ad, but it the same crash appeared there as
> well.
>
> See backtraced below and a full version attached.
>
> [New process 212650]
> Core was generated by `cwm'.
> Program terminated with signal SIGBUS, Bus error.
> #0  0x00000bbbe340a01d in XAddExtension (dpy=0xdfdfdfdfdfdfdfdf) at /usr/xenocara/lib/libX11/src/InitExt.c:73
> 73    LockDisplay (dpy);
> #0  0x00000bbbe340a01d in XAddExtension (dpy=0xdfdfdfdfdfdfdfdf) at /usr/xenocara/lib/libX11/src/InitExt.c:73
> #1  0x00000bbbd2ff48f9 in _XftDisplayInfoGet (dpy=0xdfdfdfdfdfdfdfdf, createIfNecessary=1) at /usr/xenocara/lib/libXft/src/xftdpy.c:91
> #2  0x00000bbbd2ff6a19 in XftDrawSrcPicture (draw=0xbbb46fd7600, color=0xbbbed59cb28) at /usr/xenocara/lib/libXft/src/xftdraw.c:300
> #3  0x00000bbbd2ff6fdb in XftDrawGlyphs (draw=0xbbb46fd7600, color=0xbbbed59cb28, pub=0xbbbfd21f000, x=0, y=13, glyphs=0x7f7fffff8ad0, nglyphs=8) at /usr/xenocara/lib/libXft/src/xftdraw.c:484
> #4  0x00000bbbd2ff78ec in XftDrawStringUtf8 (draw=0xbbb46fd7600, color=0xbbbed59cb28, pub=0xbbbfd21f000, x=0, y=13, string=0x7f7fffff9eeb "", len=0) at /usr/xenocara/lib/libXft/src/xftdraw.c:621
> #5  0x00000bb9389bdfdd in menu_draw (mc=0x7f7fffff9df0, menuq=0x7f7fffffa1c8, resultq=0x7f7fffff9de0) at /x/app/cwm/menu.c:399
> #6  0x00000bb9389bd12f in menu_filter (sc=0xbbbed59ca00, menuq=0x7f7fffffa1c8, prompt=0xbb9389b349f "window", initial=0x0, flags=0, match=0xbb9389bef00 <search_match_client>, print=0xbb9389bfb20 <search_print_client>) at /x/app/cwm/menu.c:153
> #7  0x00000bb9389c7a16 in kbfunc_menu_client (ctx=0xbbbed59ca00, cargs=0xbbb9b36c780) at /x/app/cwm/kbfunc.c:484
> #8  0x00000bb9389c3ffa in xev_handle_keypress (ee=0x7f7fffffa2a8) at /x/app/cwm/xevents.c:336
> #9  0x00000bb9389c519d in xev_process () at /x/app/cwm/xevents.c:491
> #10 0x00000bb9389b763f in main (argc=0, argv=0x7f7fffffa450) at /x/app/cwm/calmwm.c:114

--
Matthieu Herrb

Reply | Threaded
Open this post in threaded view
|

Re: cwm: libX11: SIGBUS

Klemens Nanni-2
On Sun, Aug 04, 2019 at 12:40:50PM +0200, Matthieu Herrb wrote:
> Did you try with the updates to libX11 and libXft that I sent to tech@
> a few weeks ago ? There is one change in libXft which may be relevant.
No, missed them.  Just fetched your updates from current CVS, rebuilt
libX11 and libXft, but with no avail.

Same reproducer, same bug.  New backtrace below and full one attached
(for real this time, sorry).


[New process 238882]
Core was generated by `cwm'.
Program terminated with signal SIGBUS, Bus error.
#0  0x00000261a2f9101d in XAddExtension (dpy=0xdfdfdfdfdfdfdfdf) at /usr/xenocara/lib/libX11/src/InitExt.c:73
73    LockDisplay (dpy);
#0  0x00000261a2f9101d in XAddExtension (dpy=0xdfdfdfdfdfdfdfdf) at /usr/xenocara/lib/libX11/src/InitExt.c:73
#1  0x0000026265e448f9 in _XftDisplayInfoGet () from /usr/X11R6/lib/libXft.so.11.0
#2  0x0000026265e46a49 in XftDrawSrcPicture () from /usr/X11R6/lib/libXft.so.11.0
#3  0x0000026265e470cb in XftDrawGlyphs () from /usr/X11R6/lib/libXft.so.11.0
#4  0x0000026265e479dc in XftDrawStringUtf8 () from /usr/X11R6/lib/libXft.so.11.0
#5  0x0000025f92282fdd in menu_draw (mc=0x7f7ffffdd570, menuq=0x7f7ffffdd948, resultq=0x7f7ffffdd560) at /x/app/cwm/menu.c:399
#6  0x0000025f9228212f in menu_filter (sc=0x26197db1000, menuq=0x7f7ffffdd948, prompt=0x25f9227849f "window", initial=0x0, flags=0, match=0x25f92283f00 <search_match_client>, print=0x25f92284b20 <search_print_client>) at /x/app/cwm/menu.c:153
#7  0x0000025f9228ca16 in kbfunc_menu_client (ctx=0x26197db1000, cargs=0x261ab1b6280) at /x/app/cwm/kbfunc.c:484
#8  0x0000025f92288ffa in xev_handle_keypress (ee=0x7f7ffffdda28) at /x/app/cwm/xevents.c:336
#9  0x0000025f9228a19d in xev_process () at /x/app/cwm/xevents.c:491
#10 0x0000025f9227c63f in main (argc=0, argv=0x7f7ffffddbd0) at /x/app/cwm/calmwm.c:114

cwm.bt_full (18K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: cwm: libX11: SIGBUS

Matthieu Herrb-3
On Sun, Aug 04, 2019 at 04:25:03PM +0200, Klemens Nanni wrote:
> On Sun, Aug 04, 2019 at 12:40:50PM +0200, Matthieu Herrb wrote:
> > Did you try with the updates to libX11 and libXft that I sent to tech@
> > a few weeks ago ? There is one change in libXft which may be relevant.
> No, missed them.  Just fetched your updates from current CVS, rebuilt
> libX11 and libXft, but with no avail.
>
> Same reproducer, same bug.  New backtrace below and full one attached
> (for real this time, sorry).
>

Ok. Thanks.

The 0xdfdfdf clearly shows that it's accessing a DISPLAY* that has been
free'd  But I can't tell if the bug is inside cwm, or if it's libX11/libXft
that gets confused.

I don't tink that cwm is playing games with multiple displays (Xinerama)
when you add more xrandr screens, so normally it should have only one
DISPLAY. But I may be wrong.


>
> [New process 238882]
> Core was generated by `cwm'.
> Program terminated with signal SIGBUS, Bus error.
> #0  0x00000261a2f9101d in XAddExtension (dpy=0xdfdfdfdfdfdfdfdf) at /usr/xenocara/lib/libX11/src/InitExt.c:73
> 73    LockDisplay (dpy);
> #0  0x00000261a2f9101d in XAddExtension (dpy=0xdfdfdfdfdfdfdfdf) at /usr/xenocara/lib/libX11/src/InitExt.c:73
> #1  0x0000026265e448f9 in _XftDisplayInfoGet () from /usr/X11R6/lib/libXft.so.11.0
> #2  0x0000026265e46a49 in XftDrawSrcPicture () from /usr/X11R6/lib/libXft.so.11.0
> #3  0x0000026265e470cb in XftDrawGlyphs () from /usr/X11R6/lib/libXft.so.11.0
> #4  0x0000026265e479dc in XftDrawStringUtf8 () from /usr/X11R6/lib/libXft.so.11.0
> #5  0x0000025f92282fdd in menu_draw (mc=0x7f7ffffdd570, menuq=0x7f7ffffdd948, resultq=0x7f7ffffdd560) at /x/app/cwm/menu.c:399
> #6  0x0000025f9228212f in menu_filter (sc=0x26197db1000, menuq=0x7f7ffffdd948, prompt=0x25f9227849f "window", initial=0x0, flags=0, match=0x25f92283f00 <search_match_client>, print=0x25f92284b20 <search_print_client>) at /x/app/cwm/menu.c:153
> #7  0x0000025f9228ca16 in kbfunc_menu_client (ctx=0x26197db1000, cargs=0x261ab1b6280) at /x/app/cwm/kbfunc.c:484
> #8  0x0000025f92288ffa in xev_handle_keypress (ee=0x7f7ffffdda28) at /x/app/cwm/xevents.c:336
> #9  0x0000025f9228a19d in xev_process () at /x/app/cwm/xevents.c:491
> #10 0x0000025f9227c63f in main (argc=0, argv=0x7f7ffffddbd0) at /x/app/cwm/calmwm.c:114
--
Matthieu Herrb

Reply | Threaded
Open this post in threaded view
|

Re: cwm: libX11: SIGBUS

Mark Kettenis
In reply to this post by Klemens Nanni-2
> Date: Sun, 4 Aug 2019 16:25:03 +0200
> From: Klemens Nanni <[hidden email]>
>
> On Sun, Aug 04, 2019 at 12:40:50PM +0200, Matthieu Herrb wrote:
> > Did you try with the updates to libX11 and libXft that I sent to tech@
> > a few weeks ago ? There is one change in libXft which may be relevant.
> No, missed them.  Just fetched your updates from current CVS, rebuilt
> libX11 and libXft, but with no avail.
>
> Same reproducer, same bug.  New backtrace below and full one attached
> (for real this time, sorry).

0xdfdfdfdfdfdfdfdf is the tell-tale sign of a use-after free.

The Display is just passed on by the various libXft functions, as part
of the XftDraw instance.  So my bet is on this being a bug in cmw.
Indeed, if you look at menu_filter() you'll see there is a:

        if (XGrabPointer(X_Dpy, mc.win, False, MENUGRABMASK,
            GrabModeAsync, GrabModeAsync, None, Conf.cursor[CF_QUESTION],
            CurrentTime) != GrabSuccess) {
                XftDrawDestroy(mc.xftdraw);
                XDestroyWindow(X_Dpy, mc.win);
        }

block near the start.  If you hit that, the XftDraw instance gets
freed.  But ten it may be used later in the menu_draw() call.

Cheers,

Mark


> [New process 238882]
> Core was generated by `cwm'.
> Program terminated with signal SIGBUS, Bus error.
> #0  0x00000261a2f9101d in XAddExtension (dpy=0xdfdfdfdfdfdfdfdf) at /usr/xenocara/lib/libX11/src/InitExt.c:73
> 73    LockDisplay (dpy);
> #0  0x00000261a2f9101d in XAddExtension (dpy=0xdfdfdfdfdfdfdfdf) at /usr/xenocara/lib/libX11/src/InitExt.c:73
> #1  0x0000026265e448f9 in _XftDisplayInfoGet () from /usr/X11R6/lib/libXft.so.11.0
> #2  0x0000026265e46a49 in XftDrawSrcPicture () from /usr/X11R6/lib/libXft.so.11.0
> #3  0x0000026265e470cb in XftDrawGlyphs () from /usr/X11R6/lib/libXft.so.11.0
> #4  0x0000026265e479dc in XftDrawStringUtf8 () from /usr/X11R6/lib/libXft.so.11.0
> #5  0x0000025f92282fdd in menu_draw (mc=0x7f7ffffdd570, menuq=0x7f7ffffdd948, resultq=0x7f7ffffdd560) at /x/app/cwm/menu.c:399
> #6  0x0000025f9228212f in menu_filter (sc=0x26197db1000, menuq=0x7f7ffffdd948, prompt=0x25f9227849f "window", initial=0x0, flags=0, match=0x25f92283f00 <search_match_client>, print=0x25f92284b20 <search_print_client>) at /x/app/cwm/menu.c:153
> #7  0x0000025f9228ca16 in kbfunc_menu_client (ctx=0x26197db1000, cargs=0x261ab1b6280) at /x/app/cwm/kbfunc.c:484
> #8  0x0000025f92288ffa in xev_handle_keypress (ee=0x7f7ffffdda28) at /x/app/cwm/xevents.c:336
> #9  0x0000025f9228a19d in xev_process () at /x/app/cwm/xevents.c:491
> #10 0x0000025f9227c63f in main (argc=0, argv=0x7f7ffffddbd0) at /x/app/cwm/calmwm.c:114
>
> [2:text/plain Show Save:cwm.bt_full (43kB)]
>

Reply | Threaded
Open this post in threaded view
|

Re: cwm: libX11: SIGBUS

Okan Demirmen
On Sun 2019.08.04 at 17:05 +0200, Mark Kettenis wrote:

> > Date: Sun, 4 Aug 2019 16:25:03 +0200
> > From: Klemens Nanni <[hidden email]>
> >
> > On Sun, Aug 04, 2019 at 12:40:50PM +0200, Matthieu Herrb wrote:
> > > Did you try with the updates to libX11 and libXft that I sent to tech@
> > > a few weeks ago ? There is one change in libXft which may be relevant.
> > No, missed them.  Just fetched your updates from current CVS, rebuilt
> > libX11 and libXft, but with no avail.
> >
> > Same reproducer, same bug.  New backtrace below and full one attached
> > (for real this time, sorry).
>
> 0xdfdfdfdfdfdfdfdf is the tell-tale sign of a use-after free.
>
> The Display is just passed on by the various libXft functions, as part
> of the XftDraw instance.  So my bet is on this being a bug in cmw.
> Indeed, if you look at menu_filter() you'll see there is a:
>
>         if (XGrabPointer(X_Dpy, mc.win, False, MENUGRABMASK,
>             GrabModeAsync, GrabModeAsync, None, Conf.cursor[CF_QUESTION],
>             CurrentTime) != GrabSuccess) {
>                 XftDrawDestroy(mc.xftdraw);
>                 XDestroyWindow(X_Dpy, mc.win);
>         }
>
> block near the start.  If you hit that, the XftDraw instance gets
> freed.  But ten it may be used later in the menu_draw() call.
>
> Cheers,
>
> Mark

Thanks! It seems I lost the return when shuffling last. Never hit this
case because I've yet to run into an app that grabs basically
everything...until you pointed me to this game :)

Can you give this a shot kn?

Index: menu.c
===================================================================
RCS file: /home/open/cvs/xenocara/app/cwm/menu.c,v
retrieving revision 1.107
diff -u -p -r1.107 menu.c
--- menu.c 4 Mar 2019 19:28:18 -0000 1.107
+++ menu.c 5 Aug 2019 20:58:08 -0000
@@ -129,6 +129,7 @@ menu_filter(struct screen_ctx *sc, struc
     CurrentTime) != GrabSuccess) {
  XftDrawDestroy(mc.xftdraw);
  XDestroyWindow(X_Dpy, mc.win);
+ return(NULL);
  }
 
  XGetInputFocus(X_Dpy, &focuswin, &focusrevert);