[GHC] #13889: GHC 8.0.2 panics when trying a simple snippet involving Parsec

#13889: GHC 8.0.2 panics when trying a simple snippet involving Parsec -------------------------------------+------------------------------------- Reporter: timmyjose | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Keywords: parsec, | Operating System: MacOS X ghc8.0.2, macOS Sierra | Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I am working through "Create your own Scheme in 48 hours", and the following program: {{{ $ cat SimpleParser.hs import Text.ParserCombinators.Parsec hiding (spaces) symbol :: Parser Char symbol = anyOf "!$%&|*+-/:<=?>@^_^~#" }}} causes GHC to crash and burn with a panic message. Please find the details as follows: ** PLATFORM and OS DETAILS ** {{{ $ sw_vers ProductName: Mac OS X ProductVersion: 10.12.2 BuildVersion: 16C67 $ uname -a Darwin <elided> 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64 }}} ** GHC and Parsec version** {{{ $ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.0.2 $ ghc-pkg list | grep -i parsec attoparsec-0.13.1.0 parsec-3.1.11 }}} ** crash error message ** {{{ $ ghc -v3 SimpleParser.hs Glasgow Haskell Compiler, Version 8.0.2, stage 2 booted by GHC version 7.10.3 Using binary package database: /Library/Frameworks/GHC.framework/Versions/8.0.2-x86_64/usr/lib/ghc-8.0.2/package.conf.d/package.cache Using binary package database: /Users/<elided>/.ghc/x86_64-darwin-8.0.2/package.conf.d/package.cache loading package database /Library/Frameworks/GHC.framework/Versions/8.0.2-x86_64/usr/lib/ghc-8.0.2/package.conf.d loading package database /Users/<elided>/.ghc/x86_64-darwin-8.0.2/package.conf.d wired-in package ghc-prim mapped to ghc-prim-0.5.0.0 wired-in package integer-gmp mapped to integer-gmp-1.0.0.1 wired-in package base mapped to base-4.9.1.0 wired-in package rts mapped to rts wired-in package template-haskell mapped to template-haskell-2.11.1.0 wired-in package ghc mapped to ghc-8.0.2 wired-in package dph-seq not found. wired-in package dph-par not found. Hsc static flags: loading package database /Library/Frameworks/GHC.framework/Versions/8.0.2-x86_64/usr/lib/ghc-8.0.2/package.conf.d loading package database /Users/z0ltan/.ghc/x86_64-darwin-8.0.2/package.conf.d wired-in package ghc-prim mapped to ghc-prim-0.5.0.0 wired-in package integer-gmp mapped to integer-gmp-1.0.0.1 wired-in package base mapped to base-4.9.1.0 wired-in package rts mapped to rts-1.0 wired-in package template-haskell mapped to template-haskell-2.11.1.0 wired-in package ghc mapped to ghc-8.0.2 wired-in package dph-seq not found. wired-in package dph-par not found. *** Chasing dependencies: Chasing modules from: *SimpleParser.hs !!! Chasing dependencies: finished in 0.62 milliseconds, allocated 0.337 megabytes Stable obj: [] Stable BCO: [] Ready for upsweep [NONREC ModSummary { ms_hs_date = 2017-06-28 09:58:23 UTC ms_mod = Main, ms_textual_imps = [(Nothing, Prelude), (Nothing, Text.ParserCombinators.Parsec)] ms_srcimps = [] }] *** Deleting temp files: Deleting: compile: input file SimpleParser.hs *** Checking old interface for Main: [1 of 1] Compiling Main ( SimpleParser.hs, SimpleParser.o ) *** Parser [Main]: !!! Parser [Main]: finished in 0.20 milliseconds, allocated 0.134 megabytes *** Renamer/typechecker [Main]: *** Deleting temp files: Deleting: *** Deleting temp dirs: Deleting: ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): initTc: unsolved constraints WC {wc_insol = [W] anyOf_a1lw :: t_a1lv[tau:1] (CHoleCan: anyOf)} Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13889 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13889: GHC 8.0.2 panics when trying a simple snippet involving Parsec -------------------------------------+------------------------------------- Reporter: timmyjose | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: duplicate | Keywords: parsec, | ghc8.0.2, macOS Sierra Operating System: MacOS X | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13106 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate * related: => #13106 Comment: Thanks for the bug report. This is a duplicate of #13106, which has been fixed in GHC 8.2.1. In 8.2.1, I get a reasonable error message: {{{ $ /opt/ghc/8.2.1/bin/ghc Bug.hs [1 of 1] Compiling Main ( Bug.hs, Bug.o ) Bug.hs:1:1: error: The IO action ‘main’ is not defined in module ‘Main’ | 1 | import Text.ParserCombinators.Parsec hiding (spaces) | ^ Bug.hs:4:10: error: Variable not in scope: anyOf :: [Char] -> Parser Char | 4 | symbol = anyOf "!$%&|*+-/:<=?>@^_^~#" | ^^^^^ }}} Alternatively, you can make the panic go away in 8.0.2 by just adding `module SimpleParser where` at the top of the file (the lack of `main` is confusing GHC in 8.0.2). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13889#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13889: GHC 8.0.2 panics when trying a simple snippet involving Parsec -------------------------------------+------------------------------------- Reporter: timmyjose | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: duplicate | Keywords: parsec, | ghc8.0.2, macOS Sierra Operating System: MacOS X | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13106 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by timmyjose): Thank you! I think it's high time I upgraded my GHC version in any case, so thanks for confirming that the bug had already long been fixed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13889#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC