[GHC] #11826: unsafe causes bug, news @ 11

#11826: unsafe causes bug, news @ 11 -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I know there has been plenty of levity here lately but here goes :) I didn't expect ‘isUndefined’ to be safe but this may be interesting to the devs (I am obedient and report it thusly and hereby-ly per GHC's request) {{{#!haskell % ghci -ignore-dot-ghci GHCi, version 8.1.20160117: http://www.haskell.org/ghc/ :? for help Prelude> import Control.Exception Prelude Control.Exception> import System.IO.Unsafe Prelude Control.Exception System.IO.Unsafe> import Unsafe.Coerce Prelude Control.Exception System.IO.Unsafe Unsafe.Coerce> isUndefined x = unsafePerformIO $ catch ((unsafeCoerce x :: IO ()) >> return False) (const $ return True :: SomeException -> IO Bool) Prelude Control.Exception System.IO.Unsafe Unsafe.Coerce> isUndefined (succ True) True Prelude Control.Exception System.IO.Unsafe Unsafe.Coerce> isUndefined (succ False) <interactive>: internal error: stg_ap_v_ret (GHC version 8.1.20160117 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Aborted (core dumped) % }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11826 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11826: unsafe causes bug, news @ 11 -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Well, `unsafeCoerce` can certainly cause seg-faults. Is there more to it than that? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11826#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11826: unsafe causes bug, news @ 11 -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => invalid Comment: Indeed, I'm going to chalk this up as not-a-bug unless there's compelling reason to believe otherwise. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11826#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC