[GHC] #13132: Compilation fails with a panic: get_op runContT
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | 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: -------------------------------------+------------------------------------- Compiling 'tersmu' from Hackage fails with the following: {{{ [13 of 16] Compiling ParseM ( ParseM.hs, ParseM.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): get_op runContT Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} The code can be found [https://gitlab.com/zugz/tersmu here]. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | 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 mpickering): Have you tried with 8.0.2? It might be #10618 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | 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 mpickering): I tried with 8.0.2 (`cabal install tersmu`) and the same panic exists. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | 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 RyanGlScott): Here's a minimal test case: {{{#!hs module Bug where newtype ContT r m a = ContT { runContT :: (a -> m r) -> m r } foo = (`runContT` bar.baz) }}} {{{ $ ghc Bug.hs [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-unknown-linux): get_op runContT }}} Also reproducible on GHC HEAD. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | 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: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: adamgundry (added) Comment: The culprit is commit b1884b0e62f62e3c0859515c4137124ab0c9560e (Implement DuplicateRecordFields). Thoughts, Adam? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | 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 adamgundry): Thanks for tracking this down. It looks like `get_op` is missing a case for `HsRecFld`. The unambiguous case is easy, something like: {{{#!hs get_op (L _ (HsRecFld (Unambiguous _ n))) = n }}} That should fix the bug when `DuplicateRecordFields` is disabled, at least. Unfortunately the case for `Ambiguous` (which may arise when when `DuplicateRecordFields` is enabled) is harder, because we don't know which `Name` is meant. I'll try to take a look at this, but it may not be very soon. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF 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 adamgundry): * keywords: => ORF -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF 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 simonpj): Ben/David/Reid: could you fix the unambiguous case as above, add a test; and add another expect_broken test for the ambiguous case. And then assign to Adam? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: rwbarton Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF 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): * owner: => rwbarton -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: rwbarton Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | rename/should_compile/T13132 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2985 Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * testcase: => rename/should_compile/T13132 * differential: => Phab:D2985 Comment: I posted a diff fixing the unambiguous case as described above. I don't understand these extensions well enough to know whether it is actually possible for an ambiguous record selector to pass the renamer to this point, so I didn't add a failing test case for the ambiguous record field case. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | rename/should_compile/T13132 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2985 Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * owner: rwbarton => -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: adamgundry Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | rename/should_compile/T13132 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2985 Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * owner: => adamgundry -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:11> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: adamgundry Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | rename/should_compile/T13132 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2985 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"38374caa9d6e1373d1b9d335d0f99f3664931fd9/ghc" 38374caa/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="38374caa9d6e1373d1b9d335d0f99f3664931fd9" Fix get_op in the case of an unambiguous record selector (#13132) Test Plan: validate Reviewers: simonpj, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2985 GHC Trac Issues: #13132 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:12> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: adamgundry Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | rename/should_compile/T13132 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2985 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: => 8.2.1 Comment: Leaving this open until we also fix the ambiguous case described above. Adam, do you suppose you could have a look at this? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:13> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: adamgundry Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | rename/should_compile/T13132 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2985 Wiki Page: | -------------------------------------+------------------------------------- Comment (by adamgundry): Yes, will do. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:14> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: adamgundry Type: bug | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | rename/should_compile/T13132, | overloadedrecflds/should_fail/T13132_duplicaterecflds Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2985, Wiki Page: | Phab:D3126 -------------------------------------+------------------------------------- Changes (by adamgundry): * status: new => patch * testcase: rename/should_compile/T13132 => rename/should_compile/T13132, overloadedrecflds/should_fail/T13132_duplicaterecflds * differential: Phab:D2985 => Phab:D2985, Phab:D3126 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:15> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: adamgundry Type: bug | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | rename/should_compile/T13132, | overloadedrecflds/should_fail/T13132_duplicaterecflds Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2985, Wiki Page: | Phab:D3126 -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"2484d4dae65c81f218dcfe494b963b2630bb8fa6/ghc" 2484d4d/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="2484d4dae65c81f218dcfe494b963b2630bb8fa6" Refactor renaming of operators/sections to fix DuplicateRecordFields bugs A variety of panics were possible because the get_op function in RnTypes didn't handle the possibility that its argument might be an ambiguous record field. I've made its return type more informative to correctly handle occurrences of record fields. Fixes Trac #13132. Test Plan: new test overloadedrecflds/should_fail/T13132_duplicaterecflds Reviewers: bgamari, simonpj, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3126 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:16> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13132: Compilation fails with a panic: get_op runContT -------------------------------------+------------------------------------- Reporter: PoroCYon | Owner: adamgundry Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | rename/should_compile/T13132, | overloadedrecflds/should_fail/T13132_duplicaterecflds Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2985, Wiki Page: | Phab:D3126 -------------------------------------+------------------------------------- Changes (by adamgundry): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13132#comment:17> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC