[GHC] #9470: forkProcess breaks in multiple ways with GHC 7.6

GHC ghc-devs at haskell.org
Tue Aug 19 12:32:36 UTC 2014


#9470: forkProcess breaks in multiple ways with GHC 7.6
-------------------------------------+-------------------------------------
       Reporter:  nh2                |                   Owner:  simonmar
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Runtime System     |                 Version:  7.8.3
       Keywords:                     |        Operating System:  Linux
   Architecture:  Unknown/Multiple   |         Type of failure:  Runtime
     Difficulty:  Unknown            |  crash
     Blocked By:                     |               Test Case:
Related Tickets:  9468               |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 When I run this program using `forkProcess`

 https://gist.github.com/nh2/0c68650b78b692e5f827#file-forkprocess-problem-
 hs

 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.

 1. A segfault shortly after startup (probably in the GC)
 2. {{{internal error: resurrectThreads: thread blocked in a strange way:
 10}}} at startup
 3. A glibc {{{corrupted double-linked list}}} shortly after startup
 4. The {{{running, killing by SIGTERM}}} case inside my program

 Now come the details for each of them:

 1. 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.
 2. This is the same as my newly reported #9468 and I have no clue what
 that's about.
 3. This one happens very rarely; might be related to 1?
 4. 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.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9470>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list