RE: virtual timers and System.system

2000-03-17 Thread Simon Marlow
On FreeBSD using ghc 4.04, long running commands executed with System.system are being interrupted by virtual alarms leading to errors such as: o Fail: interrupted Action: system Reason: system command interrupted rm -f xxx yyy o Virtual timer expired o gcc: Internal

Re: virtual timers and System.system

2000-03-17 Thread Hannah Schroeter
Hello! On Fri, Mar 17, 2000 at 01:42:14AM -0800, Simon Marlow wrote: [...] After looking at ghc 4.02's libraries for a while (it's all I had around), it looks as though ghc-4.02/ghc/lib/std/cbits/system.c should mask the SIGVTALRM signal after executing fork and before executing exec*.

Re: virtual timers and System.system

2000-03-17 Thread Hannah Schroeter
Hello! On Fri, Mar 17, 2000 at 01:46:03AM -0800, Simon Marlow wrote: I don't get it - execve() and friends are supposed to reset all the signal handlers back to the default state, aren't they? And I can't seem to construct an example to demonstrate the problem. Ah, I get it finally

RE: virtual timers and System.system

2000-03-17 Thread Simon Marlow
The correct handling would be: - block SIGALRM/SIGVTALRM/SIGPROF - *then* fork() (else you have a race condition where the child could receive *and handle* the signal) This race condition is harmless, I think. The VTALRM handler just increments a counter, and we're about to blow away this