[slim-vim] More details on the socket crash bug

Brad Beveridge brad.beveridge at gmail.com
Tue Jun 13 10:19:10 CDT 2006


On 13/06/06, Larry Clapp <larry at theclapp.org> wrote:
> On Mon, Jun 12, 2006 at 08:40:43AM -0700, Brad Beveridge wrote:
> > On 6/12/06, Larry Clapp <larry at theclapp.org> wrote:
> > > Okay, I tried your code, and I observed the following behavior:
> > >
> > > In test.lisp,
> > >
<SNIP>
> > > (or up to 0, or 3, or 7, but rarely if ever the whole 10 lines) in
> > > the test.lisp lisp scratch buffer, until I pressed at least two
> > > keys.  I'd press one key (e.g. "h"), and the rest of the lines
> > > would show up.  I'd press it again, and the cursor would show back
> > > up in the test.lisp buffer.  Funky.
> > Did you see the "oh my god the world has crashed" bug?
>
> No.
Oh.  You really want to see that one :)

>
> > I needed to up the amount of data to about 1000 format calls.  I
> > also noticed the keypress thing, it is like Vim is blocking
> > elsewhere?  The keypress might be important.  What I suspect may be
> > happening (though I don't know how) is that the ECL interpreter is
> > being re-entered, and it is not at all happy about it.
>
> I would instead suspect something's up with the network code.
>
> On the other hand, I'm not sure what you mean by "the ECL interpreter
> is being re-entered", and since I don't really understand your
> assertion, I can't really say "I disagree", can I?  :)

Well, what I thought was that si_safe_eval was getting called from
Vim, and then while some ECL code was running, si_safe_eval would get
called again.  I thought that this would screw with any global data
internal to the ECL interpreter.  But I've turned the event loop over
in my head and can't see how this can happen.  Also I added simple
mutex like code to si_safe_eval with a break point if it was called
twice and I didn't see it hit.  So I have to suspect you are right in
blaming the network code.  But why does it run well for the easy
cases?  I would expect it to break in the case where the server
doesn't echo back.

>
> We have (at least) Vim (main loop; polls network) calling ECL (network
> callback) calling Vim (append text to buffer); do you mean you're
> concerned that maybe the append text calls more ECL code?  I haven't
> checked, but that's certainly possible.  I wouldn't expect it to cause
> problems, but maybe I'm wrong.  :)
>
<SNIP>
> >
> > #5a - I've come to believe that vim-buffer-output-stream isn't
> > responsible for this particular bug.
>
> Okay.
>
> > > I may do some work on this, or I may adapt some of my own Vim
> > > networking code to work with sb-bsd-sockets, and try that.
> > Would you mind testing your networking code in my harness?  I'm
> > expecting similar results, but you never know :)
>
> I would not mind.  I haven't done so yet.  I live near Tampa, FL;
> Tropical Storm Alberto has a lot of my attention.  :)

That's no excuse!  :)  Seriously though, that's a pretty good thing to
give attention to.

Brad


More information about the slim-vim mailing list