[GHC] #15715: problematic openFile with named pipes

#15715: problematic openFile with named pipes -------------------------------------+------------------------------------- Reporter: adp | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: | Version: 8.4.3 libraries/base | Keywords: | Operating System: Linux Architecture: x86_64 | Type of failure: Incorrect result (amd64) | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- - while `openFile`'ng named pipes for `ReadMode` works fine, on `WriteMode` or `AppendMode` it throws `openFile: does not exist (No such device or address)`; and on `WriteReadMode`, it opens it, but seem not able to write to it (the process hearing on the other side didn't hear anything). - `writeFile` and `appendFile` works though. - using stack `resolver: lts-12.4`, on ubuntu 16.04 LTS -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15715 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15715: problematic openFile with named pipes -------------------------------------+------------------------------------- Reporter: adp | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: libraries/base | Version: 8.4.3 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => invalid Comment: This is due to the FIFO semantics. To quote `fifo(7)`:
A process can open a FIFO in nonblocking mode. In this case, opening for read-only succeeds even if no one has opened on the write side yet and opening for write-only fails with `ENXIO` (no such device or address)
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15715#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15715: problematic openFile with named pipes -------------------------------------+------------------------------------- Reporter: adp | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: libraries/base | Version: 8.4.3 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by adp): Thanks for the answer, very helpful! Given in the future some people might have the same problem I had, shouldn't the docs be updated? Currently it says:
This operation may fail with:
- `isAlreadyInUseError` if the file is already open and cannot be reopened; - `isDoesNotExistError` if the file does not exist; or - `isPermissionError` if the user does not have permission to open the file.
Not mentioning that one could get `isDoesNotExistError` by other reason than the file not existing, like in this case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15715#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15715: problematic openFile with named pipes -------------------------------------+------------------------------------- Reporter: adp | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.4.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect API | (amd64) annotation | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by adp): * status: closed => new * failure: Incorrect result at runtime => Incorrect API annotation * resolution: invalid => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15715#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15715: problematic openFile with named pipes -------------------------------------+------------------------------------- Reporter: adp | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 8.4.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect API | (amd64) annotation | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5295 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D5295 Comment: Yes, this is a fair point. Thanks for raising it. I've opened Phab:D5295 adding a mention to the documentation. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15715#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15715: problematic openFile with named pipes
-------------------------------------+-------------------------------------
Reporter: adp | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: libraries/base | Version: 8.4.3
Resolution: | Keywords:
Operating System: Linux | Architecture: x86_64
Type of failure: Incorrect API | (amd64)
annotation | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5295
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#15715: problematic openFile with named pipes -------------------------------------+------------------------------------- Reporter: adp | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.3 Component: libraries/base | Version: 8.4.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect API | (amd64) annotation | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5295 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => merge * milestone: => 8.6.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15715#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15715: problematic openFile with named pipes -------------------------------------+------------------------------------- Reporter: adp | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.3 Component: libraries/base | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect API | (amd64) annotation | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5295 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged with 64a5044543bdcd7983787b215a44bdfb70c9c40b. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15715#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC