GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:41:16Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/92317.8 regression in Read instance of Data.Fixed.Pico2019-07-07T18:41:16Zleonbaum27.8 regression in Read instance of Data.Fixed.PicoIf I run the following with ghc-7.8.2, the runtime system eats up all of my memory and doesn't produce a result:
read "1" :: Data.Fixed.Pico
<details><summary>Trac metadata</summary>
| Trac field | Value |
| -----...If I run the following with ghc-7.8.2, the runtime system eats up all of my memory and doesn't produce a result:
read "1" :: Data.Fixed.Pico
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | ekmett, hvr |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"7.8 regression in Read instance of Data.Fixed.Pico","status":"New","operating_system":"","component":"libraries/base","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["ekmett","hvr"],"type":"Bug","description":"If I run the following with ghc-7.8.2, the runtime system eats up all of my memory and doesn't produce a result:\r\n\r\nread \"1\" :: Data.Fixed.Pico","type_of_failure":"OtherFailure","blocking":[]} -->7.8.3https://gitlab.haskell.org/ghc/ghc/-/issues/9168reading/writing blocking FDs over FD_SETSIZE is broken2019-07-07T18:41:33Zrwbartonreading/writing blocking FDs over FD_SETSIZE is brokenIn `GHC.IO.FD` when reading from or writing to a blocking FD we first check (using our C function `fdReady`) whether the underlying fd is ready for read/write, in an attempt to avoid blocking the current OS thread. On POSIX this check is...In `GHC.IO.FD` when reading from or writing to a blocking FD we first check (using our C function `fdReady`) whether the underlying fd is ready for read/write, in an attempt to avoid blocking the current OS thread. On POSIX this check is done using select, with no test for whether the fd exceeds `FD_SETSIZE`, causing a write out of bounds and various bad consequences.
Also, while `readRawBufferPtr` checks the error status of `fdReady`, `readRawBufferPtrNoBlock`, `writeRawBufferPtr`, `writeRawBufferPtrNoBlock` do not, making this issue harder to diagnose.
I suggest that `fdReady` use `poll(2)` where available. I can prepare a set of patches if needed.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | ekmett, hvr |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"reading/writing blocking FDs over FD_SETSIZE is broken","status":"New","operating_system":"","component":"libraries/base","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["ekmett","hvr"],"type":"Bug","description":"In `GHC.IO.FD` when reading from or writing to a blocking FD we first check (using our C function `fdReady`) whether the underlying fd is ready for read/write, in an attempt to avoid blocking the current OS thread. On POSIX this check is done using select, with no test for whether the fd exceeds `FD_SETSIZE`, causing a write out of bounds and various bad consequences.\r\n\r\nAlso, while `readRawBufferPtr` checks the error status of `fdReady`, `readRawBufferPtrNoBlock`, `writeRawBufferPtr`, `writeRawBufferPtrNoBlock` do not, making this issue harder to diagnose.\r\n\r\nI suggest that `fdReady` use `poll(2)` where available. I can prepare a set of patches if needed.","type_of_failure":"OtherFailure","blocking":[]} -->7.8.3