Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#10533 closed bug (fixed)

Assertion failure on FD3 test in TcErrors

Reported by: goldfire Owned by:
Priority: normal Milestone: 8.0.1
Component: Compiler (Type checker) Version: 7.11
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by goldfire)

Test case typecheck/should_compile/FD3 leads to an ASSERTion error:

ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.11.20150605 for x86_64-apple-darwin):
	ASSERT failed!
  file compiler/typecheck/TcErrors.hs line 321
  [[D] _ :: a_amP[sk] ~ (String, a_amP[sk]) (CNonCanonical)]

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

FD3.log (attached) shows the error happening.

(When originally posting this ticket, I was very confused. The first several comments, through comment:6, are now bogus. Please ignore.)

Attachments (2)

FD3.log (37.4 KB) - added by goldfire 4 years ago.
-ddump-tc-trace exhibiting the error
FD3.2.log (37.2 KB) - added by rwbarton 4 years ago.
successful FD3 -ddump-tc-trace

Download all attachments as: .zip

Change History (11)

comment:1 Changed 4 years ago by simonpj

Bizarre. This is with HEAD?

Can you compile FD3 with -ddump-tc-trace on your Mac and attach the results?

Simon

comment:2 Changed 4 years ago by rwbarton

FWIW that commit validates on my Linux laptop also. Let me know if you want me to run any tests here.

But first I'd rule out explanation like: are you starting from a dirty build tree possibly? For example, if you run validate does the test still fail?

comment:3 Changed 4 years ago by goldfire

Just rebuilt on a different Mac (both with MacOS 10.8.5) from scratch with the same behavior. Here is an excerpt:

10:40:42 ~/Documents/Programming/ghc-cur/testsuite/tests/typecheck/should_compile> git log -n 1
commit 61b96a86c5342fb1c850361177d60fe855d948f6
Author: Richard Eisenberg <eir@cis.upenn.edu>
Date:   Fri Jun 5 09:56:21 2015 -0400

    Fix #10489
    
    Dang, roles are annoying.
    
    Test case: typecheck/should_compile/T10489
10:40:45 ~/Documents/Programming/ghc-cur/testsuite/tests/typecheck/should_compile> ~/Documents/Programming/ghc-cur/inplace/bin/ghc-stage2 --version
The Glorious Glasgow Haskell Compilation System, version 7.11.20150605
10:40:53 ~/Documents/Programming/ghc-cur/testsuite/tests/typecheck/should_compile> ~/Documents/Programming/ghc-cur/inplace/bin/ghc-stage2 -ddump-tc-trace FD3.hs > ~/temp/FD3.log 2>&1
10:41:26 ~/Documents/Programming/ghc-cur/testsuite/tests/typecheck/should_compile> 

The trace is attached.

Changed 4 years ago by goldfire

Attachment: FD3.log added

-ddump-tc-trace exhibiting the error

comment:4 Changed 4 years ago by goldfire

Happy to help with further debugging, but it's hard to know where to begin without seeing what the correct behavior is, which I can't seem to get on my machine. @rwbarton, could you perhaps post your -ddump-tc-trace as well for comparison? Thanks!

Changed 4 years ago by rwbarton

Attachment: FD3.2.log added

successful FD3 -ddump-tc-trace

comment:5 Changed 4 years ago by rwbarton

Attached. Your output seems to have additional messages that are enabled when debugIsOn, so maybe some other debugging output or assertion is panicking for you?

comment:6 in reply to:  5 Changed 4 years ago by goldfire

Replying to rwbarton:

Attached. Your output seems to have additional messages that are enabled when debugIsOn, so maybe some other debugging output or assertion is panicking for you?

Of course. The panic is an ASSERTion failure. So perhaps the problem is happening on all platforms, but only caught in a DEBUG build.

Indeed, your log contains the problematic derived constraint at the end of tryReporters. It just doesn't bail out.

So, weirdness resolved, I believe... but now we need to figure out why that assertion is failing.

Modifying ticket accordingly.

comment:7 Changed 4 years ago by goldfire

Component: CompilerCompiler (Type checker)
Description: modified (diff)
Operating System: MacOS XUnknown/Multiple
Summary: Typechecker behaves differently on Phab and on MacAssertion failure on FD3 test in TcErrors

comment:8 Changed 4 years ago by simonpj

Resolution: fixed
Status: newclosed

I looked at this and fixed it, but failed to make a separate patch. I think it is somewhere in

commit 02bac0254182def11029e2f7373ba8d2ba9ebe44
Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Thu Jun 18 14:12:54 2015 +0100

    Remove some horrible munging of origins for Coercible
    
    I just didn't think it was buying enough for all the cruft it caused.
    We can put some back if people start complaining about poor error
    messages. I forget quite how I tripped over this but I got sucked in.
    
    * Lots of tidying up in TcErrors
    
    * Rename pprArisingAt to pprCtLoc, by analogy with pprCtOrigin
    
    * Remove CoercibleOrigin data constructor from CtOrigin
    
    * Make relevantBindings return a Ct with a zonked
      and tidied CtOrigin
    
    * Add to TcRnTypes
          ctOrigin   :: Ct -> CtOrigin
          ctEvOrigin :: CtEvidence -> CtOrigin
          setCtLoc   :: Ct -> CtLoc -> Ct

But in any case it doesn't matter much. No need to merge etc.

comment:9 Changed 4 years ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.