
#13832: No parameter-validation in Control.Concurrent.setNumCapabilities -------------------------------------+------------------------------------- Reporter: AlistairWard | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Core | Version: 8.0.1 Libraries | Keywords: | Operating System: Linux setNumCapabilities | Architecture: x86 | Type of failure: Runtime crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+-------------------------------------
ghci GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> Control.Concurrent.setNumCapabilities $ negate 1 malloc: failed on request for 18446744073709551104 bytes; message: moreCapabilities
The parameter is forwarded to the underlying C-function without validation, the runtime then crashes; no exception is thrown. This behaviour also exists in ghc 8.0.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13832 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler