[Ecls-list] MinGW-built ecl exits with SIGSEGV when run in MinGW shell or emacs cmdproxy.exe

T. Kurt Bond tkb at tkb.mpl.com
Thu Mar 10 18:21:37 UTC 2005


It's easiest to see this happen by running ecl in a MinGW shell and
entering an undefined symbol and a RETURN at the REPL: ecl exits
immediately instead of entering a debug REPL.  

Getting this to happen under gdb is more difficult, since gdb normally
starts up another Windows console window to run ecl.  Once you do get
it to happen under gdb, you see that a call to PeekNamedPipe() in
flisten() in src/c/file.d is failing.  (The flisten() is called from
#'default-debugger in src/lsp/top.lsp, which checks to see if any io
is pending on *debug-io* using #'listen, and if so clears it.) Since
the PeekNamedPipe() fails, it causing FEwin32_error() to be called,
which eventually causes #'listen to be called, which calls flisten(),
and the PeekNamedPipe() call fails again, and we have an infinite loop
which eventually terminates with a SIGSEGV after we run out of stack
space.

It turns out that a call to PeekNamedPipe() in file.d is interpreting
a zero return as success, when actually success is any non-zero return
value, according to MSDN and a zero result is a failure.

Here's a patch:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: peek-pipe.patch
Type: application/octet-stream
Size: 412 bytes
Desc: fix PeekNamedPipe() call in file.d to interpret non-zero as a success.
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20050310/00d78472/attachment.obj>
-------------- next part --------------

-- 
T. Kurt Bond, tkb at tkb.mpl.com


More information about the ecl-devel mailing list