Closed okuoku closed 8 years ago
Tested at https://github.com/ashinn/chibi-scheme/tree/557b31e1dd1c8d99d1ddf6b71c7123eca2deb4dd
CYGWIN_NT-6.3 spring 2.3.1(0.291/5/3) 2015-11-14 12:44 x86_64 Cygwin
It seems lib/chibi/process.scm
does not check fork()
return value were a valid pid (a positive integer). Since POSIX APIs such as kill()
would accept -1
as wild-card, pid values should always be validated...
Hi, @ashinn thanks for patching but it won't solve the problem on Cygwin... You still have to defer deletion for any dlopen
ed files on Cygwin because Cygwin won't allow you to fork()
again if any dlopen
ed shared object absent.
This patch will make the test pass on Cygwin64(I haven't tested Cygwin32 yet): https://github.com/okuoku/chibi-scheme/commit/42b808dbc0e67b4e7683b74d0b2ef93a26331014
In tests/ffi/ffi-test.scm
,
system
procedure do fork
to generate basic.dlldlopen
basic.dllThen, it will try to fork
again to generate the next test item(integers) but it fails because basic.dll is absent so it cannot reproduce its parent's address space. This is why the message
0 [main] chibi-scheme 311940 child_info_fork::abort: unable to map C:\cygwin64\home\oku\repos2\chibi-scheme\tests\ffi\basic.dll, Win32 error 126
appeared in the failure log.
... yep, it's weird behaviour but this is one of few things Cygwin can't be a real POSIX..
Thanks, applied!
make test-all
won't pass on CygwinThis is because the test code deletes .dll file which is still mapped on the parent process here:
Unfortunately, on Cygwin,
fork()
require every loaded DLL files exist on the system since Win32 have no truefork()
on their subsystem and Cygwin will emulate it by creating brand new process..Hmm, I'm not sure whether or not switching to
posix_spawn()
orsystem()
would solve the problem.. Perhaps, just defer removinglib-file
s on test completion is enough here..