[GHC] #14105: ApplicativeDo causes GHC panic on irrefutable list pattern match

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: ApplicativeDo | Operating System: Unknown/Multiple Architecture: x86_64 | Type of failure: None/Unknown (amd64) | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- So this just happened: {{{#!hs {-# language ApplicativeDo #-} module Main where main :: IO () main = do [_] <- pure [] pure () }}} Compiling (under Stack) with `stack exec -- ghc --make src/Main.hs` yields {{{ [1 of 1] Compiling Main ( src/Main.hs, src/Main.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.2.1 for x86_64-unknown-linux): isStrictPattern Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} This does not happen on GHC-8.0.2. It does not happen when `ApplicativeDo` is not activated. It also does not happen when the pattern match line is changed to {{{#!hs [] <- pure [] }}} For completeness, the compiler used by `stack` is that which comes with `nightly-2017-08-10`. I am on Linux x64 (Ubuntu). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: ApplicativeDo Operating System: Unknown/Multiple | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by alexbiehl): This is most likely due to a missing case for `ListPat` in `isStrictPattern`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: ApplicativeDo Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by BoteboTsebo): * failure: None/Unknown => Compile-time crash or panic -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match
-------------------------------------+-------------------------------------
Reporter: BoteboTsebo | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.1
Resolution: | Keywords: ApplicativeDo
Operating System: Unknown/Multiple | Architecture: x86_64
Type of failure: Compile-time | (amd64)
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: ApplicativeDo Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): So can we add a test case and close (Ben)? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: ApplicativeDo Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by lippling): I think this is not fixed completely. With 8.2.2 I get: {{{ [62 of 63] Compiling Handler.Arena ( Handler/Arena.hs, .stack- work/dist/x86_64-osx/Cabal-2.0.1.0/build/Handler/Arena.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.2.2 for x86_64-apple-darwin): isStrictPattern Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} Disabling ApplicativeDo helps. I don't know what triggers it, yet. If you need to know, I'll try to find a minimal example. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: ApplicativeDo Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Ugh. Yes a minimal test case would be super helpful. Thanks -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: ApplicativeDo Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by BoteboTsebo): @lipping I believe it is still broken in 8.2.2 since it hasn't been merged in, since it lacks a test case. I am not sure how test cases work in GHC, thus I don't have the confidence that I could create one myself. I'll look around for a few fixed bugs and see how their test cases were structured, and hopefully (very unlikely with my current knowledge) come up with a commit or two to complete this fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: ApplicativeDo Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by lippling): Ok, I found a minimal example: {{{ {-# LANGUAGE ApplicativeDo #-} x = do [_] <- undefined -- the list is the problem undefined }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: ApplicativeDo Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Works fine in HEAD. Perhaps the patch didn't get merged into 8.2? Ben? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.2.3 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: ApplicativeDo Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => merge * milestone: => 8.2.3 Comment: Indeed it looks like this sadly fell through the cracks. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14105: ApplicativeDo causes GHC panic on irrefutable list pattern match -------------------------------------+------------------------------------- Reporter: BoteboTsebo | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: fixed | Keywords: ApplicativeDo Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed * milestone: 8.2.3 => 8.4.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14105#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC