> Does anyone know what might be causing the following error from a
> program that uses System.system?
> 
>     Fail: interrupted
>     Action: system
>     Reason: Interrupted system call
> 
> The shell command given to System.system runs and terminates with a
> non-zero exit code (actually 8).  I expected to bind the exit result
> of the shell command and display it, but I did not expect the entire
> program to terminate instead.
> 
> Unfortunately, small examples do not seem to trigger the problem.
> The application in which I noticed the problem is 'hi', the Haskell
> pseudo-interpreter.  To demonstrate the behaviour, download and
> build hmake-3.06 (http://www.haskell.org/hmake) with any ghc from
> 4.08.2 to 5.04.1.  (I can't test 4.06 or earlier.)  There is no need
> to install anything: just type script/hi, then at the prompt enter
> any Haskell expression that throws a runtime error, such as 4`mod`0.
> The running "interpreter" is exited, whereas I expected the 
> interpreter
> to continue (and on some platforms it does!)
> 
> The fault is observed on Linux, but curiously not on Solaris, so maybe
> it is environment-related?

hi doesn't work for me, the error is attached at the end of this
message.  

I'm confused by the bug report, because our implementation of
System.system has extra code to disable the timer interrupts before
invoking the sub-process, so while Alastair's fix may have been required
at some time in the past, I don't think it should be any more.  Maybe
it's related to the choice of expression: 4 `mod` 0 will cause a
divide-by-zero crash (a SIGFPE) with current versions of GHC, but in
5.04.2 it will generate an exception as it should.  Do you get the same
behaviour just calling 'error'?

Cheers,
        Simon


~/tmp/hmake-3.06 > ./script/hi
__   __                 __
_____________________________________
||   ||  ______    ___  || _  ____     hmake interactive (hi):
||___|| || || ||  ___|| ||/  ||__||      Copyright (c) May 2000
||---|| || || || ||__|| ||\_ ||__
http://www.cs.york.ac.uk/fp/hmake/
||   ||                                Report bugs to:
[EMAIL PROTECTED]
||   || Version: 3.06 (2002-08-09)
-------------------------------------
                                           ... Using compiler ghc ...

Type :? for help
[Std   module...
/home/simonmar/fp/lib/i386-unknown-linux/ghc-5.04.1/imports/base/Prelude
.hi]
Prelude> 1 `mod` 0
[Compiling...
Fail: Can't find module PrelGHC in user directories
        .
        .
  Or in installed libraries/packages at
        /home/simonmar/fp/lib/i386-unknown-linux/ghc-5.04.1/imports/base
 
/home/simonmar/fp/lib/i386-unknown-linux/ghc-5.04.1/imports/haskell98
  Asked for by: /tmp/Main22523.hs
  Fix using the -I, -P, or -package flags.

Stop - hmake dependency error.
...failed]
Prelude> 
> 
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to