[darcs-users] push --and-apply
David Roundy
droundy at abridgegame.org
Wed Sep 17 12:18:42 UTC 2003
On Wed, Sep 17, 2003 at 12:25:02AM -0700, John Meacham wrote:
> On Wed, Sep 17, 2003 at 01:29:58AM +0300, Aggelos Economopoulos wrote:
> > After grepping a while in a ghc5 source tree, it seems neither is
> > true. The timer seems to be set for the program irrespective of the
> > fork/exec syscalls. The runtime appears to use it (the timer) for
> > profiling itself (which is one obvious usage of
> > setitimer()/getitimer()) - see ghc-5/ghc/rts/Itimer.c . Obviously the
> > signal handlers are thrown away during the exec, so the new process
> > gets an unexpected SIGVTALRM and dies.
> >
> > Unless I'm missing something, we are talking about a ghc bug. ghc has a
> > pPrPr_disableITimers function which it calls e.g. in executeFile, but
> > some paths leading to execve(2) are probably left unprotected. Copying
> > pPrPr_disableITimers from ghc (which does no error checking and
> > unnecessarily clears .it_interval) and calling it from read_ssh should
> > work (if I'm right).
> >
> > Does this sound logical?
>
> Yeah, this is a known 'feature' of ghc. you need to turn off the VTALARM
> before execing another program. see the 'system()' implementation in the
> standard haskell libraries for an example of how to do so..
Thanks for the help! :) A patch to Exec.exec to disable the itimers
before calling execvp is on its way to the repository (just has the unit
testing to go through).
--
David Roundy
http://www.abridgegame.org
More information about the darcs-users
mailing list