Menu

#358 Crash with 4.3 editing a perl file

v4.4
closed-fixed
None
v4.3
5
2017-09-26
2016-09-26
No

I have an odd reproducible crash with joe 4.3 as found in Fedora
Steps to reproduce:
- joe test2.pl (empty new file)
- paste exactly this:
print "set interfaces $port unit $vn family inet unnumbered-address lo0.2002\n";
- hit enter for newline
- go up with the up-arrow
- go down with the down-arrow
kaboom

Core was generated by `joe test2.pl'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000557970fcfd78 in parse (syntax=syntax@entry=0x557900000000, 
    line=line@entry=0x5579722c2c00, h_state=..., charmap=0x557972229830) at syntax.c:162
162     h = (stack ? stack->syntax : syntax)->states[h_state.state];
(gdb) bt full
#0  0x0000557970fcfd78 in parse (syntax=syntax@entry=0x557900000000, line=line@entry=0x5579722c2c00, h_state=..., charmap=0x557972229830) at syntax.c:162
        stack = 0x0
        h = <optimized out>
        buf = {0 <repeats 80 times>}
        lbuf = {0 <repeats 38 times>, 1, 0, 0, 0, 756869856, 32764, 756869840, 32764, 1895710416, 21881, 756870232, 32764, 0, 0, 1895710419, 21881, 740696361, 32703, 0, 0, 0, 0, 0, 0, 0, 0, 756868664, 32764, 0, 0, 756868704, 32764, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 1, 0, 0, 0, -4, 21881, 0, 32764, 1, 0, 756868784, 32764, 0, 0, 3432, 0, 5, 0, 1895710417, 21881, 1, 11, 0, 0, 1895710420, 21881, 0 <repeats 14 times>, 40, 48, 756870448, 32764, 756870256, 32764, 0 <repeats 112 times>}
        lsaved_s = {0 <repeats 38 times>, 748827008, 32703, 0, 0, 1895471968, 21881, 0 <repeats 34 times>, 1471508224, -758176244, 10000, 0, 1895476720, 21881, 744307504, 32703, 1915010538, 21881, -756869599, -32765, 0, 0, 0, 0, 0, 1, 1915490592, 21881, 744293312, 32703, 10, 0, 1915490592, 21881, 0, 0, 1471508224, -758176244, 1895760845, 21881, 1915025120, 21881, 1024, 0, 0, 0, 1915445840, 21881, 1915025120, 21881, 1, 0, 1895442555, 21881, 0, 822083584, 1471508224, -758176244, 756869776, 32764, 756869776, 32764, 756870464, 32764, 1895710509, 21881, 756870152, 32764, 1, 0, 79, 0, 741518070, 32703, -72515583, 822083584, 756870464, 32764, 756869856, 32764, 756869856, 32764, 756870544, 32764, 1895710416, 21881, 756870232, 32764, 1, 0, 79, 0, 741518070, 32703, -72515583, 0, 756870544, 32764, 756870544, 32764, 756870544, 32764, 756870544, 32764, 756870550, 32764, 756870623, 32764, 756870544, 32764, 756870623, 32764, 0, 0, 744307448, 32703, 756870015, 32764, 744307504, 32703, 756870016, 32764, -756870015, -32765, 1895450091, 21881, 0, 0, 0, 0, 1, 0, 740964442, 32703, -1, -1, 0, 0, 1895710450, 21881, 0, 0, -1, 21881, 744307424, 32703, 744307424, 32703, 12304, 0, 1916199296, 21881, 1915490608, 21881, 1915496912, 21881, 740916671, 32703, 8560, 0, 12288, 0, 756870240, 32764, 756870239, 32764, 10, 0, 1895658371, 21881}
        buf_idx = <optimized out>
        c = <optimized out>
        attr = <optimized out>
        attr_end = <optimized out>
        buf_en = <optimized out>
        ofst = <optimized out>
        mark1 = <optimized out>
        mark2 = <optimized out>
        mark_en = <optimized out>
        recolor_delimiter_or_keyword = <optimized out>
#1  0x0000557970fd6d6e in lattr_get (db=0x557972283720, y=0x557900000000, p=p@entry=0x5579722c29d0, line=1) at lattr.c:303
        ln = 1
        tmp = 0x5579722c2c00
        state = <optimized out>
#2  0x0000557970fad32e in get_context (bw=0x55797236e180, bw=0x55797236e180) at tw.c:72
        db = <optimized out>
        buf1 = {112, 114, 105, 110, 116, 32, 34, 115, 101, 116, 32, 105, 110, 116, 101, 114, 102, 97, 99, 101, 115, 32, 36, 112, 111, 114, 116, 32, 117, 110, 105, 116, 32, 36, 118, 110, 32, 102, 97, 109, 105, 108, 121, 32, 105, 110, 101, 116, 32, 117, 110, 110, 117, 109, 98, 101, 114, 101, 100, 45, 97, 100, 100, 114, 101, 115, 115, 32, 108, 111, 48, 46, 50, 48, 48, 50, 92, 92, 110, 34}
        src = <optimized out>
        p = 0x5579722c29d0
        st = {stack = <optimized out>, saved_s = 0x0, state = <optimized out>}
        buf1 = {112, 114, 105, 110, 116, 32, 34, 115, 101, 116, 32, 105, 110, 116, 101, 114, 102, 97, 99, 101, 115, 32, 36, 112, 111, 114, 116, 32, 117, 110, 105, 116, 32, 36, 118, 110, 32, 102, 97, 109, 105, 108, 121, 32, 105, 110, 101, 116, 32, 117, 110, 110, 117, 109, 98, 101, 114, 101, 100, 45, 97, 100, 100, 114, 101, 115, 115, 32, 108, 111, 48, 46, 50, 48, 48, 50, 92, 92, 110, 34}
#3  stagen (stalin=0x5579722c1130 "\\i^[  I A  test2.pl (Modified)(perl)  ", bw=bw@entry=0x55797236e180, s=0x55797222389b "x", fill=fill@entry=32 ' ') at tw.c:231
        buf = "(perl)", '\000' <repeats 73 times>
        x = <optimized out>
        field = <optimized out>
        w = <optimized out>
        n = 1474908408
        cas = <optimized out>
#4  0x0000557970fae499 in disptw (w=0x55797235a560, flg=1) at tw.c:599
        bw = 0x55797236e180
        tw = 0x55797235a630
#5  0x0000557970f986b8 in edupd (flg=1) at main.c:67
        w = 0x55797235a560
        wid = 211
        hei = 48
#6  0x0000557970f9884b in edloop (flg=0) at main.c:134
        w = <optimized out>
        m = <optimized out>
        c = <optimized out>
        word_off = <optimized out>
        bw = <optimized out>
        auto_off = <optimized out>
        spaces_off = <optimized out>
        term = 0
        ret = 0
#7  0x0000557970f867e9 in main (argc=<optimized out>, real_argv=<optimized out>, envv=<optimized out>) at main.c:678
        cap = <optimized out>
        argv = <optimized out>
        sbuf = {st_dev = 2049, st_ino = 6818213, st_nlink = 1, st_mode = 33188, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 45837, st_blksize = 4096, st_blocks = 96, st_atim = {tv_sec = 1472734201, tv_nsec = 0}, st_mtim = {tv_sec = 1472734201, tv_nsec = 0}, st_ctim = {tv_sec = 1474907169, tv_nsec = 519672595}, __glibc_reserved = {0, 0, 0}}
        s = <optimized out>
        t = <optimized out>
        time_rc = <optimized out>
        run = <optimized out>
        n = 0x55797224f6e0
        opened = <optimized out>
        omid = <optimized out>
        backopt = <optimized out>
        c = <optimized out>
        filesonly = <optimized out>

Discussion

  • Joe Allen

    Joe Allen - 2016-09-26

    Thanks for this error report!

    The should now be fixed in Mercurial. The problem is the backslash- I have to quote each backslash before sending the context line to the display, but didn't account for this in the buffer size.

     
  • John J. Jordan

    John J. Jordan - 2017-09-26
    • status: open --> closed-fixed
    • assigned_to: Joe Allen
    • Group: Unknown --> v4.4
     

Log in to post a comment.