
#16147: ghc-pkg deadlocks on macOS -------------------------------------+------------------------------------- Reporter: rvl | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Runtime | Version: 8.6.3 System | Keywords: | Operating System: MacOS X Architecture: x86_64 | Type of failure: Incorrect result (amd64) | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If I run this script on macOS, after about 15 minutes, a `ghc-pkg` process will deadlock. {{{#!sh #!/usr/bin/env bash out=`pwd`/testing-package-db rm -rf $out cabal update cabal install random mkdir -p $out ghc-pkg init $out/package.conf.d while true; do ghc-pkg --package-db $HOME/.ghc/x86_64-darwin-8.6.3/package.conf.d dump | ghc-pkg --force --package-db $out/package.conf.d register - done }}} Output from `sw_vers`: {{{ ProductName: Mac OS X ProductVersion: 10.12.6 BuildVersion: 16G29 }}} This GHC build comes from the latest nixpkgs-18.09. I have also attached a nix file to build test scripts. We noticed that if we edited the ghc-pkg binary to link with the threaded RTS, then we could not reproduce the deadlock (after running the test script for 24 hours). Attached is the output from `/usr/bin/sample` for the stuck process, and the `otool -L ghc-pkg` output. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16147 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler