#8209: Race condition in setNumCapabilities -------------------------------------+---------------------------------- Reporter: akio | Owner: simonmar Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Comment (by Simon Marlow <marlowsd@…>): In [changeset:aa779e092c4f4d6a6691f3a4fc4074e6359337f8/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="aa779e092c4f4d6a6691f3a4fc4074e6359337f8" Don't move Capabilities in setNumCapabilities (#8209) We have various problems with reallocating the array of Capabilities, due to threads in waitForReturnCapability that are already holding a pointer to a Capability. Rather than add more locking to make this safer, I decided it would be easier to ensure that we never move the Capabilities at all. The capabilities array is now an array of pointers to Capabaility. There are extra indirections, but it rarely matters - we don't often access Capabilities via the array, normally we already have a pointer to one. I ran the parallel benchmarks and didn't see any difference. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8209#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler