It's probably out of file descriptors.  It's possible that it tries to open another one during the error handling. <br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 24, 2016 at 10:50 AM Lana Black <lanablack@amok.cc> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I have run into this RTS bug recently. In short, when executing multiple<br>
consequtive forks, after 500-600 or so the process is terminated by<br>
SIGSEGV. I know this kind of thing is totally artificial, but still.<br>
<br>
The problem I have is that I can't get any meaningful backtrace in gdb.<br>
For example, for threaded RTS I get this<br>
<br>
(gdb) bt<br>
#0  0x0000000000560d63 in<br>
base_GHCziEventziThread_ensureIOManagerIsRunning1_info ()<br>
Backtrace stopped: Cannot access memory at address 0x7fffff7fcea0<br>
<br>
For non-threaded RTS I get this<br>
<br>
(gdb) bt<br>
#0  0x00000000007138c9 in stg_makeStablePtrzh ()<br>
Backtrace stopped: Cannot access memory at address 0x7fffff7fc720<br>
<br>
Build command: ghc --make -O2 -g -fforce-recomp fork.hs<br>
Add threaded if needed.<br>
<br>
I was able to reproduce this bug with both GHC 7.10.3 and todays HEAD<br>
with the code below.<br>
<br>
>import System.Exit (exitSuccess)<br>
>import System.Posix.Process (forkProcess)<br>
><br>
>fork_ n | n > 0 = processPid =<< forkProcess (fork_ $! n - 1)<br>
>        | otherwise = putStrLn "I'm done!"<br>
><br>
>processPid pid | pid  > 0 = exitSuccess<br>
>               | pid  < 0 = putStrLn "OOOPS, forkProcess failed!"<br>
>               | otherwise = pure ()<br>
><br>
>main = fork_ 1000<br>
><br>
<br>
With best regards.<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>