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,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 381
    • Merge Requests 381
  • 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
  • #3153

Closed
Open
Opened Apr 06, 2009 by b_jonas@trac-b_jonas

Panic on syntactically wrong LANGUAGE pragma

I'm getting a panic from runghc. The program I'm compiling has a syntax error in the LANGUAGE pragma, but I still think I should get an error message instead of a panic.

I'm using ghc-6.10.2 compiled from vanilla sources (with extralibs and a few options in build.mk) on an amd64 debian etch linux system.

Below you can see a transscript of the compilation including the panic message, and the source code.

[am]king ~/a/tmp$ runghc Bug
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.2 for x86_64-unknown-linux):
	getOptions'.parseLanguage(2) went past eof token

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

1[am]king ~/a/tmp$ cat Bug.hs
{-# LANGUAGE - #-}
main = return ();
[am]king ~/a/tmp$ cat -A Bug.hs
{-# LANGUAGE - #-}$
main = return ();$
[am]king ~/a/tmp$ gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.3.3/configure --enable-languages=c,c++
Thread model: posix
gcc version 4.3.3 (GCC) 
[am]king ~/a/tmp$ runghc -v -dcore-lint Bug
Glasgow Haskell Compiler, Version 6.10.2, for Haskell 98, stage 2 booted by GHC version 6.10.1
Using package config file: /usr/local/ghc/lib/ghc-6.10.2/./package.conf
hiding package base-3.0.3.1 to avoid conflict with later version base-4.1.0.0
wired-in package ghc-prim mapped to ghc-prim-0.1.0.0
wired-in package integer mapped to integer-0.1.0.1
wired-in package base mapped to base-4.1.0.0
wired-in package rts mapped to rts-1.0
wired-in package haskell98 mapped to haskell98-1.0.1.0
wired-in package syb mapped to syb-0.1.0.1
wired-in package template-haskell mapped to template-haskell-2.3.0.1
wired-in package dph-seq mapped to dph-seq-0.3
wired-in package dph-par mapped to dph-par-0.3
Hsc static flags: -ignore-dot-ghci -static
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
*** Chasing dependencies:
Chasing modules from: 
Stable obj: []
Stable BCO: []
unload: retaining objs []
unload: retaining bcos []
Ready for upsweep []
Upsweep completely successful.
*** Deleting temp files:
Deleting: 
*** Chasing dependencies:
Chasing modules from: *Bug.hs
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.2 for x86_64-unknown-linux):
	getOptions'.parseLanguage(2) went past eof token

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

*** Deleting temp files:
Deleting: 
*** Deleting temp dirs:
Deleting: 
1[am]king ~/a/tmp$ 

(I found this bug when I tried to start a program with {-# LANGUAGE -XPatternGuards #-}.)

Trac metadata
Trac field Value
Version 6.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
6.10 branch
Milestone
6.10 branch
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#3153