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

Re: Vim crashes when selecting more than 262040 characters

Expand Messages
  • Yegappan Lakshmanan
    Hi, On Fri, Apr 12, 2013 at 8:35 AM, Yegappan Lakshmanan ... I am not able to reproduce this crash when using GUI Vim or when starting Vim with the -X
    Message 1 of 12 , Apr 12, 2013
    • 0 Attachment
      Hi,

      On Fri, Apr 12, 2013 at 8:35 AM, Yegappan Lakshmanan
      <yegappanl@...> wrote:
      > Hi Dominique,
      >
      > On Fri, Apr 12, 2013 at 3:23 AM, Dominique Pellé
      > <dominique.pelle@...> wrote:
      >> Yegappan Lakshmanan wrote:
      >>
      >>> Hi all,
      >>>
      >>> I am running Vim 7.3.831 on a Linux system built with GTK 2.0.
      >>> When I execute the following steps, Vim crashes:
      >>>
      >>> 1. Open an empty buffer
      >>> 2. Enter insert mode using 'i'
      >>> 3. Insert 262040 characters using <CTRL-R>=repeat('a', 262040)
      >>> 4. Press <Esc>
      >>> 5. Select and yank all the characters using 'V' and 'y'
      >>> 6. Wait for a few seconds and move the cursor
      >>>
      >>> The crash traceback is below:
      >>>
      >>> #0 0x0048dfb9 in free () from /lib/tls/libc.so.6
      >>> #1 0x0088c3a3 in XtFree () from /usr/X11R6/lib/libXt.so.6
      >>> #2 0x008ad502 in XtAppGetSelectionTimeout () from /usr/X11R6/lib/libXt.so.6
      >>> #3 0x008a7144 in _XtRemoveAllInputs () from /usr/X11R6/lib/libXt.so.6
      >>> #4 0x008a74b2 in XtAppNextEvent () from /usr/X11R6/lib/libXt.so.6
      >>> #5 0x08139ae4 in xterm_update () at os_unix.c:6824
      >>> #6 0x08138089 in RealWaitForChar (fd=0, msec=0, check_for_gpm=0x0) at
      >>> os_unix.c:5200 U __be_errno_kernel_to_ios
      >>> #7 0x08137e74 in mch_breakcheck () at os_unix.c:4847
      >>> #8 0x080dcc85 in vgetorpeek (advance=1) at getchar.c:2014
      >>> #9 0x080db494 in vgetc () at getchar.c:1582
      >>> #10 0x080db90f in safe_vgetc () at getchar.c:1787
      >>> #11 0x0811437c in normal_cmd (oap=0xbfff85d0, toplevel=1) at normal.c:665
      >>> #12 0x081b649e in main_loop (cmdwin=0, noexmode=0) at main.c:1306
      >>> #13 0x081b5c70 in main (argc=0, argv=0x0) at main.c:1010
      >>>
      >>> I can consistently reproduce this crash. I couldn't reproduce this crash
      >>> with
      >>> the earlier Vim 7.2 release.
      >>>
      >>> Anyone else able to reproduce this crash?
      >>>
      >>> Thanks,
      >>> Yegappan
      >>
      >> Hi Yegappan
      >>
      >> It does not crash for me (Vim-7.3.884 GTK2, on Linux x86_64).
      >>
      >> But I think it's best to give a completely automated way of reproducing
      >> the bug using -u NONE if possible.
      >>
      >> I try to reproduce your steps in a automated way using this command:
      >>
      >> $ vim -u NONE \
      >> -c 'call feedkeys("i\<C-R>=repeat('"'a'"', 262040)\<CR>\<Esc>:sleep
      >> 5\<CR>Vy:sleep 7\<CR>llllhhhlllll")'
      >>
      >> Does it crash for you with this command?
      >>
      >
      > Executing the above command doesn't crash Vim. But as soon as
      > I manually yank the text using 'Vy' and move the cursor in the
      > same Vim instance, Vim crashes.
      >

      I am not able to reproduce this crash when using GUI Vim or when
      starting Vim with the "-X" command-line argument. It looks like the
      crash is triggered by the functions called from the xterm_update() function.

      - Yegappan

      --
      --
      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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Christian Brabandt
      Hi Yegappan! ... I was able to reproduce the crash just once and then I couldn t reproduce it anymore. It seems that something in the X-libraries (starting
      Message 2 of 12 , Apr 12, 2013
      • 0 Attachment
        Hi Yegappan!

        On Do, 11 Apr 2013, Yegappan Lakshmanan wrote:

        > Hi all,
        >
        > I am running Vim 7.3.831 on a Linux system built with GTK 2.0.
        > When I execute the following steps, Vim crashes:
        >
        > 1. Open an empty buffer
        > 2. Enter insert mode using 'i'
        > 3. Insert 262040 characters using <CTRL-R>=repeat('a', 262040)
        > 4. Press <Esc>
        > 5. Select and yank all the characters using 'V' and 'y'
        > 6. Wait for a few seconds and move the cursor
        >
        > The crash traceback is below:
        >
        > #0 0x0048dfb9 in free () from /lib/tls/libc.so.6
        > #1 0x0088c3a3 in XtFree () from /usr/X11R6/lib/libXt.so.6
        > #2 0x008ad502 in XtAppGetSelectionTimeout () from /usr/X11R6/lib/libXt.so.6
        > #3 0x008a7144 in _XtRemoveAllInputs () from /usr/X11R6/lib/libXt.so.6
        > #4 0x008a74b2 in XtAppNextEvent () from /usr/X11R6/lib/libXt.so.6
        > #5 0x08139ae4 in xterm_update () at os_unix.c:6824
        > #6 0x08138089 in RealWaitForChar (fd=0, msec=0, check_for_gpm=0x0) at
        > os_unix.c:5200 U __be_errno_kernel_to_ios
        > #7 0x08137e74 in mch_breakcheck () at os_unix.c:4847
        > #8 0x080dcc85 in vgetorpeek (advance=1) at getchar.c:2014
        > #9 0x080db494 in vgetc () at getchar.c:1582
        > #10 0x080db90f in safe_vgetc () at getchar.c:1787
        > #11 0x0811437c in normal_cmd (oap=0xbfff85d0, toplevel=1) at normal.c:665
        > #12 0x081b649e in main_loop (cmdwin=0, noexmode=0) at main.c:1306
        > #13 0x081b5c70 in main (argc=0, argv=0x0) at main.c:1010
        >
        > I can consistently reproduce this crash. I couldn't reproduce this crash
        > with
        > the earlier Vim 7.2 release.
        >
        > Anyone else able to reproduce this crash?

        I was able to reproduce the crash just once and then I couldn't
        reproduce it anymore. It seems that something in the X-libraries
        (starting with XtAppnextEvent()) is going wrong. (I got a double free()
        error in free())

        regards,
        Christian
        --
        Das Leben ist eine Tragödie für die, die fühlen, und eine Komödie für
        die, die denken.
        -- Jean de la Bruyère

        --
        --
        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 vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Yegappan Lakshmanan
        Hi, ... I spent some time trying to narrow down the patch that introduced this problem. I am not able to reproduce the crash with the 7.2.446 release. But I am
        Message 3 of 12 , Apr 15, 2013
        • 0 Attachment
          Hi,

          On Fri, Apr 12, 2013 at 1:20 PM, Christian Brabandt <cblists@...> wrote:
          > Hi Yegappan!
          >
          > On Do, 11 Apr 2013, Yegappan Lakshmanan wrote:
          >
          >> Hi all,
          >>
          >> I am running Vim 7.3.831 on a Linux system built with GTK 2.0.
          >> When I execute the following steps, Vim crashes:
          >>
          >> 1. Open an empty buffer
          >> 2. Enter insert mode using 'i'
          >> 3. Insert 262040 characters using <CTRL-R>=repeat('a', 262040)
          >> 4. Press <Esc>
          >> 5. Select and yank all the characters using 'V' and 'y'
          >> 6. Wait for a few seconds and move the cursor
          >>
          >> The crash traceback is below:
          >>
          >> #0 0x0048dfb9 in free () from /lib/tls/libc.so.6
          >> #1 0x0088c3a3 in XtFree () from /usr/X11R6/lib/libXt.so.6
          >> #2 0x008ad502 in XtAppGetSelectionTimeout () from /usr/X11R6/lib/libXt.so.6
          >> #3 0x008a7144 in _XtRemoveAllInputs () from /usr/X11R6/lib/libXt.so.6
          >> #4 0x008a74b2 in XtAppNextEvent () from /usr/X11R6/lib/libXt.so.6
          >> #5 0x08139ae4 in xterm_update () at os_unix.c:6824
          >> #6 0x08138089 in RealWaitForChar (fd=0, msec=0, check_for_gpm=0x0) at
          >> os_unix.c:5200 U __be_errno_kernel_to_ios
          >> #7 0x08137e74 in mch_breakcheck () at os_unix.c:4847
          >> #8 0x080dcc85 in vgetorpeek (advance=1) at getchar.c:2014
          >> #9 0x080db494 in vgetc () at getchar.c:1582
          >> #10 0x080db90f in safe_vgetc () at getchar.c:1787
          >> #11 0x0811437c in normal_cmd (oap=0xbfff85d0, toplevel=1) at normal.c:665
          >> #12 0x081b649e in main_loop (cmdwin=0, noexmode=0) at main.c:1306
          >> #13 0x081b5c70 in main (argc=0, argv=0x0) at main.c:1010
          >>
          >> I can consistently reproduce this crash. I couldn't reproduce this crash
          >> with
          >> the earlier Vim 7.2 release.
          >>
          >> Anyone else able to reproduce this crash?
          >
          > I was able to reproduce the crash just once and then I couldn't
          > reproduce it anymore. It seems that something in the X-libraries
          > (starting with XtAppnextEvent()) is going wrong. (I got a double free()
          > error in free())
          >

          I spent some time trying to narrow down the patch that introduced
          this problem. I am not able to reproduce the crash with the
          7.2.446 release. But I am able to reproduce the crash with Vim 7.3
          version.

          I found that the following change to os_unix.c fixes the crash:

          *** os_unix.c.orig 2013-04-15 21:05:25.000000000 -0700
          --- os_unix.c 2013-04-15 21:12:38.000000000 -0700
          *************** setup_term_clip()
          *** 6465,6471 ****
          return;

          x11_setup_atoms(xterm_dpy);
          - x11_setup_selection(xterm_Shell);
          if (x11_display == NULL)
          x11_display = xterm_dpy;

          --- 6465,6470 ----

          This line was introduced in the 7.3 Vim release.

          - Yegappan

          --
          --
          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 vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Lech Lorens
          ... I ve been suffering from random crashes in Cygwin Vim since forever (might be since 7.3 was released). The crashes have always happened when I went into
          Message 4 of 12 , Apr 16, 2013
          • 0 Attachment
            On 16 April 2013 06:20, Yegappan Lakshmanan <yegappanl@...> wrote:
            > I spent some time trying to narrow down the patch that introduced
            > this problem. I am not able to reproduce the crash with the
            > 7.2.446 release. But I am able to reproduce the crash with Vim 7.3
            > version.
            >
            > I found that the following change to os_unix.c fixes the crash:
            >
            > *** os_unix.c.orig 2013-04-15 21:05:25.000000000 -0700
            > --- os_unix.c 2013-04-15 21:12:38.000000000 -0700
            > *************** setup_term_clip()
            > *** 6465,6471 ****
            > return;
            >
            > x11_setup_atoms(xterm_dpy);
            > - x11_setup_selection(xterm_Shell);
            > if (x11_display == NULL)
            > x11_display = xterm_dpy;
            >
            > --- 6465,6470 ----
            >
            > This line was introduced in the 7.3 Vim release

            I've been suffering from random crashes in Cygwin Vim since forever
            (might be since 7.3 was released). The crashes have always happened
            when I went into the visual mode. Perhaps this is related.
            I can't reproduce the crash using your method, though.

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

            ---
            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 vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Bram Moolenaar
            ... Interesting. This line was added for good reasons, to fix the problems with not using a proper timestamp when owning the selection. Thus removing the line
            Message 5 of 12 , Apr 16, 2013
            • 0 Attachment
              Yegappan Lakshmanan wrote:

              > On Fri, Apr 12, 2013 at 1:20 PM, Christian Brabandt <cblists@...> wrote:
              > > Hi Yegappan!
              > >
              > > On Do, 11 Apr 2013, Yegappan Lakshmanan wrote:
              > >
              > >> Hi all,
              > >>
              > >> I am running Vim 7.3.831 on a Linux system built with GTK 2.0.
              > >> When I execute the following steps, Vim crashes:
              > >>
              > >> 1. Open an empty buffer
              > >> 2. Enter insert mode using 'i'
              > >> 3. Insert 262040 characters using <CTRL-R>=repeat('a', 262040)
              > >> 4. Press <Esc>
              > >> 5. Select and yank all the characters using 'V' and 'y'
              > >> 6. Wait for a few seconds and move the cursor
              > >>
              > >> The crash traceback is below:
              > >>
              > >> #0 0x0048dfb9 in free () from /lib/tls/libc.so.6
              > >> #1 0x0088c3a3 in XtFree () from /usr/X11R6/lib/libXt.so.6
              > >> #2 0x008ad502 in XtAppGetSelectionTimeout () from /usr/X11R6/lib/libXt.so.6
              > >> #3 0x008a7144 in _XtRemoveAllInputs () from /usr/X11R6/lib/libXt.so.6
              > >> #4 0x008a74b2 in XtAppNextEvent () from /usr/X11R6/lib/libXt.so.6
              > >> #5 0x08139ae4 in xterm_update () at os_unix.c:6824
              > >> #6 0x08138089 in RealWaitForChar (fd=0, msec=0, check_for_gpm=0x0) at
              > >> os_unix.c:5200 U __be_errno_kernel_to_ios
              > >> #7 0x08137e74 in mch_breakcheck () at os_unix.c:4847
              > >> #8 0x080dcc85 in vgetorpeek (advance=1) at getchar.c:2014
              > >> #9 0x080db494 in vgetc () at getchar.c:1582
              > >> #10 0x080db90f in safe_vgetc () at getchar.c:1787
              > >> #11 0x0811437c in normal_cmd (oap=0xbfff85d0, toplevel=1) at normal.c:665
              > >> #12 0x081b649e in main_loop (cmdwin=0, noexmode=0) at main.c:1306
              > >> #13 0x081b5c70 in main (argc=0, argv=0x0) at main.c:1010
              > >>
              > >> I can consistently reproduce this crash. I couldn't reproduce this crash
              > >> with
              > >> the earlier Vim 7.2 release.
              > >>
              > >> Anyone else able to reproduce this crash?
              > >
              > > I was able to reproduce the crash just once and then I couldn't
              > > reproduce it anymore. It seems that something in the X-libraries
              > > (starting with XtAppnextEvent()) is going wrong. (I got a double free()
              > > error in free())
              > >
              >
              > I spent some time trying to narrow down the patch that introduced
              > this problem. I am not able to reproduce the crash with the
              > 7.2.446 release. But I am able to reproduce the crash with Vim 7.3
              > version.
              >
              > I found that the following change to os_unix.c fixes the crash:
              >
              > *** os_unix.c.orig 2013-04-15 21:05:25.000000000 -0700
              > --- os_unix.c 2013-04-15 21:12:38.000000000 -0700
              > *************** setup_term_clip()
              > *** 6465,6471 ****
              > return;
              >
              > x11_setup_atoms(xterm_dpy);
              > - x11_setup_selection(xterm_Shell);
              > if (x11_display == NULL)
              > x11_display = xterm_dpy;
              >
              > --- 6465,6470 ----
              >
              > This line was introduced in the 7.3 Vim release.

              Interesting. This line was added for good reasons, to fix the problems
              with not using a proper timestamp when owning the selection.
              Thus removing the line is not the way to fix your problem.

              Perhaps something in clip_x11_timestamp_cb() is causing the problem?

              --
              hundred-and-one symptoms of being an internet addict:
              182. You may not know what is happening in the world, but you know
              every bit of net-gossip there is.

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

              ---
              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 vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Yegappan Lakshmanan
              Hi all, ... I still see this crash with Vim 7.4 (of course this problem is not yet fixed). This crash is definitely caused by the code in the
              Message 6 of 12 , Aug 12, 2013
              • 0 Attachment
                Hi all,

                On Tue, Apr 16, 2013 at 1:11 PM, Bram Moolenaar <Bram@...> wrote:
                >
                >> >>
                >> >> I am running Vim 7.3.831 on a Linux system built with GTK 2.0.
                >> >> When I execute the following steps, Vim crashes:
                >> >>
                >> >> 1. Open an empty buffer
                >> >> 2. Enter insert mode using 'i'
                >> >> 3. Insert 262040 characters using <CTRL-R>=repeat('a', 262040)
                >> >> 4. Press <Esc>
                >> >> 5. Select and yank all the characters using 'V' and 'y'
                >> >> 6. Wait for a few seconds and move the cursor
                >> >>
                >> >> The crash traceback is below:
                >> >>
                >> >> #0 0x0048dfb9 in free () from /lib/tls/libc.so.6
                >> >> #1 0x0088c3a3 in XtFree () from /usr/X11R6/lib/libXt.so.6
                >> >> #2 0x008ad502 in XtAppGetSelectionTimeout () from /usr/X11R6/lib/libXt.so.6
                >> >> #3 0x008a7144 in _XtRemoveAllInputs () from /usr/X11R6/lib/libXt.so.6
                >> >> #4 0x008a74b2 in XtAppNextEvent () from /usr/X11R6/lib/libXt.so.6
                >> >> #5 0x08139ae4 in xterm_update () at os_unix.c:6824
                >> >> #6 0x08138089 in RealWaitForChar (fd=0, msec=0, check_for_gpm=0x0) at
                >> >> os_unix.c:5200 U __be_errno_kernel_to_ios
                >> >> #7 0x08137e74 in mch_breakcheck () at os_unix.c:4847
                >> >> #8 0x080dcc85 in vgetorpeek (advance=1) at getchar.c:2014
                >> >> #9 0x080db494 in vgetc () at getchar.c:1582
                >> >> #10 0x080db90f in safe_vgetc () at getchar.c:1787
                >> >> #11 0x0811437c in normal_cmd (oap=0xbfff85d0, toplevel=1) at normal.c:665
                >> >> #12 0x081b649e in main_loop (cmdwin=0, noexmode=0) at main.c:1306
                >> >> #13 0x081b5c70 in main (argc=0, argv=0x0) at main.c:1010
                >> >>
                >> >> I can consistently reproduce this crash. I couldn't reproduce this crash
                >> >> with
                >> >> the earlier Vim 7.2 release.
                >> >>
                >> >> Anyone else able to reproduce this crash?
                >> >
                >> > I was able to reproduce the crash just once and then I couldn't
                >> > reproduce it anymore. It seems that something in the X-libraries
                >> > (starting with XtAppnextEvent()) is going wrong. (I got a double free()
                >> > error in free())
                >> >
                >>
                >> I spent some time trying to narrow down the patch that introduced
                >> this problem. I am not able to reproduce the crash with the
                >> 7.2.446 release. But I am able to reproduce the crash with Vim 7.3
                >> version.
                >>
                >> I found that the following change to os_unix.c fixes the crash:
                >>
                >> *** os_unix.c.orig 2013-04-15 21:05:25.000000000 -0700
                >> --- os_unix.c 2013-04-15 21:12:38.000000000 -0700
                >> *************** setup_term_clip()
                >> *** 6465,6471 ****
                >> return;
                >>
                >> x11_setup_atoms(xterm_dpy);
                >> - x11_setup_selection(xterm_Shell);
                >> if (x11_display == NULL)
                >> x11_display = xterm_dpy;
                >>
                >> --- 6465,6470 ----
                >>
                >> This line was introduced in the 7.3 Vim release.
                >
                > Interesting. This line was added for good reasons, to fix the problems
                > with not using a proper timestamp when owning the selection.
                > Thus removing the line is not the way to fix your problem.
                >
                > Perhaps something in clip_x11_timestamp_cb() is causing the problem?
                >

                I still see this crash with Vim 7.4 (of course this problem is not yet fixed).

                This crash is definitely caused by the code in the
                clip_x11_convert_selection_cb()
                function in ui.c. If I do an early return from this function, then I
                am not able to
                reproduce this problem. But I am not able to pinpoint the problem in
                this function
                (as the backtrace points to the Xt library functions).

                - Yegappan

                --
                --
                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 vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              Your message has been successfully submitted and would be delivered to recipients shortly.