[slim-vim] More details on the socket crash bug
Jim Bailey
dgym.bailey at gmail.com
Sat Jun 17 09:33:29 CDT 2006
>
> Perhaps GC works all too well, and our callback function moves, but
> the C code has no notion of that. :(
>
> I've tried mutexes, too, but only in the Lisp code. I should try it
> in the C code.
The GC ECL uses is the Boehm GC, which (thankfully) doesn't move things
around. You do have to be careful of storing pointers to gc-allocated
memory in non gc-allocated memory, e.g. storing an ECL closure pointer
in malloc'd memory, such things arn't detected by the mark and sweep and
can lead to premature collection and horrible problems. This is why the
callbacks are stored in a CL hash-table as well to stop them from
disappearing. Of course I may have got this wrong and messed up really
really badly, maybe it is worth turning the gc off temporarily just to
see what happens.
I have noticed that there is a bug in writing to a vim-buf-stream, and
if this is triggered by an error (likely, as errors are printed out to
a vim-buf-stream if they came from code running from an async event)
then things will get dropped to an ECL prompt, which no one wants but
is what is being seen.
Maybe safe eval and error printing need toughening up a bit more.
Anyway, in if_ecl.c we defun:
(defun buffer-append-char (buffer char)
(let ((tail (buffer-line-count buffer)))
(if (char= char #\newline)
(replace-lines (list "")
:start (1+ tail)
:buffer buffer)
(replace-lines (list (format nil "~a~a"
(get-line tail buffer) char))
:start tail
:end (1+ tail)
:buffer buffer))))
which calls replace-lines without an :end, which then fails its type
check because it defaults to nil and is has to be a fixnum.... eek!
so replace-lines in if_ecl.lisp should have the following check for end:
(check-type end (or fixnum null))
sorry, that one is entirely my fault, and I can't even check in the fix
atm. (at an internet cafe again).
hopefully with that fixed there is one less reason for things to bomb
out to an ECL shell.
cheers,
jim
More information about the slim-vim
mailing list