Loading ...
Sorry, an error occurred while loading the content.

Re: E341: Internal error: lalloc(0, )

Expand Messages
  • David Fishburn
    ... Rebuild Vim. Then you can run Vim with gdb with a breakpoint ... For some background. This crash only happens on Ubuntu in my case. Clipboard must have
    Message 1 of 7 , Dec 3, 2012
    • 0 Attachment
      ...
      Rebuild Vim. Then you can run Vim with gdb with a breakpoint
      when Vim gives E341:

      $ cd vim/src

      $ grep -n E341 *c
      misc2.c:902:    EMSGN(_("E341: Internal error: lalloc(%ld, )"), size);

      $ gdb --args ./vim -f -g

      (gdb) br misc2.c:902
      Breakpoint 1 at 0x4eb006: file misc2.c, line 902.
      (gdb) run

      Then when Vim hits the breakpoint, you can type gdb command "bt"
      to get a backtrace.



      For some background.
      This crash only happens on Ubuntu in my case.

      Clipboard must have unnamedplus in it.
      I am copying Unicode characters (Chinese in this case) and flipping between GUI Vim and Chrome.  
      set clipboard=unnamedplus,autoselect,exclude:cons|linux

      The YankRing plugin has a Focus autocmd which checks it and if it is different adds it to the ring.

      Here is :set

      :set
      --- Options ---
      noarabicshape         hlsearch            scrolloff=2       nottybuiltin
        autoindent          ignorecase          shiftwidth=4        ttyscroll=0
        background=dark     incsearch           shortmess=at        visualbell
        cmdheight=2         laststatus=2        showbreak=>>        whichwrap=<,>,h,l
        cursorcolumn      noloadplugins         showcmd             wildmenu
        cursorline          modelines=10        showmatch           window=32
        expandtab           mouse=a             smartcase         nowritebackup
        helplang=en         nrformats=hex     nostartofline
        hidden              ruler               timeoutlen=3000
        history=500         scroll=15           ttimeoutlen=100
        backspace=indent,eol,start
        clipboard=unnamedplus,autoselect,exclude:cons|linux
        comments=b:#,:%,n:>
        cpoptions=aABceFs$
        fileencodings=iso-8859-15,iso-8859-3,ucs-bom,utf-8,utf-16
        fileformats=unix,dos,mac
        foldopen=block,hor,mark,percent,quickfix,search,tag,undo,jump
        formatoptions=cqtro
        grepprg=grep -nH $*
        guifont=DejaVu Sans Mono 11
        scrollopt=ver,jump,hor
        statusline= %-.50f%r%y%m B:%n%=%l,%c%V %p%%
        termencoding=utf-8
        viminfo="50,'1000,h,f1,rA:,r/tmp:,:500,/500,!,n$HOME/.viminfo




      Here is the back trace.

      #0  lalloc (size=0, message=1) at misc2.c:902
      #1  0x0000000000508b64 in lalloc_clear (size=0, message=1) at misc2.c:875
      #2  0x0000000000535a00 in str_to_reg (y_ptr=0x899170, yank_type=228, 
          str=0xc8db09 "", len=-1, blocklen=0) at ops.c:6372
      #3  0x000000000053510a in clip_yank_selection (type=228, str=0xc8db09 "",  len=-1, cbd=0x89fbe0) at ops.c:5960
      #4  0x00000000005eb467 in selection_received_cb (widget=0xa46550, 
          data=0x7fffffffa2a0, time_=0, user_data=0x0) at gui_gtk_x11.c:1264
      #5  0x00007ffff6e45ca2 in g_closure_invoke ()
         from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
      #6  0x00007ffff6e56d71 in ?? ()
         from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
      #7  0x00007ffff6e5f099 in g_signal_emit_valist ()
         from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
      #8  0x00007ffff6e5f754 in g_signal_emit_by_name ()
         from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
      #9  0x00007ffff793b513 in ?? ()
         from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
      #10 0x00007ffff793ef0a in ?? ()
         from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
      #11 0x00007ffff78d6dd8 in ?? ()
         from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
      #12 0x00007ffff6e45ca2 in g_closure_invoke ()
         from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
      #13 0x00007ffff6e57339 in ?? ()
         from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
      #14 0x00007ffff6e5ed7e in g_signal_emit_valist ()
         from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
      #15 0x00007ffff6e5f242 in g_signal_emit ()
         from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
      #16 0x00007ffff79f1191 in ?? ()
         from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
      #17 0x00007ffff78d54fb in gtk_main_do_event ()
         from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
      #18 0x00007ffff7549cac in ?? ()
         from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
      #19 0x00007ffff6b88d53 in g_main_context_dispatch ()
         from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #20 0x00007ffff6b890a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #21 0x00007ffff6b89164 in g_main_context_iteration ()
         from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #22 0x00000000005f2b43 in clip_mch_request_selection (cbd=0x89fbe0)
          at gui_gtk_x11.c:5654
      #23 0x00000000005ca562 in clip_gen_request_selection (cbd=0x89fbe0)
          at ui.c:1450
      #24 0x00000000005350a9 in clip_get_selection (cbd=0x89fbe0) at ops.c:5937
      #25 0x000000000052b2df in may_get_selection (regname=43) at ops.c:941
      #26 0x00000000005354f4 in get_reg_contents (regname=43, allowexpr=1, 
          expr_src=1) at ops.c:6159
      #27 0x000000000045ccfd in eval7 (arg=0x7fffffffb240, rettv=0x7fffffffb0f0, 
          evaluate=1, want_string=0) at eval.c:5111
      #28 0x000000000045c71b in eval6 (arg=0x7fffffffb240, rettv=0x7fffffffb0f0, 
          evaluate=1, want_string=0) at eval.c:4810
      #29 0x000000000045c28a in eval5 (arg=0x7fffffffb240, rettv=0x7fffffffb0f0, 
          evaluate=1) at eval.c:4626
      #30 0x000000000045b689 in eval4 (arg=0x7fffffffb240, rettv=0x7fffffffb0f0, 
          evaluate=1) at eval.c:4319
      #31 0x000000000045b4d6 in eval3 (arg=0x7fffffffb240, rettv=0x7fffffffb0f0, 
          evaluate=1) at eval.c:4231
      #32 0x000000000045b355 in eval2 (arg=0x7fffffffb240, rettv=0x7fffffffb0f0, 
          evaluate=1) at eval.c:4160
      #33 0x000000000045b194 in eval1 (arg=0x7fffffffb240, rettv=0x7fffffffb0f0, 
          evaluate=1) at eval.c:4085
      #34 0x0000000000461535 in get_func_tv (
          name=0xc8de0f "len(@+) > 0 && @+ != s:yr_prev_clipboard_plus", len=3, 
          rettv=0x7fffffffb750, arg=0x7fffffffb710, firstline=5, lastline=5, 
          doesrange=0x7fffffffb2e0, evaluate=1, selfdict=0x0) at eval.c:8307
      #35 0x000000000045ce82 in eval7 (arg=0x7fffffffb710, rettv=0x7fffffffb750, 
          evaluate=1, want_string=0) at eval.c:5158
      #36 0x000000000045c71b in eval6 (arg=0x7fffffffb710, rettv=0x7fffffffb750, 
          evaluate=1, want_string=0) at eval.c:4810
      #37 0x000000000045c28a in eval5 (arg=0x7fffffffb710, rettv=0x7fffffffb750, 
          evaluate=1) at eval.c:4626
      #38 0x000000000045b689 in eval4 (arg=0x7fffffffb710, rettv=0x7fffffffb750, 
          evaluate=1) at eval.c:4319
      #39 0x000000000045b4d6 in eval3 (arg=0x7fffffffb710, rettv=0x7fffffffb750, 
          evaluate=1) at eval.c:4231
      #40 0x000000000045b355 in eval2 (arg=0x7fffffffb710, rettv=0x7fffffffb750, 
          evaluate=1) at eval.c:4160
      #41 0x000000000045b194 in eval1 (arg=0x7fffffffb710, rettv=0x7fffffffb750, 
          evaluate=1) at eval.c:4085
      #42 0x000000000045b0f3 in eval0 (
          arg=0xc8de0f "len(@+) > 0 && @+ != s:yr_prev_clipboard_plus", 
          rettv=0x7fffffffb750, nextcmd=0x7fffffffb7f8, evaluate=1) at eval.c:4042
      #43 0x0000000000455fd4 in eval_to_bool (
          arg=0xc8de0f "len(@+) > 0 && @+ != s:yr_prev_clipboard_plus", 
          error=0x7fffffffb7a4, nextcmd=0x7fffffffb7f8, skip=0) at eval.c:1274
      #44 0x00000000004a3d75 in ex_if (eap=0x7fffffffb7f0) at ex_eval.c:886
      #45 0x0000000000493cb6 in do_one_cmd (cmdlinep=0x7fffffffb9d8, sourcing=1, 
          cstack=0x7fffffffba70, fgetline=0x47a6d4 <get_func_line>, cookie=0xca40d0)
          at ex_docmd.c:2679
      #46 0x0000000000491259 in do_cmdline (cmdline=0x0, 
          fgetline=0x47a6d4 <get_func_line>, cookie=0xca40d0, flags=7)
          at ex_docmd.c:1122
      #47 0x0000000000479b9a in call_user_func (fp=0xc68cd0, argcount=0, 
          argvars=0x7fffffffc380, rettv=0x7fffffffc540, firstline=5, lastline=5, 
          selfdict=0x0) at eval.c:22540
      #48 0x0000000000461a46 in call_func (
          funcname=0x949f30 "\200\375R12_YRCheckClipboard", len=22, 
          rettv=0x7fffffffc540, argcount=0, argvars=0x7fffffffc380, firstline=5, 
          lastline=5, doesrange=0x7fffffffc588, evaluate=1, selfdict=0x0)
          at eval.c:8480
      #49 0x00000000004615d1 in get_func_tv (
          name=0x949f30 "\200\375R12_YRCheckClipboard", len=22, 
          rettv=0x7fffffffc540, arg=0x7fffffffc558, firstline=5, lastline=5, 
          doesrange=0x7fffffffc588, evaluate=1, selfdict=0x0) at eval.c:8322
      #50 0x000000000045a0ad in ex_call (eap=0x7fffffffc5e0) at eval.c:3465
      #51 0x0000000000493cb6 in do_one_cmd (cmdlinep=0x7fffffffc7c8, sourcing=1, 
          cstack=0x7fffffffc860, fgetline=0x47a6d4 <get_func_line>, cookie=0xcb0e20)
          at ex_docmd.c:2679
      #52 0x0000000000491259 in do_cmdline (cmdline=0x0, 
          fgetline=0x47a6d4 <get_func_line>, cookie=0xcb0e20, flags=7)
          at ex_docmd.c:1122
      #53 0x0000000000479b9a in call_user_func (fp=0xc67980, argcount=0, 
          argvars=0x7fffffffd170, rettv=0x7fffffffd330, firstline=5, lastline=5, 
          selfdict=0x0) at eval.c:22540
      #54 0x0000000000461a46 in call_func (
          funcname=0xc7a070 "\200\375R12_YRFocusGained", len=19, 
          rettv=0x7fffffffd330, argcount=0, argvars=0x7fffffffd170, firstline=5, 
          lastline=5, doesrange=0x7fffffffd378, evaluate=1, selfdict=0x0)
          at eval.c:8480
      #55 0x00000000004615d1 in get_func_tv (
          name=0xc7a070 "\200\375R12_YRFocusGained", len=19, rettv=0x7fffffffd330, 
          arg=0x7fffffffd348, firstline=5, lastline=5, doesrange=0x7fffffffd378, 
          evaluate=1, selfdict=0x0) at eval.c:8322
      #56 0x000000000045a0ad in ex_call (eap=0x7fffffffd3d0) at eval.c:3465
      #57 0x0000000000493cb6 in do_one_cmd (cmdlinep=0x7fffffffd5b8, sourcing=1, 
          cstack=0x7fffffffd650, fgetline=0x4c0331 <getnextac>, 
          cookie=0x7fffffffdb50) at ex_docmd.c:2679
      #58 0x0000000000491259 in do_cmdline (cmdline=0x0, 
          fgetline=0x4c0331 <getnextac>, cookie=0x7fffffffdb50, flags=7)
          at ex_docmd.c:1122
      #59 0x00000000004bfe3b in apply_autocmds_group (event=EVENT_FOCUSGAINED, 
          fname=0xc98100 "/opt/download/vim/yankring/unicode/foo", fname_io=0x0, 
          force=0, group=-3, buf=0x8a9a20, eap=0x0) at fileio.c:9435
      #60 0x00000000004bf671 in apply_autocmds (event=EVENT_FOCUSGAINED, fname=0x0, 
          fname_io=0x0, force=0, buf=0x8a9a20) at fileio.c:9032
      #61 0x00000000005ccd49 in ui_focus_change (in_focus=1) at ui.c:3177
      #62 0x00000000004c93ca in vgetc () at getchar.c:1647
      #63 0x00000000004c97cd in safe_vgetc () at getchar.c:1787
      #64 0x000000000051a50d in normal_cmd (oap=0x7fffffffde10, toplevel=1)
          at normal.c:665
      #65 0x0000000000605959 in main_loop (cmdwin=0, noexmode=0) at main.c:1306
      #66 0x0000000000605323 in main (argc=11, argv=0x7fffffffe138) at main.c:1010


      I still can't reliably recreate the problem.  If the backtrace provides some idea of what action I followed recreated it, I will try it again.  My couple times tonight, only dumped once.

      Thanks,
      David


      --
      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
    • Bram Moolenaar
      ... [...] ... The problem appears to be that str_to_reg() is called with a negative length. The length comes from somehwere in selection_received_cb(). You
      Message 2 of 7 , Dec 4, 2012
      • 0 Attachment
        David Fishburn wrote:

        > ...
        > Rebuild Vim. Then you can run Vim with gdb with a breakpoint
        >
        > > when Vim gives E341:
        > >
        > > $ cd vim/src
        > >
        > > $ grep -n E341 *c
        > > misc2.c:902: EMSGN(_("E341: Internal error: lalloc(%ld, )"), size);
        > >
        > > $ gdb --args ./vim -f -g
        > >
        > > (gdb) br misc2.c:902
        > > Breakpoint 1 at 0x4eb006: file misc2.c, line 902.
        > > (gdb) run
        > >
        > > Then when Vim hits the breakpoint, you can type gdb command "bt"
        > > to get a backtrace.
        > >
        > >
        >
        > For some background.
        > This crash only happens on Ubuntu in my case.
        >
        > Clipboard must have unnamedplus in it.
        > I am copying Unicode characters (Chinese in this case) and flipping between
        > GUI Vim and Chrome.
        > set clipboard=unnamedplus,autoselect,exclude:cons|linux
        >
        > The YankRing plugin has a Focus autocmd which checks it and if it is
        > different adds it to the ring.
        >
        > Here is :set

        [...]

        > Here is the back trace.
        >
        > #0 lalloc (size=0, message=1) at misc2.c:902
        > #1 0x0000000000508b64 in lalloc_clear (size=0, message=1) at misc2.c:875
        > #2 0x0000000000535a00 in str_to_reg (y_ptr=0x899170, yank_type=228,
        > str=0xc8db09 "", len=-1, blocklen=0) at ops.c:6372
        > #3 0x000000000053510a in clip_yank_selection (type=228, str=0xc8db09
        > "", len=-1, cbd=0x89fbe0) at ops.c:5960
        > #4 0x00000000005eb467 in selection_received_cb (widget=0xa46550,
        > data=0x7fffffffa2a0, time_=0, user_data=0x0) at gui_gtk_x11.c:1264

        The problem appears to be that str_to_reg() is called with a negative
        length. The length comes from somehwere in selection_received_cb().
        You could try setting a breakpoint there to see what path is taken. Or
        add some printf statements and look at what happened after the lalloc
        error.

        [...]


        --
        From "know your smileys":
        C=}>;*{)) Drunk, devilish chef with a toupee in an updraft,
        a mustache, and a double chin

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        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
      Your message has been successfully submitted and would be delivered to recipients shortly.