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

NFA engine fails with SEGV on ruby file

Expand Messages
  • Aliaksandr Rahalevich
    It works with set regexpengine=1 but fails to open file with regexpengine=2. It s definitely working with 1242 patchset, but fails with latest. -- -- You
    Message 1 of 8 , Jun 29, 2013
    • 0 Attachment
      It works with
      set regexpengine=1
      but fails to open file with regexpengine=2.

      It's definitely working with 1242 patchset, but fails with latest.

      --
      --
      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.
    • LCD 47
      ... Attaching a core file is not the proper way to report a bug. What you should have done was print the core in a nice, large font, scan the prints at 1200
      Message 2 of 8 , Jun 29, 2013
      • 0 Attachment
        On 29 June 2013, Aliaksandr Rahalevich <saksmlz@...> wrote:
        > It works with
        > set regexpengine=1
        > but fails to open file with regexpengine=2.
        >
        > It's definitely working with 1242 patchset, but fails with latest.

        Attaching a core file is not the proper way to report a bug. What
        you should have done was print the core in a nice, large font, scan the
        prints at 1200 DPI true colour, and attach the scans. For extra points,
        post multiple copies of it. :)

        Seriously now: a core file can be used for debugging only on your
        machine. It can also contain sensitive information, such as passwords
        that happened to be in memory at the time your program crashed. Never,
        ever post core files to public lists.

        /lcd

        --
        --
        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.
      • Dominique Pellé
        ... Hi You explanations are not detailed and the attached files are not useful: a core file is useless without your vim executable. Nevetherless, I can see a
        Message 3 of 8 , Jun 29, 2013
        • 0 Attachment
          Aliaksandr Rahalevich wrote:
          > It works with
          > set regexpengine=1
          > but fails to open file with regexpengine=2.
          >
          > It's definitely working with 1242 patchset, but fails with latest.

          Hi

          You explanations are not detailed and the attached files
          are not useful: a core file is useless without your vim
          executable. Nevetherless, I can see a bug when using
          a ruby file (attached) with re=2 and Vim-7.3.1270:

          $ valgrind --num-callers=50 --track-origins=yes \
          vim -u NONE \
          -c 'syntax on' \
          -c ':norm G' \
          /usr/share/inkscape/extensions/simplepath.rb

          ==5196== Memcheck, a memory error detector
          ==5196== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
          ==5196== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
          ==5196== Command: ./vim -u NONE -c syntax\ on -c :norm\ G
          /usr/share/inkscape/extensions/simplepath.rb
          ==5196== Parent PID: 4616
          ==5196==
          ==5196== Invalid write of size 8
          ==5196== at 0x4C2CB05: memcpy@GLIBC_2.2.5 (in
          /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          ==5196== by 0x573D44: addstate_here (regexp_nfa.c:4233)
          ==5196== by 0x5755AA: nfa_regmatch (regexp_nfa.c:5265)
          ==5196== by 0x577AB7: nfa_regtry (regexp_nfa.c:6217)
          ==5196== by 0x57819B: nfa_regexec_both (regexp_nfa.c:6401)
          ==5196== by 0x578614: nfa_regexec_multi (regexp_nfa.c:6650)
          ==5196== by 0x578802: vim_regexec_multi (regexp.c:8088)
          ==5196== by 0x5C33BD: syn_regexec (syntax.c:3272)
          ==5196== by 0x5C0DB0: syn_current_attr (syntax.c:2092)
          ==5196== by 0x5C039E: syn_finish_line (syntax.c:1770)
          ==5196== by 0x5BDFF5: syntax_start (syntax.c:604)
          ==5196== by 0x57DE7D: win_line (screen.c:2886)
          ==5196== by 0x57B9B4: win_update (screen.c:1870)
          ==5196== by 0x578FD1: update_screen (screen.c:536)
          ==5196== by 0x63BC25: main_loop (main.c:1232)
          ==5196== by 0x63B790: main (main.c:1020)
          ==5196== Address 0x10801638 is not stack'd, malloc'd or (recently) free'd
          ==5196==
          ==5196== Invalid read of size 8
          ==5196== at 0x4C2CA2E: memcpy@GLIBC_2.2.5 (in
          /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          ==5196== by 0x573D92: addstate_here (regexp_nfa.c:4236)
          ==5196== by 0x5755AA: nfa_regmatch (regexp_nfa.c:5265)
          ==5196== by 0x577AB7: nfa_regtry (regexp_nfa.c:6217)
          ==5196== by 0x57819B: nfa_regexec_both (regexp_nfa.c:6401)
          ==5196== by 0x578614: nfa_regexec_multi (regexp_nfa.c:6650)
          ==5196== by 0x578802: vim_regexec_multi (regexp.c:8088)
          ==5196== by 0x5C33BD: syn_regexec (syntax.c:3272)
          ==5196== by 0x5C0DB0: syn_current_attr (syntax.c:2092)
          ==5196== by 0x5C039E: syn_finish_line (syntax.c:1770)
          ==5196== by 0x5BDFF5: syntax_start (syntax.c:604)
          ==5196== by 0x57DE7D: win_line (screen.c:2886)
          ==5196== by 0x57B9B4: win_update (screen.c:1870)
          ==5196== by 0x578FD1: update_screen (screen.c:536)
          ==5196== by 0x63BC25: main_loop (main.c:1232)
          ==5196== by 0x63B790: main (main.c:1020)
          ==5196== Address 0x108010f0 is 0 bytes after a block of size 62,560 alloc'd
          ==5196== at 0x4C2B3F8: malloc (in
          /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          ==5196== by 0x50D8B0: lalloc (misc2.c:929)
          ==5196== by 0x574EE6: nfa_regmatch (regexp_nfa.c:4959)
          ==5196== by 0x577AB7: nfa_regtry (regexp_nfa.c:6217)
          ==5196== by 0x57819B: nfa_regexec_both (regexp_nfa.c:6401)
          ==5196== by 0x578614: nfa_regexec_multi (regexp_nfa.c:6650)
          ==5196== by 0x578802: vim_regexec_multi (regexp.c:8088)
          ==5196== by 0x5C33BD: syn_regexec (syntax.c:3272)
          ==5196== by 0x5C0DB0: syn_current_attr (syntax.c:2092)
          ==5196== by 0x5C039E: syn_finish_line (syntax.c:1770)
          ==5196== by 0x5BDFF5: syntax_start (syntax.c:604)
          ==5196== by 0x57DE7D: win_line (screen.c:2886)
          ==5196== by 0x57B9B4: win_update (screen.c:1870)
          ==5196== by 0x578FD1: update_screen (screen.c:536)
          ==5196== by 0x63BC25: main_loop (main.c:1232)
          ==5196== by 0x63B790: main (main.c:1020)
          ==5196==
          ==5196== Invalid read of size 8
          ==5196== at 0x4C2CA20: memcpy@GLIBC_2.2.5 (in
          /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          ==5196== by 0x573D92: addstate_here (regexp_nfa.c:4236)
          ==5196== by 0x5755AA: nfa_regmatch (regexp_nfa.c:5265)
          ==5196== by 0x577AB7: nfa_regtry (regexp_nfa.c:6217)
          ==5196== by 0x57819B: nfa_regexec_both (regexp_nfa.c:6401)
          ==5196== by 0x578614: nfa_regexec_multi (regexp_nfa.c:6650)
          ==5196== by 0x578802: vim_regexec_multi (regexp.c:8088)
          ==5196== by 0x5C33BD: syn_regexec (syntax.c:3272)
          ==5196== by 0x5C0DB0: syn_current_attr (syntax.c:2092)
          ==5196== by 0x5C039E: syn_finish_line (syntax.c:1770)
          ==5196== by 0x5BDFF5: syntax_start (syntax.c:604)
          ==5196== by 0x57DE7D: win_line (screen.c:2886)
          ==5196== by 0x57B9B4: win_update (screen.c:1870)
          ==5196== by 0x578FD1: update_screen (screen.c:536)
          ==5196== by 0x63BC25: main_loop (main.c:1232)
          ==5196== by 0x63B790: main (main.c:1020)
          ==5196== Address 0x108010f8 is 8 bytes after a block of size 62,560 alloc'd
          ==5196== at 0x4C2B3F8: malloc (in
          /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          ==5196== by 0x50D8B0: lalloc (misc2.c:929)
          ==5196== by 0x574EE6: nfa_regmatch (regexp_nfa.c:4959)
          ==5196== by 0x577AB7: nfa_regtry (regexp_nfa.c:6217)
          ==5196== by 0x57819B: nfa_regexec_both (regexp_nfa.c:6401)
          ==5196== by 0x578614: nfa_regexec_multi (regexp_nfa.c:6650)
          ==5196== by 0x578802: vim_regexec_multi (regexp.c:8088)
          ==5196== by 0x5C33BD: syn_regexec (syntax.c:3272)
          ==5196== by 0x5C0DB0: syn_current_attr (syntax.c:2092)
          ==5196== by 0x5C039E: syn_finish_line (syntax.c:1770)
          ==5196== by 0x5BDFF5: syntax_start (syntax.c:604)
          ==5196== by 0x57DE7D: win_line (screen.c:2886)
          ==5196== by 0x57B9B4: win_update (screen.c:1870)
          ==5196== by 0x578FD1: update_screen (screen.c:536)
          ==5196== by 0x63BC25: main_loop (main.c:1232)
          ==5196== by 0x63B790: main (main.c:1020)
          ==5196==

          valgrind: m_mallocfree.c:266 (mk_plain_bszB): Assertion 'bszB != 0' failed.
          valgrind: This is probably caused by your program erroneously writing past the
          end of a heap block and corrupting heap metadata. If you fix any
          invalid writes reported by Memcheck, this assertion failure will
          probably go away. Please try that before reporting this as a bug.

          ==5196== at 0x3804C6CF: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
          ==5196== by 0x3804C812: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
          ==5196== by 0x38000883: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
          ==5196== by 0x3805887E: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
          ==5196== by 0x38020C95: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
          ==5196== by 0x38021280: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
          ==5196== by 0x3802146A: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
          ==5196== by 0x3808F656: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
          ==5196== by 0x3809E68C: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)

          sched status:
          running_tid=1

          Thread 1: status = VgTs_Runnable
          ==5196== at 0x4C2B3F8: malloc (in
          /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          ==5196== by 0x50D8B0: lalloc (misc2.c:929)
          ==5196== by 0x574EBB: nfa_regmatch (regexp_nfa.c:4957)
          ==5196== by 0x5748DE: recursive_regmatch (regexp_nfa.c:4619)
          ==5196== by 0x575406: nfa_regmatch (regexp_nfa.c:5211)
          ==5196== by 0x577AB7: nfa_regtry (regexp_nfa.c:6217)
          ==5196== by 0x57819B: nfa_regexec_both (regexp_nfa.c:6401)
          ==5196== by 0x578614: nfa_regexec_multi (regexp_nfa.c:6650)
          ==5196== by 0x578802: vim_regexec_multi (regexp.c:8088)
          ==5196== by 0x5C33BD: syn_regexec (syntax.c:3272)
          ==5196== by 0x5C0DB0: syn_current_attr (syntax.c:2092)
          ==5196== by 0x5C039E: syn_finish_line (syntax.c:1770)
          ==5196== by 0x5BDFF5: syntax_start (syntax.c:604)
          ==5196== by 0x57DE7D: win_line (screen.c:2886)
          ==5196== by 0x57B9B4: win_update (screen.c:1870)
          ==5196== by 0x578FD1: update_screen (screen.c:536)
          ==5196== by 0x63BC25: main_loop (main.c:1232)
          ==5196== by 0x63B790: main (main.c:1020)

          Thread 2: status = VgTs_WaitSys
          ==5196== at 0x858E033: ??? (syscall-template.S:82)
          ==5196== by 0x7E4DE4B: ??? (in /usr/lib/libtcl8.5.so.0)
          ==5196== by 0x7B5FE99: start_thread (pthread_create.c:308)
          ==5196== by 0x8594CCC: clone (clone.S:112)

          --
          --
          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
          ... What do you mean with latest ? The backtrace is not useful. You need to compile with debugging symbols, usually the -g flag. What are you doing exactly?
          Message 4 of 8 , Jun 29, 2013
          • 0 Attachment
            Aliaksandr Rahalevich wrote:

            > It works with
            > set regexpengine=1
            > but fails to open file with regexpengine=2.
            >
            > It's definitely working with 1242 patchset, but fails with latest.

            What do you mean with "latest"?

            The backtrace is not useful. You need to compile with debugging
            symbols, usually the -g flag.

            What are you doing exactly? If it requires a ruby file, then please
            include one.

            --
            A mathematician is a device for turning coffee into theorems.
            Paul Erdos
            A computer programmer is a device for turning coffee into bugs.
            Bram Moolenaar

            /// 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.
          • Bram Moolenaar
            ... [...] Thanks. That pinpoints the problem. I ll add this Ruby file to my collection. I ll send out a patch. -- WOMAN: Dennis, there s some lovely filth
            Message 5 of 8 , Jun 30, 2013
            • 0 Attachment
              Dominique Pelle wrote:

              > Aliaksandr Rahalevich wrote:
              > > It works with
              > > set regexpengine=1
              > > but fails to open file with regexpengine=2.
              > >
              > > It's definitely working with 1242 patchset, but fails with latest.
              >
              > Hi
              >
              > You explanations are not detailed and the attached files
              > are not useful: a core file is useless without your vim
              > executable. Nevetherless, I can see a bug when using
              > a ruby file (attached) with re=2 and Vim-7.3.1270:
              >
              > $ valgrind --num-callers=50 --track-origins=yes \
              > vim -u NONE \
              > -c 'syntax on' \
              > -c ':norm G' \
              > /usr/share/inkscape/extensions/simplepath.rb
              >
              > ==5196== Memcheck, a memory error detector
              > ==5196== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
              > ==5196== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
              > ==5196== Command: ./vim -u NONE -c syntax\ on -c :norm\ G
              > /usr/share/inkscape/extensions/simplepath.rb
              > ==5196== Parent PID: 4616
              > ==5196==
              > ==5196== Invalid write of size 8
              > ==5196== at 0x4C2CB05: memcpy@GLIBC_2.2.5 (in
              > /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
              > ==5196== by 0x573D44: addstate_here (regexp_nfa.c:4233)
              > ==5196== by 0x5755AA: nfa_regmatch (regexp_nfa.c:5265)
              > ==5196== by 0x577AB7: nfa_regtry (regexp_nfa.c:6217)

              [...]

              Thanks. That pinpoints the problem. I'll add this Ruby file to my
              collection.

              I'll send out a patch.

              --
              WOMAN: Dennis, there's some lovely filth down here. Oh -- how d'you do?
              ARTHUR: How do you do, good lady. I am Arthur, King of the Britons.
              Who's castle is that?
              WOMAN: King of the who?
              The Quest for the Holy Grail (Monty Python)

              /// 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.
            • Aliaksandr Rahalevich
              ... Thanks :) That s my first bug report about vim. Will do it better next time! -- -- You received this message from the vim_dev maillist. Do not top-post!
              Message 6 of 8 , Jun 30, 2013
              • 0 Attachment
                воскресенье, 30 июня 2013 г., 0:35:59 UTC+4 пользователь LCD 47 написал:
                > On 29 June 2013, Aliaksandr Rahalevich <saksmlz@...> wrote:
                >
                > > It works with
                >
                > > set regexpengine=1
                >
                > > but fails to open file with regexpengine=2.
                >
                > >
                >
                > > It's definitely working with 1242 patchset, but fails with latest.
                >
                >
                >
                > Attaching a core file is not the proper way to report a bug. What
                >
                > you should have done was print the core in a nice, large font, scan the
                >
                > prints at 1200 DPI true colour, and attach the scans. For extra points,
                >
                > post multiple copies of it. :)
                >
                >
                >
                > Seriously now: a core file can be used for debugging only on your
                >
                > machine. It can also contain sensitive information, such as passwords
                >
                > that happened to be in memory at the time your program crashed. Never,
                >
                > ever post core files to public lists.
                >
                >
                >
                > /lcd

                Thanks :) That's my first bug report about vim. Will do it better next time!

                --
                --
                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 can t believe you actually did send a 3 megabyte attachment to all the people out there reading the list! I know it s hard to believe but there are
                Message 7 of 8 , Jun 30, 2013
                • 0 Attachment
                  On 29-Jun-2013 Aliaksandr Rahalevich <saksmlz@...> wrote:
                  > It works with
                  > set regexpengine=1
                  > but fails to open file with regexpengine=2.
                  >
                  > It's definitely working with 1242 patchset, but fails with latest.

                  I can't believe you actually did send a 3 megabyte attachment to all the
                  people out there reading the list! I know it's hard to believe but there
                  are zillions of people without broadband connections or with capped
                  connections or connecting through their mobile phones perhaps paying
                  absurd roaming fees.
                  When I pressed Enter to view your message, my connection was used fully
                  used for about a minute and all I got in return was a useless core file
                  which you could have placed on pastebin or wherever on the internet. But
                  you can't be bothered to figure this out, can you?

                  I'm pretty young, I think, but these are the moments that I feel old
                  just because I still remember that a 56kbps modem connection used to be
                  fast.

                  --
                  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.
                • Aliaksandr Rahalevich
                  ... Sorry dude, but nobody forces you to download all the attachments. If you have slow connection - just don t download them. I uploaded core file, because
                  Message 8 of 8 , Jul 1, 2013
                  • 0 Attachment
                    понедельник, 1 июля 2013 г., 1:15:35 UTC+3 пользователь Lech Lorens написал:
                    > On 29-Jun-2013 Aliaksandr Rahalevich <saksmlz@...> wrote:
                    >
                    > > It works with
                    >
                    > > set regexpengine=1
                    >
                    > > but fails to open file with regexpengine=2.
                    >
                    > >
                    >
                    > > It's definitely working with 1242 patchset, but fails with latest.
                    >
                    >
                    >
                    > I can't believe you actually did send a 3 megabyte attachment to all the
                    >
                    > people out there reading the list! I know it's hard to believe but there
                    >
                    > are zillions of people without broadband connections or with capped
                    >
                    > connections or connecting through their mobile phones perhaps paying
                    >
                    > absurd roaming fees.
                    >
                    > When I pressed Enter to view your message, my connection was used fully
                    >
                    > used for about a minute and all I got in return was a useless core file
                    >
                    > which you could have placed on pastebin or wherever on the internet. But
                    >
                    > you can't be bothered to figure this out, can you?
                    >
                    >
                    >
                    > I'm pretty young, I think, but these are the moments that I feel old
                    >
                    > just because I still remember that a 56kbps modem connection used to be
                    >
                    > fast.
                    >
                    >
                    >
                    > --
                    >
                    > Lech

                    Sorry dude, but nobody forces you to download all the attachments. If you have slow connection - just don't download them. I uploaded core file, because didn't know what info to sumbit to be useful. Other guys already pointed me to a proper way to do that.

                    Are you sure that connection was busy because of "somehow automatically" downloading attachments?

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