forkProcess breaks in multiple ways with GHC 7.6
|Reported by:||nh2||Owned by:||simonmar|
|Keywords:||Cc:||edsko, simonmar, mail@…, snoyberg, ppud|
|Type of failure:||Runtime crash||Test Case:|
|Related Tickets:||#9468||Differential Rev(s):|
Description (last modified by nh2)
When I run this program using forkProcess
in GHC 7.6.3 on Ubuntu 12.04 and 14.04 I get at 4 different issues. Three of them (1-3) crash the program, and happen only on some startups, the fourth one is the part for which I originally wrote this test case.
- A segfault shortly after startup (probably in the GC)
- internal error: resurrectThreads: thread blocked in a strange way: 10 at startup
- A glibc corrupted double-linked list shortly after startup
- The running, killing by SIGTERM case inside my program
Now come the details for each of them:
- I managed to get a gdb trace of it (https://gist.github.com/nh2/0c68650b78b692e5f827#file-error-ghc-7-69468-3-linux-segfault-gdb-txt) and also a trace with the -debug runtime (https://gist.github.com/nh2/0c68650b78b692e5f827#file-error-ghc-7-6-3-linux-debug-segfault-gdb-txt). They suggest that the segfault is in evacuate(), and the -debug one says it's in the LOOKS_LIKE_CLOSURE_PTR part.
- This is the same as my newly reported #9468 and I have no clue what that's about. Output: https://gist.github.com/nh2/0c68650b78b692e5f827#file-error-ghc-7-6-3-linux-threaded-resurrectthreads-txt
- This one happens very rarely; might be related to 1? Output: https://gist.github.com/nh2/0c68650b78b692e5f827#file-error-ghc-7-6-3-linux-glibc-txt
- The problem here is the Nothing case: The child process didn't answer from the pipe, and that although it is still running, so it really should have answered. It seems that for every 20th fork or so, the child process just hangs.
All files, error outputs and IRC logs are also collected in this gist: https://gist.github.com/nh2/0c68650b78b692e5f827
For getting issues (1-3), you have to run them multiple times in order to reproduce; if they appear, they will appear within the first second after startup. Which of the issue appears is dependent on how many _FORKS you set (with a high number like the default 80, you mostly get issue 2; set down to 8 to make the other ones more probably) and with how many +RTS -N threads you run.
2 and 4 are definitely present in 7.8.3 as well.
For 1 and 3, it would be great if you could tell me whether these are known issues and are known to be fixed in 7.8.