29 Apr 2013 16:10
Reinitializer failing to run
Will Noble <will <at> cow9.org>
2013-04-29 14:10:14 GMT
2013-04-29 14:10:14 GMT
Hi all,
I'm having a problem with reinitializers. The macro DEFINE-REINITIALIZER
defines a record variable, which might or might not be reachable from a
resumer function. When it is not, the reinitialization routine doesn't make
it into the saved heap image.
Take this example:
> ,open posix
> (define (date)
(cond ((fork) => wait-for-child-process)
(else (exec "date"))))
; no values returned
> ,dump good.image
Writing good.image
> ,build (lambda (args) (date) 0) bad.image
Writing bad.image
Resuming good.image and calling DATE works as expected, but running the VM
with bad.image hangs it because the reinitializer from the posix-process
module that installs signal handlers doesn't run, causing the system to
ignore SIGCHLD signals.
Using ADD-INITIALIZTION-THUNK! instead of a reinitializer doesn't work
because when the thunk runs posix.so would not yet have been loaded back in.
It seems to me that we should be able to expect reinitializers to run. I'm
not sure what the best solution here is. We could use a separate
second-stage initialization thunk list to implement reinitializers, instead
of the current method (relying on record resumers). Or maybe there is a
(Continue reading)
RSS Feed