Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,391
    • Issues 4,391
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 371
    • Merge Requests 371
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #17619

Closed
Open
Opened Dec 28, 2019 by Galen Huntington@galenReporter

"Tick in rule" impossible error in 8.10.1-alpha2 using Megaparsec.

Summary

A parser I'm working on that uses Megaparsec (either 7.0.5 or 8.0.0) is failing to compile under the pre-release of 8.10.1 with an "impossible" error.

Steps to reproduce

I have stripped it down to the following:

module TickInRule where  
  
import Control.Monad (void)  
import Text.Megaparsec  
import Text.Megaparsec.Char  
  
foo :: String -> Parsec () String ()  
foo s = do  
   manyTill (foo "a") (lookAhead $ void (string s) <|> eof)  
   void (string s)  

(This parser doesn't make much sense of course, but I've removed everything not necessary for the error.)

I get this using ghc -O2 bad.hs:

[1 of 1] Compiling TickInRule       ( bad.hs, bad.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 8.10.0.20191210:
	Tick in rule
  src<libraries/base/GHC/Base.hs:(1448,1)-(1453,15)>
  src<libraries/base/Data/List/NonEmpty.hs:(187,1)-(190,51)>
  src<libraries/base/GHC/Base.hs:(1403,1)-(1418,26)> lvl_s3lT
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1179:37 in ghc:Outputable
        pprPanic, called at compiler/specialise/Rules.hs:720:5 in ghc:Rules

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

Oddly, factoring out the void part (let v = void (string s)) makes the error go away; indeed, so does factoring out just string s.

Using no optimization or even -O also results in no error.

This is as far as I've gotten.

Environment

  • GHC version used: ghc-8.10.0.20191210-x86_64-deb9-linux-dwarf
Edited Dec 28, 2019 by Galen Huntington
Assignee
Assign to
8.10.2
Milestone
8.10.2 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#17619