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

Re: Crash with regexp

Expand Messages
  • Marcin Szamotulski
    ... Today a user of my plugin reported that vim crashes and this is due to a similar problem. Now vim crashes with this pattern: { %([^{}]* |{ %([^{}] )*} )*}
    Message 1 of 11 , Aug 1, 2013
      On 06:28 Mon 29 Jul , Marcin Szamotulski wrote:
      > On 22:07 Sun 28 Jul , Bram Moolenaar wrote:
      > >
      > > Marcin Szamotulski wrote:
      > >
      > > > Vim crashes with the following pattern:
      > > >
      > > > \%(\%(\|\d\|-\|\.\)*\|\*\)
      > > >
      > > > And it does not crash with
      > > >
      > > > \%(\%(\d\|-\|\.\)*\|\*\)
      > > >
      > > > It is part of a pattern that matches package (the part matches the
      > > > version number) inside:
      > > >
      > > > sys-kernel/gentoo-sources-3.6.11
      > > >
      > > > I am not sure why I put "\(\|" inside the pattern, but vim (with -u
      > > > NONE) crashes when searching for that pattern in a file which contains
      > > > the above example.
      > >
      > > I can easily reproduce it, unfortunately.
      > >
      > > --
      > > How To Keep A Healthy Level Of Insanity:
      > > 17. When the money comes out the ATM, scream "I won!, I won! 3rd
      > > time this week!!!!!"
      > >
      > > /// 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 ///
      >
      > This is a simpler pattern that crashes vim:
      >
      > \%(\%(\|a\)*\)
      >
      > but
      >
      > \(\(\|a\)*\)
      >
      > works fine. Also
      >
      > \%(\(\|a\)*\)
      >
      > works fine but
      >
      > \(\%(\|a\)*\)
      >
      > crashes. So there is some problem with the inner \%(\) group.
      >
      > Best regards,
      > Marcin

      Today a user of my plugin reported that vim crashes and this is due to
      a similar problem. Now vim crashes with this pattern:

      {\%([^{}]*\|{\%([^{}]\)*}\)*}

      but changing only the outer \%(...\) to \(...\) fixes the problem. This
      pattern matches what is inside {...} but also will match { {....} },
      i.e when another {...} is embedded.

      Bets regards,
      Marcin

      --
      --
      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
      ... Patch 7.4b.002 changes these kind of things. I could also make it crash with %( )*. There was another problem that went unnoticed that only happened for
      Message 2 of 11 , Aug 1, 2013
        Marcin Szamotulski wrote:

        > On 06:28 Mon 29 Jul , Marcin Szamotulski wrote:
        > > On 22:07 Sun 28 Jul , Bram Moolenaar wrote:
        > > >
        > > > Marcin Szamotulski wrote:
        > > >
        > > > > Vim crashes with the following pattern:
        > > > >
        > > > > \%(\%(\|\d\|-\|\.\)*\|\*\)
        > > > >
        > > > > And it does not crash with
        > > > >
        > > > > \%(\%(\d\|-\|\.\)*\|\*\)
        > > > >
        > > > > It is part of a pattern that matches package (the part matches the
        > > > > version number) inside:
        > > > >
        > > > > sys-kernel/gentoo-sources-3.6.11
        > > > >
        > > > > I am not sure why I put "\(\|" inside the pattern, but vim (with -u
        > > > > NONE) crashes when searching for that pattern in a file which contains
        > > > > the above example.
        > > >
        > > > I can easily reproduce it, unfortunately.
        > > >
        > > > --
        > > > How To Keep A Healthy Level Of Insanity:
        > > > 17. When the money comes out the ATM, scream "I won!, I won! 3rd
        > > > time this week!!!!!"
        > > >
        > > > /// 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 ///
        > >
        > > This is a simpler pattern that crashes vim:
        > >
        > > \%(\%(\|a\)*\)
        > >
        > > but
        > >
        > > \(\(\|a\)*\)
        > >
        > > works fine. Also
        > >
        > > \%(\(\|a\)*\)
        > >
        > > works fine but
        > >
        > > \(\%(\|a\)*\)
        > >
        > > crashes. So there is some problem with the inner \%(\) group.
        > >
        > > Best regards,
        > > Marcin
        >
        > Today a user of my plugin reported that vim crashes and this is due to
        > a similar problem. Now vim crashes with this pattern:
        >
        > {\%([^{}]*\|{\%([^{}]\)*}\)*}
        >
        > but changing only the outer \%(...\) to \(...\) fixes the problem. This
        > pattern matches what is inside {...} but also will match { {....} },
        > i.e when another {...} is embedded.

        Patch 7.4b.002 changes these kind of things. I could also make it crash
        with \%(\)*.

        There was another problem that went unnoticed that only happened for
        \(\) after the fix and there was only a test for \%(\). So hopefully
        all similar cases are solved now.

        --
        hundred-and-one symptoms of being an internet addict:
        36. You miss more than five meals a week downloading the latest games from
        Apogee.

        /// 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.
      • Marcin Szamotulski
        ... Thanks, indeed it fixed the issues. Best regards, Marcin -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply
        Message 3 of 11 , Aug 1, 2013
          On 16:27 Thu 01 Aug , Bram Moolenaar wrote:
          >
          > Marcin Szamotulski wrote:
          >
          > > On 06:28 Mon 29 Jul , Marcin Szamotulski wrote:
          > > > On 22:07 Sun 28 Jul , Bram Moolenaar wrote:
          > > > >
          > > > > Marcin Szamotulski wrote:
          > > > >
          > > > > > Vim crashes with the following pattern:
          > > > > >
          > > > > > \%(\%(\|\d\|-\|\.\)*\|\*\)
          > > > > >
          > > > > > And it does not crash with
          > > > > >
          > > > > > \%(\%(\d\|-\|\.\)*\|\*\)
          > > > > >
          > > > > > It is part of a pattern that matches package (the part matches the
          > > > > > version number) inside:
          > > > > >
          > > > > > sys-kernel/gentoo-sources-3.6.11
          > > > > >
          > > > > > I am not sure why I put "\(\|" inside the pattern, but vim (with -u
          > > > > > NONE) crashes when searching for that pattern in a file which contains
          > > > > > the above example.
          > > > >
          > > > > I can easily reproduce it, unfortunately.
          > > > >
          > > > > --
          > > > > How To Keep A Healthy Level Of Insanity:
          > > > > 17. When the money comes out the ATM, scream "I won!, I won! 3rd
          > > > > time this week!!!!!"
          > > > >
          > > > > /// 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 ///
          > > >
          > > > This is a simpler pattern that crashes vim:
          > > >
          > > > \%(\%(\|a\)*\)
          > > >
          > > > but
          > > >
          > > > \(\(\|a\)*\)
          > > >
          > > > works fine. Also
          > > >
          > > > \%(\(\|a\)*\)
          > > >
          > > > works fine but
          > > >
          > > > \(\%(\|a\)*\)
          > > >
          > > > crashes. So there is some problem with the inner \%(\) group.
          > > >
          > > > Best regards,
          > > > Marcin
          > >
          > > Today a user of my plugin reported that vim crashes and this is due to
          > > a similar problem. Now vim crashes with this pattern:
          > >
          > > {\%([^{}]*\|{\%([^{}]\)*}\)*}
          > >
          > > but changing only the outer \%(...\) to \(...\) fixes the problem. This
          > > pattern matches what is inside {...} but also will match { {....} },
          > > i.e when another {...} is embedded.
          >
          > Patch 7.4b.002 changes these kind of things. I could also make it crash
          > with \%(\)*.
          >
          > There was another problem that went unnoticed that only happened for
          > \(\) after the fix and there was only a test for \%(\). So hopefully
          > all similar cases are solved now.
          >
          > --
          > hundred-and-one symptoms of being an internet addict:
          > 36. You miss more than five meals a week downloading the latest games from
          > Apogee.
          >
          > /// 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 ///


          Thanks, indeed it fixed the issues.

          Best regards,
          Marcin

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