Re: [GHC] #13615: Nondeterminism in ‘pure’ function w/ parallel evaluation & memo combinators

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


#13615: Nondeterminism in ‘pure’ function w/ parallel evaluation & memo combinators
-------------------------------------+-------------------------------------
        Reporter:  pacak             |                Owner:  bgamari
            Type:  bug               |               Status:  closed
        Priority:  highest           |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  7.10.3
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3695
       Wiki Page:                    |
-------------------------------------+-------------------------------------

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

 In [changeset:"bade356f79d44c9f6e8918a89d9ffac7f5608dbf/ghc" bade356/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="bade356f79d44c9f6e8918a89d9ffac7f5608dbf"
 rts: Claim AP_STACK before adjusting Sp

 In the fix to #13615 we introduced some logic to atomically blackhole
 AP_STACKs closures upon entry. However, this logic was placed *after* a
 stack pointer adjustment. This meant that if someone else beat us to
 blackholing the AP_STACK we would suspend the thread with uninitialized
 content on the stack.  This would then later blow up when threadPaused
 attempted to walk the stack, hence #13970.

 Silly bug but still cost lots of head-scratching to find.

 Thanks to albertov for the great repro.

 Fixes #13970. Bug originally introduced by the fix to #13615.

 Reviewers: austin, erikd, simonmar

 Reviewed By: erikd, simonmar

 Subscribers: rwbarton, thomie

 GHC Trac Issues: #13970, #13615

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

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


More information about the ghc-tickets mailing list