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

SEGV related to vimrc

Expand Messages
  • Lasse Kliemann
    Attached is the file l2.c. With this file (and with reformatting C comments in many other situations too) I experienced segmentation faults. Let s have a look
    Message 1 of 8 , Nov 25, 2002
      Attached is the file l2.c. With this file (and with reformatting C comments in
      many other situations too) I experienced segmentation faults. Let's have a
      look at this. First, I use no configuration file, that means no global vimrc
      and no ~/.vimrc. Everything works fine, I can load l2.c and type gqap to
      format it. Now, I do

      touch ~/.vimrc

      When I open l2.c now and type gqap, I get

      Vim: Caught deadly signal SEGV
      Vim: Finished.
      Segmentation fault

      immediately. But when I open the file with

      vim -u ~/.vimrc l2.c

      the gqap works fine. Now, I do

      echo "set nocompatible" > ~/.vimrc

      with the result, that now even

      vim -u ~/.vimrc l2.c

      and doing gqap leads to the described segmentation fault. I tried this with
      vim 6.1 and vim 6.1.263. My system is basically an LFS with Linux 2.4.20-rc1
      and glibc-2.3.1. The vim I'm using is linked dynamically against the newest
      ncurses, i.e., 5.3 with all patches applied.

      As a workaround, I'm now using my normal (quite crowded) vimrc via the -u
      switch and with the nocompatible option removed. Omitting -u and letting vim
      load the file by itself still leads to segmentation faults.

      Any hints on this? Have I found a bug? I'll be happy to provide more
      information if needed.

      Regards,
      Lasse
    • Lasse Kliemann
      ... A better workaround is using set comments=://,b:#,:%,:XCOMM,n: ,fb:- to disable formatting of C comments and otherwise let comments be formatted according
      Message 2 of 8 , Nov 25, 2002
        * I wrote:
        > As a workaround, I'm now using my normal (quite crowded) vimrc via the -u
        > switch and with the nocompatible option removed. Omitting -u and letting
        > vim load the file by itself still leads to segmentation faults.

        A better workaround is using

        set comments=://,b:#,:%,:XCOMM,n:>,fb:-

        to disable formatting of C comments and otherwise let comments be formatted
        according to the default. With this, I can use vim as normal, in particular
        let it include it's configuration files automatically. (But of course doing
        gqap on a C comment now messes it all up. But at least no crashes anymore.)
      • David Mankin
        ... Bram is on vacation, but having watched the list for a little while I can say this: most vim crashes result from compiling vim with gcc 3.x with the -O2
        Message 3 of 8 , Nov 25, 2002
          On Monday, November 25, 2002, at 04:19 AM, Lasse Kliemann wrote:

          > Attached is the file l2.c. With this file (and with reformatting C
          > comments in
          > many other situations too) I experienced segmentation faults. Let's
          > have a
          > look at this. First, I use no configuration file, that means no global
          > vimrc
          > and no ~/.vimrc. Everything works fine, I can load l2.c and type gqap
          > to
          > format it. Now, I do
          >
          > touch ~/.vimrc
          >
          > When I open l2.c now and type gqap, I get
          >
          > Vim: Caught deadly signal SEGV
          > Vim: Finished.
          > Segmentation fault
          >
          > immediately. But when I open the file with
          >

          Bram is on vacation, but having watched the list for a little while I
          can say this: most vim crashes result from compiling vim with gcc 3.x
          with the -O2 optimization. If you're using gcc 3.x, try changing the
          optimization to -O instead, recompile vim, and see if that fixes the
          problem. If not, then you should use gdb on the core file to get the
          backtrace to show exactly where vim is crashing.


          Hope that helps,
          David
        • Lasse Kliemann
          * David Mankin writes: [ crashes with comments in C ] ... I do use 3.2.1, indeed. ... Yes, it does! Thank you very much. Sorry for posting this to -dev. I was
          Message 4 of 8 , Nov 25, 2002
            * David Mankin writes:

            [ crashes with comments in C ]

            > Bram is on vacation, but having watched the list for a little while I can
            > say this: most vim crashes result from compiling vim with gcc 3.x with the
            > -O2 optimization. If you're using gcc 3.x,

            I do use 3.2.1, indeed.

            > try changing the optimization to -O instead, recompile vim, and see if that
            > fixes the problem.

            Yes, it does! Thank you very much. Sorry for posting this to -dev. I was sure
            of having found a bug in vim.

            regards,
            Lasse
          • Bram Moolenaar
            ... For gcc 3.2 we add the argument -fno-strength-reduce. Could you try adding that argument instead of reducing -O2 to -O? Also try running configure with
            Message 5 of 8 , Dec 29, 2002
              Lasse Kliemann wrote:

              > * David Mankin writes:
              >
              > [ crashes with comments in C ]
              >
              > > Bram is on vacation, but having watched the list for a little while
              > > I can say this: most vim crashes result from compiling vim with gcc
              > > 3.x with the -O2 optimization. If you're using gcc 3.x,
              >
              > I do use 3.2.1, indeed.
              >
              > > try changing the optimization to -O instead, recompile vim, and see
              > > if that fixes the problem.
              >
              > Yes, it does! Thank you very much. Sorry for posting this to -dev. I
              > was sure of having found a bug in vim.

              For gcc 3.2 we add the argument -fno-strength-reduce. Could you try
              adding that argument instead of reducing -O2 to -O?

              Also try running configure with patch 6.1.260 included. It checks for
              versions 3.1 and 3.2. Perhaps we need to add 3.2.1 to the list of
              version numbers now?

              --
              hundred-and-one symptoms of being an internet addict:
              192. Your boss asks you to "go fer" coffee and you come up with 235 FTP sites.

              /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
              /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
              \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
              \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
            • Lasse Kliemann
              ... I compiled vim-6.1.263 with CFLAGS= -fno-strength-reduce -O2 and it works fine. ... I ve been using all patches up to 6.1.263 included. Not setting CFLAGS
              Message 6 of 8 , Dec 30, 2002
                * Bram Moolenaar writes:
                >
                > Lasse Kliemann wrote:
                >
                > > * David Mankin writes:
                > >
                > > [ crashes with comments in C ]
                > >
                > > > Bram is on vacation, but having watched the list for a little while
                > > > I can say this: most vim crashes result from compiling vim with gcc
                > > > 3.x with the -O2 optimization. If you're using gcc 3.x,
                > >
                > > I do use 3.2.1, indeed.
                > >
                > > > try changing the optimization to -O instead, recompile vim, and see
                > > > if that fixes the problem.
                > >
                > > Yes, it does! Thank you very much. Sorry for posting this to -dev. I
                > > was sure of having found a bug in vim.
                >
                > For gcc 3.2 we add the argument -fno-strength-reduce. Could you try
                > adding that argument instead of reducing -O2 to -O?

                I compiled vim-6.1.263 with

                CFLAGS="-fno-strength-reduce -O2"

                and it works fine.

                > Also try running configure with patch 6.1.260 included. It checks for
                > versions 3.1 and 3.2. Perhaps we need to add 3.2.1 to the list of
                > version numbers now?

                I've been using all patches up to 6.1.263 included. Not setting CFLAGS at all
                or using »CFLAGS=-O2« leads to the desribed crashes.

                Also 6.1 produced these crashes when I didn't set CFLAGS and so went with the
                default.
              • Tomas Vasko
                ... I have just now upgraded my gcc to version: gcc (GCC) 3.2.2 20021231 (Debian prerelease) vim included patches 1-267 configured with --with-features=normal
                Message 7 of 8 , Jan 1, 2003
                  > > Yes, it does! Thank you very much. Sorry for posting this to -dev. I
                  > > was sure of having found a bug in vim.
                  >
                  > For gcc 3.2 we add the argument -fno-strength-reduce. Could you try
                  > adding that argument instead of reducing -O2 to -O?
                  >
                  > Also try running configure with patch 6.1.260 included. It checks for
                  > versions 3.1 and 3.2. Perhaps we need to add 3.2.1 to the list of
                  > version numbers now?

                  I have just now upgraded my gcc to version:
                  gcc (GCC) 3.2.2 20021231 (Debian prerelease)

                  vim included patches 1-267 configured with --with-features=normal and
                  compiled by this gcc version with -O2 and without -fno-strength-reduce
                  passed all the tests OK, so it seems that 3.2.2 works well, but test for
                  3.2.1 should be added...

                  --
                  The more I see, The less I believe...
                • Bram Moolenaar
                  ... Thanks for testing this. I ll make a patch to add 3.2.1 to the list of versions that require -fno-strength-reduce . Hopefully we have caught all bad
                  Message 8 of 8 , Jan 1, 2003
                    Tomas Vasko wrote:

                    > > > Yes, it does! Thank you very much. Sorry for posting this to -dev. I
                    > > > was sure of having found a bug in vim.
                    > >
                    > > For gcc 3.2 we add the argument -fno-strength-reduce. Could you try
                    > > adding that argument instead of reducing -O2 to -O?
                    > >
                    > > Also try running configure with patch 6.1.260 included. It checks for
                    > > versions 3.1 and 3.2. Perhaps we need to add 3.2.1 to the list of
                    > > version numbers now?
                    >
                    > I have just now upgraded my gcc to version:
                    > gcc (GCC) 3.2.2 20021231 (Debian prerelease)
                    >
                    > vim included patches 1-267 configured with --with-features=normal and
                    > compiled by this gcc version with -O2 and without -fno-strength-reduce
                    > passed all the tests OK, so it seems that 3.2.2 works well, but test for
                    > 3.2.1 should be added...

                    Thanks for testing this. I'll make a patch to add 3.2.1 to the list of
                    versions that require "-fno-strength-reduce". Hopefully we have caught
                    all "bad" gcc versions then.

                    --
                    Women are probably the main cause of free software starvation.

                    /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                    /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
                    \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
                    \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
                  Your message has been successfully submitted and would be delivered to recipients shortly.