bug in System.system on ghc-6.2.1
Simon Marlow
simonmar at microsoft.com
Tue Jul 20 09:39:56 EDT 2004
On 20 July 2004 14:26, Malcolm Wallace wrote:
> There doesn't seem to be much significant difference. Here are the
> relevant
> chunks of strace output, first for the working 6.2.1 on glibc-2.3:
>
> vfork() = 3552
> wait4(3552, The Glorious Glasgow Haskell Compilation System,
> version 6.2.1 [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) =
> 3552 --- SIGCHLD (Child exited) ---
> ioctl(1, SNDCTL_TMR_TIMEBASE, 0xbfffd6f0) = -1 EINVAL (Invalid
> argument) times({tms_utime=0, tms_stime=0, tms_cutime=1,
> tms_cstime=0}) = 9887108 write(1, "ExitSuccess\n", 12)
> = 12
>
> and for the non-working 6.2.1 on glibc-2.2:
>
> vfork() = 10120
> --- SIGCHLD (Child exited) ---
> wait4(10120, [WIFEXITED(s) && WEXITSTATUS(s) == 127], 0, NULL) =
> 10120 ioctl(1, 0x5401, {B38400 opost isig icanon echo ...}) = 0
> write(1, "ExitFailure 127\n", 16) = 16
The only bit of conditional compilation in the system implementation is
the use of vfork(), but it seems to be using vfork() in both cases. Oh,
and there's some setitimer stuff too, but I imagine that's the same for
both builds.
Very strange. We do have a RH7 system here, so I'll have to get that
distribution and see if I can reproduce.
> The exit status of 127 indicates that the command ("ghc") could not
> be found. Considering the possibility of a bash configuration problem
> on RH7.2, I tried compiling essentially the same code in C:
>
> main () {
> int v = system("ghc --version 2>&1");
> printf("Exit %d\n",v);
> }
We aren't using system(), our implementation does the fork()/execl()
combination instead.
Cheers,
Simon
More information about the Glasgow-haskell-bugs
mailing list