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

Re: Patch 7.3.903

Expand Messages
  • Bram Moolenaar
    ... I don t understand how it can get there. When the pointer is NULL then viminfo_hisidx[type] must be zero and the if (i = 0) must be false. Perhaps a
    Message 1 of 7 , Apr 15, 2013
      Ron Aaron wrote:

      > Same place. The "viminfo_history" has zeroes:
      >
      > (gdb) l
      > 6228 if (i >= 0)
      > 6229 while (num_saved > 0
      > 6230 && !(round == 2 && i >= viminfo_hisidx[type]))
      > 6231 {
      > 6232 p = round == 1 ? history[type][i].hisstr
      > 6233 : viminfo_history[type][i];
      > 6234 if (p != NULL && (round == 2 || !history[type][i].viminfo))
      > 6235 {
      > 6236 --num_saved;
      > 6237 fputc(hist_type2char(type, TRUE), fp);
      > (gdb) p history
      > $1 = {0x848c000, 0x848d400, 0x848ca00, 0x848f200, 0x848e800}
      > (gdb) p viminfo_history
      > $2 = {0x0, 0x0, 0x0, 0x0, 0x0}

      I don't understand how it can get there. When the pointer is NULL then
      viminfo_hisidx[type] must be zero and the "if (i >= 0)" must be false.

      Perhaps a stack trace will help. Or setting a breakpoint at
      write_viminfo_history() and stepping through it. And check that
      finish_viminfo_history() isn't called. You did include the change in
      ex_cmds.c, right?

      --
      hundred-and-one symptoms of being an internet addict:
      178. You look for an icon to double-click to open your bedroom window.

      /// 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.
    • Ron Aaron
      ... I verified manually that the patch contents of 7.3.903 were applied; but there s not changes to ex_cmds.c that I can find. The write_viminfo_history()
      Message 2 of 7 , Apr 15, 2013
        >
        > Perhaps a stack trace will help. Or setting a breakpoint at
        >
        > write_viminfo_history() and stepping through it. And check that
        >
        > finish_viminfo_history() isn't called. You did include the change in
        >
        > ex_cmds.c, right?

        I verified manually that the patch contents of 7.3.903 were applied; but there's not changes to ex_cmds.c that I can find.

        The 'write_viminfo_history()' happens twice and in the second iteration this happens:

        6230 && !(round == 2 && i >= viminfo_hisidx[type]))
        (gdb)
        6232 p = round == 1 ? history[type][i].hisstr
        (gdb)
        6233 : viminfo_history[type][i];
        (gdb)
        6234 if (p != NULL && (round == 2 || !history[type][i].viminfo))
        (gdb)
        6251 if (--i < 0)
        (gdb)
        6253 if (i == hisidx[type])
        (gdb) c
        Continuing.

        Program received signal SIGSEGV, Segmentation fault.
        0x080bdcfe in write_viminfo_history (fp=fp@entry=0x83ec2c0) at ex_getln.c:6233
        6233 : viminfo_history[type][i];
        (gdb) l
        6228 if (i >= 0)
        6229 while (num_saved > 0
        6230 && !(round == 2 && i >= viminfo_hisidx[type]))
        6231 {
        6232 p = round == 1 ? history[type][i].hisstr
        6233 : viminfo_history[type][i];
        6234 if (p != NULL && (round == 2 || !history[type][i].viminfo))
        6235 {
        6236 --num_saved;
        6237 fputc(hist_type2char(type, TRUE), fp);
        (gdb) p num_saved
        $11 = 199
        (gdb) p i
        $12 = 0
        (gdb) p viminfo_history
        $13 = {0x0, 0x0, 0x0, 0x0, 0x0}
        (gdb) p viminfo_hisidx
        $14 = {199, 200, 4, 55, 0}

        --
        --
        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
        ... It was in an earlier patch, 7.3.892. ... Hmm, it s only be prepared to called once after prepare_viminfo_history(). Can you find out where the two calls
        Message 3 of 7 , Apr 15, 2013
          Ron Aaron wrote:

          > > Perhaps a stack trace will help. Or setting a breakpoint at
          > >
          > > write_viminfo_history() and stepping through it. And check that
          > >
          > > finish_viminfo_history() isn't called. You did include the change in
          > >
          > > ex_cmds.c, right?
          >
          > I verified manually that the patch contents of 7.3.903 were applied;
          > but there's not changes to ex_cmds.c that I can find.

          It was in an earlier patch, 7.3.892.

          > The 'write_viminfo_history()' happens twice and in the second
          > iteration this happens:

          Hmm, it's only be prepared to called once after
          prepare_viminfo_history(). Can you find out where the two calls are
          coming from?

          > 6230 && !(round == 2 && i >= viminfo_hisidx[type]))
          > (gdb)
          > 6232 p = round == 1 ? history[type][i].hisstr
          > (gdb)
          > 6233 : viminfo_history[type][i];
          > (gdb)
          > 6234 if (p != NULL && (round == 2 || !history[type][i].viminfo))
          > (gdb)
          > 6251 if (--i < 0)
          > (gdb)
          > 6253 if (i == hisidx[type])
          > (gdb) c
          > Continuing.
          >
          > Program received signal SIGSEGV, Segmentation fault.
          > 0x080bdcfe in write_viminfo_history (fp=fp@entry=0x83ec2c0) at ex_getln.c:6233
          > 6233 : viminfo_history[type][i];
          > (gdb) l
          > 6228 if (i >= 0)
          > 6229 while (num_saved > 0
          > 6230 && !(round == 2 && i >= viminfo_hisidx[type]))
          > 6231 {
          > 6232 p = round == 1 ? history[type][i].hisstr
          > 6233 : viminfo_history[type][i];
          > 6234 if (p != NULL && (round == 2 || !history[type][i].viminfo))
          > 6235 {
          > 6236 --num_saved;
          > 6237 fputc(hist_type2char(type, TRUE), fp);
          > (gdb) p num_saved
          > $11 = 199
          > (gdb) p i
          > $12 = 0
          > (gdb) p viminfo_history
          > $13 = {0x0, 0x0, 0x0, 0x0, 0x0}
          > (gdb) p viminfo_hisidx
          > $14 = {199, 200, 4, 55, 0}

          I can clear viminfo_hisidx to avoid this. I would still like to find
          out why this is needed.

          --
          hundred-and-one symptoms of being an internet addict:
          179. You wonder why your household garbage can doesn't have an
          "empty recycle bin" button.

          /// 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.
        Your message has been successfully submitted and would be delivered to recipients shortly.