[GHC] #12746: Assertion failed with BuildFlavour = devel2 (one more)
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Affected versions: ghc 8.0.1 and ghc git master as of 21 Oct 2016 (c23dc61) It compiles fine on first time but fails to compile on second attempt. Using -fforce-recomp recompiles both files and bug is not triggered. {{{ % ls A.hs B.hs % cat A.hs }}} {{{#!hs module A where import B foo a = case a of Foo -> True _ -> False }}} {{{ % cat B.hs }}} {{{#!hs {-# LANGUAGE PatternSynonyms, ScopedTypeVariables #-} module B where pattern Foo = 0x00000001 :: Int }}} {{{ % ghc -O2 A.hs ; touch A.hs ; ghc -O2 A.hs [1 of 2] Compiling B ( B.hs, B.o ) [2 of 2] Compiling A ( A.hs, A.o ) [2 of 2] Compiling A ( A.hs, A.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): ASSERT failed! CallStack (from HasCallStack): assertPprPanic, called at compiler/iface/BuildTyCl.hs:195:404 in ghc:BuildTyCl [] ~ [] [] ~ [] Int ~ Int [] ~ [] [] ~ [] [] ~ [Void#] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): I couldn't reproduce this with the released GHC 8.0.1. Do you think it only happens with devel2 builds? Any idea why? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by pacak): I suspect that some assertions are not enabled outside of devel2 builds. I'm trying to make a devel2 build because there is a random compilation failure in our codebase which I can't reproduce at the moment but when compiling one of the prerequisites I'm getting this assert failure. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * priority: normal => high Comment: Aha, that makes sense. This seems mildly alarming... -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by akio): * cc: akio (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: => PatternSynonyms -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: mpickering Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * owner: => mpickering Comment: I can see where the problem is here. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: mpickering Type: bug | Status: patch Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2624 Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => patch * differential: => Phab:D2624 Comment: The ASSERT was slightly wrong as there is a special case where a `Void#` argument is added to the matching continuation to ensure laziness for a nullary pattern synonym. The fix is to check whether the number of arguments is 0 and if so check wether the only argument to the matcher is `Void#`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: mpickering Type: bug | Status: patch Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2624 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"23143f60680f78f80762754fe060a3e8c6dc9a01/ghc" 23143f6/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="23143f60680f78f80762754fe060a3e8c6dc9a01" Refine ASSERT in buildPatSyn for the nullary case. For a nullary pattern synonym we add an extra void argument to the matcher in order to preserve laziness. The check in buildPatSyn wasn't aware of this special case which was causing the assertion to fail. Reviewers: austin, simonpj, bgamari Reviewed By: simonpj, bgamari Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2624 GHC Trac Issues: #12746 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: mpickering Type: bug | Status: merge Priority: high | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2624 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => merge * milestone: => 8.0.2 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12746: Assertion failed with BuildFlavour = devel2 (one more) -------------------------------------+------------------------------------- Reporter: pacak | Owner: mpickering Type: bug | Status: closed Priority: high | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2624 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.0` as c33aad1e77bdfa929f52cefa8ebf7c5917b60405. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12746#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC