Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#8333 closed bug (fixed)

The impossible happened with TH + -fno-omit-interface-pragmas

Reported by: errge Owned by:
Priority: high Milestone: 7.8.1
Component: Compiler Version: 7.7
Keywords: Cc: mihaly.barasz@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHCi crash Test Case: th/T8333
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


$ ./ghc-stage2 --interactive Test.hs
GHCi, version 7.7.20130919:  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main             ( /home/errge/tmp/Test.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.7.20130919 for i386-unknown-linux):

Please report this as a GHC bug:

Leaving GHCi.

With Test.hs being:

{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}

main :: IO ()
main = return ()

I want to make TemplateHaskell generated non-essential info visible even with -O0. Compilation works, everything is fine. But I can't load source code like this with GHCi, which is annoying.

Setting priority to high, since this is a crash.

Attachments (1)

b8333.patch (1.3 KB) - added by klao 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by klao

Attachment: b8333.patch added

comment:1 Changed 4 years ago by klao

Cc: mihaly.barasz@… added
difficulty: UnknownEasy (less than 1 hour)
Status: newpatch

The attached patch contains an obvious easy fix.

Another approach would be to change TidyPgm to remove the breakpoints even if -fno-omit-interface-pragmas is on. But, I don't see clearly what other consequences would that have. There was obviously a path to this panic from GHCi, but maybe it could also be triggered by someone using the GHC API directly.

comment:2 Changed 4 years ago by simonpj

OK I'll fix that, thanks

comment:3 Changed 4 years ago by Simon Peyton Jones <simonpj@…>

In d57f2ad3048dc954053ccac51180097e837d8055/ghc:

Ignore Tickish Breakpoints when serialising Core into interface files

This fixes Trac #8333

Thanks to 'klao', who identified the cause and provided the patch

comment:4 Changed 4 years ago by Simon Peyton Jones <simonpj@…>

comment:5 Changed 4 years ago by simonpj

Resolution: fixed
Status: patchclosed
Test Case: th/T8333

comment:6 Changed 4 years ago by nfrisby

The T8333 rule in tests/th/Makefile is missing a -v0 argument — the build date is in the expected output.

(Sorry to report this simple ones without pushing — my tree is a bit tangly at the moment.)

Last edited 4 years ago by nfrisby (previous) (diff)

comment:7 Changed 4 years ago by Krzysztof Gogolewski <krz.gogolewski@…>

comment:8 Changed 4 years ago by monoidal

@nfrisby: Fixed

Note: See TracTickets for help on using tickets.