
#13832: No parameter-validation in Control.Concurrent.setNumCapabilities -------------------------------------+------------------------------------- Reporter: AlistairWard | Owner: (none) Type: bug | Status: merge Priority: low | Milestone: 8.2.1 Component: Core Libraries | Version: 8.0.1 Resolution: | Keywords: | setNumCapabilities Operating System: Linux | Architecture: x86 Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by bgamari: @@ -0,0 +1,1 @@ + {{{ @@ -9,0 +10,1 @@ + }}} New description: {{{
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#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler