#4480: System.Directory.canonicalizePath gives bad result
---------------------------------+------------------------------------------
Reporter: erikd | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.12.3 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Incorrect result at runtime
---------------------------------+------------------------------------------
Running ghci on linux with an empty path gives different wrong results
each time:
Prelude> System.Directory.canonicalizePath []
"\153\229\228]\170\DEL"
Prelude> System.Directory.canonicalizePath []
"\160\147\155\\\170\DEL"
Prelude> System.Directory.canonicalizePath []
"\136"
As pointed out by geheimdienst on #haskell:
my speculation is this: canonicalizePath calls realpath, which
for "" gives an EINVAL with the result string being undefined.
haskell forgets to check errno and takes the undefined string
This bug exists on 6.12.1 on Debian and 6.12.3 on FreeBSD.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4480>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs