Ticket #843 (closed defect: fixed)

Opened 2 years ago

Last modified 18 months ago

'cabal test' crashes on Windows

Reported by: ttuegel Owned by: ttuegel
Priority: normal Milestone:
Component: Cabal library Version: 1.10.1.0
Severity: normal Keywords:
Cc: Difficulty: unknown
GHC Version: Platform: Windows

Description

Cabal crashes with the following error on Windows Vista and 7 (I have not tried XP):

Running 1 test suites...
Test suite tests: RUNNING...
Test suite tests: PASS
Test suite logged to: dist\test\foo-0.1-tests.log
cabal: permission denied

The "permission denied" error appears to be from an attempt to delete a temporary file while it is still open. This does not appear to cause problems on Unix, but Windows won't allow it. I believe it is due to the fact that the temporary log file is read lazily, so it doesn't get closed before the file is deleted.

Attachments

cabal-1.10-test-fix-windows-crash.dpatch Download (3.0 KB) - added by ttuegel 2 years ago.
Patch for Cabal-1.10 branch
cabal-test-fix-windows-crash.dpatch Download (40.6 KB) - added by ttuegel 2 years ago.
Patch for Cabal HEAD

Change History

Changed 2 years ago by ttuegel

Patch for Cabal-1.10 branch

Changed 2 years ago by ttuegel

Patch for Cabal HEAD

Changed 2 years ago by duncan

  • status changed from new to closed
  • resolution set to fixed

Applied.

Wed May 18 04:04:22 BST 2011  Thomas Tuegel <ttuegel@gmail.com>
  * Fixed crash on Windows due to file handle leak.
  Ticket #843. Cabal test crashed when trying to delete a temporary log file
  because 'readFile' reads unnecessarily lazily and was keeping a file handle
  open during attempted deletion. This patch forces the entire file to be read
  so the handle will be closed.

Changed 18 months ago by elga

Note: See TracTickets for help on using tickets.