[GHC] #13832: No parameter-validation in Control.Concurrent.setNumCapabilities

#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

#13832: No parameter-validation in Control.Concurrent.setNumCapabilities
-------------------------------------+-------------------------------------
Reporter: AlistairWard | Owner: (none)
Type: bug | Status: new
Priority: low | Milestone:
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: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#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: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => merge * milestone: => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13832#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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

#13832: No parameter-validation in Control.Concurrent.setNumCapabilities -------------------------------------+------------------------------------- Reporter: AlistairWard | Owner: (none) Type: bug | Status: closed Priority: low | Milestone: 8.2.1 Component: Core Libraries | Version: 8.0.1 Resolution: fixed | Keywords: | setNumCapabilities Operating System: Linux | Architecture: x86 Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.2` as a4e782087ae0df211f8d48c11ded0b1dd81f40a4. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13832#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13832: No parameter-validation in Control.Concurrent.setNumCapabilities
-------------------------------------+-------------------------------------
Reporter: AlistairWard | Owner: (none)
Type: bug | Status: closed
Priority: low | Milestone: 8.2.1
Component: Core Libraries | Version: 8.0.1
Resolution: fixed | Keywords:
| setNumCapabilities
Operating System: Linux | Architecture: x86
Type of failure: Runtime crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari
participants (1)
-
GHC