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

Internal error on Vim 7.2

Expand Messages
  • Martti Kuparinen
    Hi, I m the Vim maintainer in NetBSD pkgsrc and I was looking two weird problem reports: http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=39375
    Message 1 of 11 , Mar 2, 2010
    • 0 Attachment
      Hi,

      I'm the Vim maintainer in NetBSD pkgsrc and I was looking two weird problem reports:

      http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=39375
      http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=42909

      Few minutes ago I tested the first myself with 7.2.367 and I have no problems on
      NetBSD/amd64 while on NetBSD/i386 I get the same

      E341: Internal error: lalloc(0, )
      cannot yank; delete anyway (y/n)?

      message as described in both PRs. Any ideas where to start debugging this?

      Martti

      --
      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
      ... I can t reproduc this. You could compile Vim with debugging symbols, run it in gdb and set a breakpoint at the error message. Then look at the stack
      Message 2 of 11 , Mar 2, 2010
      • 0 Attachment
        Martti Kuparinen wrote:

        > I'm the Vim maintainer in NetBSD pkgsrc and I was looking two weird
        > problem reports:
        >
        > http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=39375
        > http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=42909
        >
        > Few minutes ago I tested the first myself with 7.2.367 and I have no
        > problems on NetBSD/amd64 while on NetBSD/i386 I get the same
        >
        > E341: Internal error: lalloc(0, )
        > cannot yank; delete anyway (y/n)?
        >
        > message as described in both PRs. Any ideas where to start debugging this?

        I can't reproduc this.

        You could compile Vim with debugging symbols, run it in gdb and set a
        breakpoint at the error message. Then look at the stack trace.
        Going a few frames back should show you where the size is computed
        wrong. Most likely it's to do with MAXCOL, as the "$" command uses
        that for the desired column position.

        --
        "Never be afraid to tell the world who you are."
        -- Anonymous

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.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
      • Martti Kuparinen
        I had few minutes to debug this, so far I found this... # ldd vim ldd: vim: not dynamically linked # file vim vim: ELF 32-bit LSB executable, Intel 80386,
        Message 3 of 11 , Mar 3, 2010
        • 0 Attachment
          I had few minutes to debug this, so far I found this...

          # ldd vim
          ldd: vim: not dynamically linked
          # file vim
          vim: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically
          linked, for NetBSD 5.99.24, not stripped
          # gdb vim

          (gdb) break lalloc

          Breakpoint 1, lalloc (size=2, message=1) at misc2.c:837
          837 if (size == 0)
          (gdb) c
          Continuing.

          Breakpoint 1, lalloc (size=28, message=1) at misc2.c:837
          837 if (size == 0)
          (gdb) c
          Continuing.

          Breakpoint 1, lalloc (size=4, message=1) at misc2.c:837
          837 if (size == 0)
          (gdb) c
          Continuing.

          Breakpoint 1, lalloc (size=0, message=1) at misc2.c:837
          837 if (size == 0)

          (gdb) bt
          #0 lalloc (size=0, message=1) at misc2.c:837
          #1 0x080f5e63 in alloc (size=0) at misc2.c:767
          #2 0x08114963 in yank_copy_line (bd=0xbfbfe780, y_idx=0) at ops.c:3162
          #3 0x08114301 in op_yank (oap=0xbfbfeaf8, deleting=1, mess=0) at ops.c:2926
          #4 0x08112098 in op_delete (oap=0xbfbfeaf8) at ops.c:1725
          #5 0x08113c65 in op_change (oap=0xbfbfeaf8) at ops.c:2634
          #6 0x08104efe in do_pending_operator (cap=0xbfbfea4c, old_col=2147483647,
          gui_yank=0) at normal.c:1953
          #7 0x08103a6d in normal_cmd (oap=0xbfbfeaf8, toplevel=1) at normal.c:1214
          #8 0x080cfb0c in main_loop (cmdwin=0, noexmode=0) at main.c:1211
          #9 0x080cf6f3 in main (argc=2, argv=0xbfbfecac) at main.c:955

          (gdb) frame 2
          #2 0x08114963 in yank_copy_line (bd=0xbfbfe780, y_idx=0) at ops.c:3162
          3162 if ((pnew = alloc(bd->startspaces + bd->endspaces + bd->textlen + 1))
          (gdb) p bd->startspaces
          $2 = -1
          (gdb) p bd->endspaces
          $3 = 0
          (gdb) p bd->textlen
          $4 = 0


          What should I try next?

          PS. Any interest for a minimalistic VMware Player image of NetBSD/i386 with
          checked-out pkgsrc tree and debug build of vim where you can use gdb yourself?

          Martti

          --
          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
        • Lech Lorens
          ... Yesterday I tried to install NetBSD under Qemu but the installation hanged during the boot process... If you make your image available somewhere, I might
          Message 4 of 11 , Mar 3, 2010
          • 0 Attachment
            On 3 March 2010 15:04, Martti Kuparinen <martti.kuparinen@...> wrote:
            >
            > PS. Any interest for a minimalistic VMware Player image of NetBSD/i386 with
            > checked-out pkgsrc tree and debug build of vim where you can use gdb
            > yourself?
            >
            > Martti

            Yesterday I tried to install NetBSD under Qemu but the installation hanged
            during the boot process...
            If you make your image available somewhere, I might try to run it under Qemu.
            I'm not promising it will work, however (though I believe it should).

            --
            Best regards,
            Lech Lorens

            --
            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
          • Martti Kuparinen
            ... I have VirtualBox 3.1.4 on my home PC so here s a VDI image instead of VMware VMDK image: http://kuparinen.org/martti/tmp/netbsd5vim72.xml
            Message 5 of 11 , Mar 3, 2010
            • 0 Attachment
              > PS. Any interest for a minimalistic VMware Player image of NetBSD/i386
              > with checked-out pkgsrc tree and debug build of vim where you can use
              > gdb yourself?

              I have VirtualBox 3.1.4 on my home PC so here's a VDI image instead of VMware
              VMDK image:

              http://kuparinen.org/martti/tmp/netbsd5vim72.xml
              http://kuparinen.org/martti/tmp/netbsd5vim72.vdi.bz2 (81 MB)

              You have to uncompress the disk image, register it with your VirtualBox and
              move the xml file to correct location.

              After booting the VM, check the IP address with "ifconfig wm0" so you can SSH
              into the host. Next open three SSH sessions and follow the instructions printed
              by /etc/motd...

              Login: root
              Password: root

              SSH allows root login...

              Martti

              --
              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
              ... You can get all with: print *bd ... Apparently something goes wrong in block_prep(), just before calling yank_copy_line(). If you can put a breakpoint in
              Message 6 of 11 , Mar 3, 2010
              • 0 Attachment
                Martti Kuparinen wrote:

                > I had few minutes to debug this, so far I found this...
                >
                > # ldd vim
                > ldd: vim: not dynamically linked
                > # file vim
                > vim: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically
                > linked, for NetBSD 5.99.24, not stripped
                > # gdb vim
                >
                > (gdb) break lalloc
                >
                > Breakpoint 1, lalloc (size=2, message=1) at misc2.c:837
                > 837 if (size == 0)
                > (gdb) c
                > Continuing.
                >
                > Breakpoint 1, lalloc (size=28, message=1) at misc2.c:837
                > 837 if (size == 0)
                > (gdb) c
                > Continuing.
                >
                > Breakpoint 1, lalloc (size=4, message=1) at misc2.c:837
                > 837 if (size == 0)
                > (gdb) c
                > Continuing.
                >
                > Breakpoint 1, lalloc (size=0, message=1) at misc2.c:837
                > 837 if (size == 0)
                >
                > (gdb) bt
                > #0 lalloc (size=0, message=1) at misc2.c:837
                > #1 0x080f5e63 in alloc (size=0) at misc2.c:767
                > #2 0x08114963 in yank_copy_line (bd=0xbfbfe780, y_idx=0) at ops.c:3162
                > #3 0x08114301 in op_yank (oap=0xbfbfeaf8, deleting=1, mess=0) at ops.c:2926
                > #4 0x08112098 in op_delete (oap=0xbfbfeaf8) at ops.c:1725
                > #5 0x08113c65 in op_change (oap=0xbfbfeaf8) at ops.c:2634
                > #6 0x08104efe in do_pending_operator (cap=0xbfbfea4c, old_col=2147483647,
                > gui_yank=0) at normal.c:1953
                > #7 0x08103a6d in normal_cmd (oap=0xbfbfeaf8, toplevel=1) at normal.c:1214
                > #8 0x080cfb0c in main_loop (cmdwin=0, noexmode=0) at main.c:1211
                > #9 0x080cf6f3 in main (argc=2, argv=0xbfbfecac) at main.c:955
                >
                > (gdb) frame 2
                > #2 0x08114963 in yank_copy_line (bd=0xbfbfe780, y_idx=0) at ops.c:3162
                > 3162 if ((pnew = alloc(bd->startspaces + bd->endspaces + bd->textlen + 1))
                > (gdb) p bd->startspaces
                > $2 = -1
                > (gdb) p bd->endspaces
                > $3 = 0
                > (gdb) p bd->textlen
                > $4 = 0

                You can get all with: print *bd

                > What should I try next?

                Apparently something goes wrong in block_prep(), just before calling
                yank_copy_line(). If you can put a breakpoint in block_prep() and step
                through it to find out why bdp->startspaces ends up being negative, and
                textlen zero, that will help a lot. Look out for an overflow somewhere.
                Perhaps in line 4966? Actually, knowing the values in oap will help:
                print *oap

                If these values look wrong, look at the code that sets them: about line
                1660 in normal.c

                --
                Not too long ago, compress was something you did to garbage...

                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                \\\ download, build and distribute -- http://www.A-A-P.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
              • Martti Kuparinen
                ... 4966 bdp- startspaces = oap- end_vcol - oap- start_vcol + 1; (gdb) p *oap $30 = {op_type = 3, regname = 45, motion_type = 0,
                Message 7 of 11 , Mar 3, 2010
                • 0 Attachment
                  Bram Moolenaar wrote:

                  > Apparently something goes wrong in block_prep(), just before calling
                  > yank_copy_line(). If you can put a breakpoint in block_prep() and step
                  > through it to find out why bdp->startspaces ends up being negative, and
                  > textlen zero, that will help a lot. Look out for an overflow somewhere.
                  > Perhaps in line 4966? Actually, knowing the values in oap will help:
                  > print *oap

                  4966 bdp->startspaces = oap->end_vcol - oap->start_vcol + 1;
                  (gdb) p *oap
                  $30 = {op_type = 3, regname = 45, motion_type = 0, motion_force = 0,
                  use_reg_one = 0, inclusive = 1, end_adjusted = 0, start = {lnum = 1,
                  col = 2, coladd = 0}, end = {lnum = 1, col = 0, coladd = 0},
                  cursor_start = {lnum = 0, col = 0, coladd = 0}, line_count = 1, empty = 0,
                  is_VIsual = 1, block_mode = 1, start_vcol = 2, end_vcol = 0,
                  prev_opcount = 0, prev_count0 = 0}
                  (gdb) n
                  4967 if (is_del && oap->op_type != OP_LSHIFT)
                  (gdb) p bdp->startspaces
                  $31 = -1
                  (gdb) n
                  5018 bdp->end_char_vcols = incr;
                  (gdb) p incr
                  $32 = 1
                  (gdb) n
                  5020 if (is_del && bdp->startspaces)
                  (gdb) p is_del
                  $33 = 0
                  (gdb) n
                  5022 bdp->textlen = (int)(pend - pstart);
                  (gdb) p pend
                  $34 = (char_u *) 0xbba49ffd " "
                  (gdb) p pstart
                  $35 = (char_u *) 0xbba49ffd " "
                  (gdb) where
                  #0 block_prep (oap=0xbfbfeae8, bdp=0xbfbfe770, lnum=1, is_del=0) at ops.c:5022
                  #1 0x08114398 in op_yank (oap=0xbfbfeae8, deleting=1, mess=0) at ops.c:2925
                  #2 0x08112144 in op_delete (oap=0xbfbfeae8) at ops.c:1725
                  #3 0x08113d11 in op_change (oap=0xbfbfeae8) at ops.c:2634
                  #4 0x08104faa in do_pending_operator (cap=0xbfbfea3c, old_col=2147483647,
                  gui_yank=0) at normal.c:1953
                  #5 0x08103b19 in normal_cmd (oap=0xbfbfeae8, toplevel=1) at normal.c:1214
                  #6 0x080cfb88 in main_loop (cmdwin=0, noexmode=0) at main.c:1211
                  #7 0x080cf76f in main (argc=2, argv=0xbfbfec9c) at main.c:955

                  > If these values look wrong, look at the code that sets them: about line
                  > 1660 in normal.c

                  Why is oap->end_vcol zero? I'll continue tomorrow with this...

                  --
                  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
                • Martti Kuparinen
                  ... Here s a VMware Player 3.0.1 tested image, use ifconfig -a to see the IP address configured by DHCP. http://kuparinen.org/martti/tmp/netbsd5vim72.tar.bz2
                  Message 8 of 11 , Mar 4, 2010
                  • 0 Attachment
                    Martti Kuparinen wrote:

                    > After booting the VM, check the IP address with "ifconfig wm0" so you
                    > can SSH into the host. Next open three SSH sessions and follow the
                    > instructions printed by /etc/motd...
                    >
                    > Login: root
                    > Password: root
                    >
                    > SSH allows root login...

                    Here's a VMware Player 3.0.1 tested image, use "ifconfig -a" to see the IP
                    address configured by DHCP.

                    http://kuparinen.org/martti/tmp/netbsd5vim72.tar.bz2

                    Martti

                    --
                    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
                  • Lech Lorens
                    ... The attached patch fixes the problem. Additionally, I indented the comment in memline.c as its wrong indentation always misleads me to think that the
                    Message 9 of 11 , Mar 6, 2010
                    • 0 Attachment
                      On 02-Mar-2010 Martti Kuparinen <martti.kuparinen@...> wrote:
                      > Hi,
                      >
                      > I'm the Vim maintainer in NetBSD pkgsrc and I was looking two weird problem reports:
                      >
                      > http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=39375
                      > http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=42909
                      >
                      > Few minutes ago I tested the first myself with 7.2.367 and I have no
                      > problems on NetBSD/amd64 while on NetBSD/i386 I get the same
                      >
                      > E341: Internal error: lalloc(0, )
                      > cannot yank; delete anyway (y/n)?
                      >
                      > message as described in both PRs. Any ideas where to start debugging this?
                      >
                      > Martti

                      The attached patch fixes the problem.

                      Additionally, I indented the comment in memline.c as its wrong
                      indentation always misleads me to think that the function ends just
                      before the comment.

                      --
                      Cheers,
                      Lech

                      --
                      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
                      ... Thanks! I must say I m really happy to get patches from you and others. Perhaps finally the todo list will be getting shorter? -- A real patriot is the
                      Message 10 of 11 , Mar 6, 2010
                      • 0 Attachment
                        Lech Lorens wrote:

                        > On 02-Mar-2010 Martti Kuparinen <martti.kuparinen@...> wrote:
                        > > Hi,
                        > >
                        > > I'm the Vim maintainer in NetBSD pkgsrc and I was looking two weird problem reports:
                        > >
                        > > http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=39375
                        > > http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=42909
                        > >
                        > > Few minutes ago I tested the first myself with 7.2.367 and I have no
                        > > problems on NetBSD/amd64 while on NetBSD/i386 I get the same
                        > >
                        > > E341: Internal error: lalloc(0, )
                        > > cannot yank; delete anyway (y/n)?
                        > >
                        > > message as described in both PRs. Any ideas where to start debugging this?
                        > >
                        > > Martti
                        >
                        > The attached patch fixes the problem.
                        >
                        > Additionally, I indented the comment in memline.c as its wrong
                        > indentation always misleads me to think that the function ends just
                        > before the comment.

                        Thanks!

                        I must say I'm really happy to get patches from you and others. Perhaps
                        finally the todo list will be getting shorter?

                        --
                        A real patriot is the fellow who gets a parking ticket and rejoices
                        that the system works.


                        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                        \\\ download, build and distribute -- http://www.A-A-P.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
                      • Martti Kuparinen
                        I hereby confirm that the patch fixes my problems on NetBSD/i386. Bram, please provide an official patch so I can update our package... Martti -- You
                        Message 11 of 11 , Mar 6, 2010
                        • 0 Attachment
                          I hereby confirm that the patch fixes my problems on NetBSD/i386.

                          Bram, please provide an "official" patch so I can update our package...

                          Martti

                          --
                          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.