[GHC] #13987: T13701 fails sporadically

GHC ghc-devs at haskell.org
Thu Jul 20 16:04:52 UTC 2017


#13987: T13701 fails sporadically
-------------------------------------+-------------------------------------
        Reporter:  duog              |                Owner:  duog
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Test Suite        |              Version:  8.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Other             |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3748
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"194384f1318e0553e0c5ce621ca0903b55862eb3/ghc"
 194384f1/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="194384f1318e0553e0c5ce621ca0903b55862eb3"
 Fix busy-wait in SysTools.builderMainLoop

 Test T13701 was failing sporadically. The problem manifested while the
 test was run on a system under load. Profiling showed the increased
 allocations were in SysTools.builderMainLoop.loop, during calls to the
 assembler. This was due to loop effectively busy-waiting from when both
 stdin and stderr handles were closed, until getProcessExitCode
 succeeded.

 This is fixed by removing exit code handling from loop. We now wait for
 loop to finish, then read the exit code with waitForProcess.

 Some exception safety is added: the readerProc threads will now be
 killed and the handles will be closed if an exception is thrown.

 A TODO saying that threads dying is not accounted for is removed. I
 believe that this case is handled by readerProc sending EOF in a finally
 clause.

 Test Plan:
 Replicate test failures using procedure on the ticket, verify that they
 do not occur with this patch.

 Reviewers: austin, bgamari

 Reviewed By: bgamari

 Subscribers: rwbarton, thomie

 GHC Trac Issues: #13987

 Differential Revision: https://phabricator.haskell.org/D3748
 }}}

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


More information about the ghc-tickets mailing list