conformal / spectrwm

A small dynamic tiling window manager for X11.
ISC License
1.33k stars 97 forks source link

Segfault withlayout layout definition #38

Closed levaidaniel closed 10 years ago

levaidaniel commented 10 years ago

When configuring a layout, specifying a master_grow value other than 0 results in a segfault. Backtrace inline.

Also, in the manual, it says

layout

The layout keyword after stack_inc is probably rogue. At least the error message spectrwm prints out to the console when it fails to start because of an invalid layout definition doesn't include that (also I can not imagine what would that be).

Reading symbols from /usr/local/bin/spectrwm...done.
[New LWP 11445]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/local/bin/spectrwm'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000000000040cf88 in stack () at spectrwm.c:4443
4443                                    val[0] = r_prev->bar->id;
(gdb) bt full
#0  0x000000000040cf88 in stack () at spectrwm.c:4443
        g = {x = 1600, y = 0, w = 1918, h = 1078}
        r = 0xf868f0
        r_prev = 0xf868a0
        i = 0
        num_screens = 1
        val = {6291485, 0}
#1  0x000000000041644d in setlayout (selector=0x0, value=0xfaba79 "ws[4]:12:0:0:0:vertical", flags=0) at spectrwm.c:8314
        ws_id = 3
        i = 0
        x = 0
        mg = 12
        ma = 0
        si = 0
        ar = 0
        f = 0
        st = 0
        num_screens = 1
        s = "vertical", '\000' <repeats 1015 times>
        ws = 0xf854c0
#2  0x0000000000416b3e in conf_load (filename=0x7ffff4b73f70 "/home/daniell/.spectrwm.conf", keymapping=0) at spectrwm.c:8537
        config = 0xfac030
        line = 0xfaba70 "layout = ws[4]:12:0:0:0:vertical"
        cp = 0xfaba79 "ws[4]:12:0:0:0:vertical"
        ce = 0x7ffff4b73f70 "/home/daniell/.spectrwm.conf"
        optsub = 0x0
        optval = 0xfaba79 "ws[4]:12:0:0:0:vertical"
        linelen = 32
        lineno = 35
        wordlen = 6
        i = 33
        optidx = 33
        count = 0
        opt = 0x6243d8 <configopt+792>
#3  0x000000000041b642 in main (argc=1, argv=0x7ffff4b75078) at spectrwm.c:10724
        r = 0x0
        conf = "/home/daniell/.spectrwm.conf\000\000\000\000\361\016\000\000\000\000\067\355\nS", '\000' <repeats 12 times>, "\373\253*S\000\000\000\000\313aC-\000\000\000\000\004\222\230\357\354\177\000\000\000\000\000\000\000\000\000\000\226\213Y\354\354\177\000\000\000\000\000\000\000\000\000\000\372\f\230\357\354\177\000\000(j\267\357\354\177\000\000\000\000\000\000\000\000\000\000`\260\271\357\354\177\000\000 \000\000\000\001", '\000' <repeats 12 times>, "\016\230\357\354\177\000\000\000\000\000\000\377\177\000\000\200@\267\364\377\177\000\000\000\000\000\000\000\000\000\000\240\361\377\177\001", '\000' <repeats 11 times>, "\n"...
        cfile = 0x7ffff4b73f70 "/home/daniell/.spectrwm.conf"
        sb = {st_dev = 24, st_ino = 3146338, st_nlink = 1, st_mode = 33204, st_uid = 1001, st_gid = 1001, __pad0 = 0, st_rdev = 0, st_size = 4202, st_blksize = 4096, st_blocks = 32, st_atim = {
            tv_sec = 1395329057, tv_nsec = 952377307}, st_mtim = {tv_sec = 1395329056, tv_nsec = 175377351}, st_ctim = {tv_sec = 1395329056, tv_nsec = 180377351}, __glibc_reserved = {0, 0, 0}}
        xfd = 3
        i = 0
        num_screens = 0
        startup = 1
        sact = {__sigaction_handler = {sa_handler = 0x406a8c <sighdlr>, sa_sigaction = 0x406a8c <sighdlr>}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 1, sa_restorer = 0x0}
        evt = 0x0
        tv = {tv_sec = 0, tv_usec = 0}
        rd = {fds_bits = {0 <repeats 13 times>, 32, 47, 140655608741273}}
        rd_max = 0
        stdin_ready = 0
        num_readable = 0
(gdb) bt
#0  0x000000000040cf88 in stack () at spectrwm.c:4443
#1  0x000000000041644d in setlayout (selector=0x0, value=0xfaba79 "ws[4]:12:0:0:0:vertical", flags=0) at spectrwm.c:8314
#2  0x0000000000416b3e in conf_load (filename=0x7ffff4b73f70 "/home/daniell/.spectrwm.conf", keymapping=0) at spectrwm.c:8537
#3  0x000000000041b642 in main (argc=1, argv=0x7ffff4b75078) at spectrwm.c:10724
(gdb) frame 0
#0  0x000000000040cf88 in stack () at spectrwm.c:4443
4443                                    val[0] = r_prev->bar->id;
(gdb) list
4438                                        "relative to %#x.\n", r->id, val[0]);
4439                                    xcb_configure_window(conn, r->id,
4440                                        XCB_CONFIG_WINDOW_SIBLING |
4441                                        XCB_CONFIG_WINDOW_STACK_MODE, val);
4442    
4443                                    val[0] = r_prev->bar->id;
4444                                    DNPRINTF(SWM_D_STACK, "stack: region bar %#x "
4445                                        "relative to %#x.\n", r->bar->id, val[0]);
4446                                    xcb_configure_window(conn, r->bar->id,
4447                                        XCB_CONFIG_WINDOW_SIBLING |
(gdb) quit
levaidaniel commented 10 years ago

Thanks!