[GHC] #11830: Disabling idle GC leads to freeze
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime | Version: 8.0.1-rc3 System | Keywords: | Operating System: Linux Architecture: | Type of failure: Incorrect result Unknown/Multiple | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I'm currently getting a runtime freeze with a spinning CPU with the latest GHC 8.0.1 RC (8.0.0.20160411). Testing 2 months ago on whatever was the latest release candidate showed no problems. The reproduction steps are a bit long winded: * All tested on Ubuntu Linux. * Checkout Shake, https://github.com/ndmitchell/shake.git (currently at 75505baa5fc5d1b99a1162edae6ecf7669f00ed9). * {{{cabal install}}} * Checkout Ninja, https://github.com/ninja-build/ninja.git (currently at 78f548880e549c701bd77760e4b3f3a4ee147641). * Change to the {{{ninja}}} directory. * Run {{{./configure.py --bootstrap}}} * Run {{{cp ninja nin}}} * Run {{{./nin -t clean}}} * Run {{{shake}}} Observe that Shake fails to complete and starts spinning on 1 CPU. If you modify {{{shake.cabal}}} to remove {{{-with-rtsopts=-I0 -qg -qb}}} then it works again and completes in < 1 min. Adding back flags with {{{+RTS -I0 -RTS}}} shows that {{{-I0}}} alone is the culprit. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by NeilMitchell): * cc: ndmitchell@… (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by NeilMitchell): Setting {{{-I1000}}}, when the computation takes < 20s, still succeeds. That seems to imply that the idle setting of 0 is the problem. Adding {{{-S}}} has the last line not being a GC. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by NeilMitchell): Using GHC HEAD (but not the latest release candidate) I also get a freeze when doing {{{shake --demo --keep-going}}}). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by kolmodin): * Attachment "check_test_case.sh" added. git bisect automation -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by kolmodin): git bisect from ghc-8.0.1-rc2 to latest commit in the ghc-8.0 branch suggests a few commits; - 15acd4227106ed912c8d6ebc476263f70cd4510c - 6e524ebaf299043990048356b01c045f2d6dc0d5 - 8e8b6df2e56389a1ed13d4198b1d2f3347706aaa - bbdc52f3a6e6a28e209fb8f65699121d4ef3a4e3 of which only bbdc52f3a6e6a28e209fb8f65699121d4ef3a4e3 looks likely. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by kolmodin): * cc: kolmodin (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Runtime System | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * priority: normal => highest * milestone: => 8.0.1 Comment: Release blocker -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: patch Priority: highest | Milestone: 8.0.1 Component: Runtime System | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2129 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D2129 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: patch Priority: highest | Milestone: 8.2.1 Component: Runtime System | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2129 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.0.1 => 8.2.1 Comment: The patch in question has been reverted on `ghc-8.0` (see #10840). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: patch Priority: highest | Milestone: 8.2.1 Component: Runtime System | Version: 8.0.1-rc3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2129 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"16a51a6c2f265f8670355be03d42b773d93e0684/ghc" 16a51a6c/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="16a51a6c2f265f8670355be03d42b773d93e0684" rts: Close livelock window due to rapid ticker enable/disable This fixes #11830, where the RTS would livelock if run with `-I0` due to a regression introduced by bbdc52f3a6e6a28e209fb8f65699121d4ef3a4e3. The reason for this is that the new codepath introduced a subtle race condition: 1. one thread could request that the ticker stop and would block until the ticker in fact stopped 2. meanwhile, another thread could sneak in and restart the ticker this was implemented in such a way where thread (1) would end up blocked forever. The solution here is to simply not block. The worst that will happen is that timer fires again, but is ignored since the ticker is stopped. Test Plan: Validate, try reproduction case in #11830. Need to find a nice testcase. Reviewers: simonmar, erikd, hsyl20, austin Reviewed By: erikd, hsyl20 Subscribers: erikd, thomie Differential Revision: https://phabricator.haskell.org/D2129 GHC Trac Issues: #11830 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11830: Disabling idle GC leads to freeze -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: closed Priority: highest | Milestone: 8.2.1 Component: Runtime System | Version: 8.0.1-rc3 Resolution: fixed | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2129 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: The commit in comment:9 isn't quite the whole story due to lacking synchronization. This is cleaned up in the rework of the itimer subsystem in 999c464da36e925bd4ffea34c94d3a7b3ab0135c (which also addresses #11965). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11830#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC