Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,323
    • Issues 4,323
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 372
    • Merge Requests 372
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4480

Closed
Open
Opened Nov 06, 2010 by erikd@trac-erikd

System.Directory.canonicalizePath gives bad result

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.

Edited Mar 09, 2019 by Ian Lynagh <igloo@earth.li>
Assignee
Assign to
7.4.1
Milestone
7.4.1
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#4480