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

44793Re: Patch 7.0.082

Expand Messages
  • Hari Krishna Dara
    Sep 5, 2006
      On Mon, 4 Sep 2006 at 9:50pm, Bram Moolenaar wrote:

      >
      > Hari Krishna Dara wrote:
      >
      > > > I wrote:
      > > >
      > > > > Patch 7.0.082
      > > > > Problem: Calling a function that waits for input may cause List and
      > > > > Dictionary arguments to be freed by the garbage collector.
      > > > > Solution: Keep a list of all arguments to internal functions.
      > > > > Files: src/eval.c
      > > >
      > > > I vaguely recall that some people were having unreproducible crashes
      > > > when using input() or inputlist(). This patch should solve that.
      > > >
      > > > What happened was that the garbage collector didn't see the arguments to
      > > > internal functions, thus would free List and Dict arguments that are
      > > > still in use. That leads to a double free later. The garbage collector
      > > > only does it's work when the user doesn't type for a little while, that
      > > > made it unpredictable when it would happen.
      > >
      > > Can this happen during the debug session also? Like, when you do >echo
      > > on lists? I am seeing that while debugging scripts that use Lists for
      > > sometime, Vim almost always crashes. Sometimes, I also start seeing
      > > internal errors related to List access (sorry, I didn't notedown the
      > > numbers) before it crashes.
      >
      > Yes, this could also happen in debug mode. If you don't type something
      > for 'updatetime' seconds the garbage collector is invoked.
      >
      > But the fix is only for when you pass a List or Dictionary to an
      > internal function. User functions were already OK.
      >
      > Hmm, now that I think of it you could get problems with a command like
      > this:
      >
      > :echo [1, 2, 3, ..., 2000]
      >
      > If you get the "more" prompt the garbage collector might delete the list
      > before it's completely echoed. I'll look into that.
      >

      This is probably what I was doing during the debugging. I will try to
      notice if an :echo on a list in a long running debug session is what is
      causing the crash.

      --
      Thanks,
      Hari

      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com
    • Show all 9 messages in this topic