Opened 7 months ago

Closed 7 months ago

Last modified 7 months 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 Difficulty: Easy (less than 1 hour)
Test Case: th/T8333 Blocked By:
Blocking: Related Tickets:

Description

$ ./ghc-stage2 --interactive Test.hs
GHCi, version 7.7.20130919: http://www.haskell.org/ghc/  :? 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):
	toIfaceTickish

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

> 
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 7 months ago.

Download all attachments as: .zip

Change History (9)

Changed 7 months ago by klao

comment:1 Changed 7 months ago by klao

  • Cc mihaly.barasz@… added
  • Difficulty changed from Unknown to Easy (less than 1 hour)
  • Status changed from new to patch

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 7 months ago by simonpj

OK I'll fix that, thanks

comment:3 Changed 7 months 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 7 months ago by Simon Peyton Jones <simonpj@…>

comment:5 Changed 7 months ago by simonpj

  • Resolution set to fixed
  • Status changed from patch to closed
  • Test Case set to th/T8333

comment:6 Changed 7 months 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 7 months ago by nfrisby (previous) (diff)

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

comment:8 Changed 7 months ago by monoidal

@nfrisby: Fixed

Note: See TracTickets for help on using tickets.