Hi developers,

currently I'm struggling with a segfault during termdebug. It was introduced
with v8.1.105 when the variable tab stops had been introduced. I don't
really understand why but it happens only with a stripped vim binary in
console. System is Ubuntu 14.04 with custom compiled Vim.

Here is the recipe to reproduce:

    cat >test.c <<EOF
    int main(void) {
      int ret = 0;

      return ret;
    }
    EOF

    gcc -g test.c

    vim -u NONE -N -c "set mouse=n|packadd termdebug|Termdebug a.out" test.c

Now hoover the mouse over the word "return" in the source code window and vim 
will be
terminated with a segfault.

As mentioned it happens only for the stripped binary running in console. It
does not happen if the stripped vim is run in gdb. So debugging is a little bit 
tricky:

    cp vim vim.debug
    strip --only-keep-debug vim.debug
    strip vim
    sudo gdb attach $(pidof vim) -ex cont

And this is the information I get:

    Program received signal SIGSEGV, Segmentation fault.
    __GI___libc_free (mem=0x6f6d2e6d) at malloc.c:2931
    2931    malloc.c: No such file or directory.
    >>> bt
    #0  __GI___libc_free (mem=0x6f6d2e6d) at malloc.c:2931
    #1  0x00000000004444bc in get_beval_info ()
    #2  0x000000000044480b in general_beval_cb ()
    #3  0x0000000000493b0a in check_due_timer ()
    #4  0x00000000005ca1d5 in ui_wait_for_chars_or_timer ()
    #5  0x000000000053bc24 in mch_inchar ()
    #6  0x00000000005cbea5 in ui_inchar ()
    #7  0x00000000004d092f in ?? ()
    #8  0x00000000004d26e0 in ?? ()
    #9  0x00000000004d312a in vgetc ()
    #10 0x00000000005c6ae4 in terminal_loop ()
    #11 0x000000000062816a in main_loop ()
    #12 0x0000000000628fad in vim_main2 ()
    #13 0x0000000000441ad9 in main ()
    >>> symbol-file vim.debug
    Reading symbols from vim.debug...done.
    >>> bt
    #0  __GI___libc_free (mem=0x6f6d2e6d) at malloc.c:2931
    #1  0x0000000000500a7d in vim_free (x=<optimized out>) at misc2.c:1837
    #2  0x00000000004444bc in get_beval_info (beval=0x1f5f230, 
getword=<optimized out>, winp=0x7ffc22586ff8, lnump=0x7ffc22587000, 
textp=0x7ffc22587008, colp=0x7ffc22586ff4) at beval.c:129
    #3  0x0000000001eb7560 in ?? ()
    #4  0x0000000000000000 in ?? ()
    >>> f 2
    #2  0x00000000004444bc in get_beval_info (beval=0x1f5f230, 
getword=<optimized out>, winp=0x7ffc22586ff8, lnump=0x7ffc22587000, 
textp=0x7ffc22587008, colp=0x7ffc22586ff4) at beval.c:129
    129                         vim_free(beval->vts);
    >>> l
    124                     *lnump = lnum;
    125                     *textp = lbuf;
    126                     *colp = col;
    127     #ifdef FEAT_VARTABS
    128                     if (beval->vts)
    129                         vim_free(beval->vts);
    130                     beval->vts = 
tabstop_copy(wp->w_buffer->b_p_vts_array);
    131     #endif
    132                     beval->ts = wp->w_buffer->b_p_ts;
    133                     return OK;

I hope I provided enough information to nail down the cause. If something is
missing I'll be happy to help.

Markus Braun

-- 
Any errors in spelling, tact or fact are transmission errors

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui