Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demonstrate one aspect of issue haskell#187
Due to the nature of directory-based locking, if the process exits before exception handlers are run, the directory is never removed and the system remains in a "locked" state indefinitely. This can happen due to SIGKILL or power failure, as well as a blocked thread when main exits. This repro follows that last approach, forking a thread and then letting main exit while that locked thread delays. On my machine, I get the following output for running issue-187.sh: $ ./issue-187.sh + rm -rf tmp + ghc --version The Glorious Glasgow Haskell Compilation System, version 8.2.2 + cabal --version cabal-install version 2.0.0.1 compiled using version 2.0.1.1 of the Cabal library + cabal sandbox init Writing a default package environment file to /Users/michael/Documents/hackage-security/cabal.sandbox.config Using an existing sandbox located at /Users/michael/Documents/hackage-security/.cabal-sandbox + cabal install ./hackage-security Resolving dependencies... In order, the following will be installed: hackage-security-0.5.2.2 (reinstall) Warning: Note that reinstalls are always dangerous. Continuing anyway... Notice: installing into a sandbox located at /Users/michael/Documents/hackage-security/.cabal-sandbox Configuring hackage-security-0.5.2.2... Building hackage-security-0.5.2.2... Installed hackage-security-0.5.2.2 + cabal exec -- ghc -hide-all-packages -package hackage-security -package base -package directory -Wall -Werror issue-187.hs [1 of 1] Compiling Main ( issue-187.hs, issue-187.o ) Linking issue-187 ... + ./issue-187 + ./issue-187 issue-187: /Users/michael/Documents/hackage-security/tmp/hackage-security-lock: createDirectory: already exists (File exists)
- Loading branch information