[GHC] #10896: BadSock triggers failing ASSERT
#10896: BadSock triggers failing ASSERT -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- {{{ --- ./indexed-types/should_fail/BadSock.stderr.normalised 2015-09-18 20:44:48.437390831 +0000 +++ ./indexed-types/should_fail/BadSock.comp.stderr.normalised 2015-09-18 20:44:48.437390831 +0000 @@ -1,5 +1,5 @@ +ghc: panic! (the 'impossible' happened) + (GHC version 7.11.20150918 for x86_64-unknown-linux): + ASSERT failed! file compiler/typecheck/TcFlatten.hs, line 1041 -BadSock.hs:30:5: - The type family ‘Readable’ should have 1 argument, but has been given none - In the equations for closed type family ‘Foo’ - In the type family declaration for ‘Foo’ \ No newline at end of file +Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug \ No newline at end of file *** unexpected failure for BadSock(normal) }}} Haven't investigated any further. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10896> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10896: BadSock triggers failing ASSERT -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * cc: simonpj (added) Comment: This was caused by one of Simon's commits trying to fix the fallout from Phab:D202 (injective type families). See jstolarek's comment in https://phabricator.haskell.org/D202#34497. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10896#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10896: BadSock triggers failing ASSERT -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1260 -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => patch * differential: => Phab:D1260 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10896#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10896: BadSock triggers failing ASSERT -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1260 -------------------------------------+------------------------------------- Comment (by Richard Eisenberg <eir@…>): In [changeset:"8e8b9ed9849ba21e454e6204b368f8e993feaf7b/ghc" 8e8b9ed/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="8e8b9ed9849ba21e454e6204b368f8e993feaf7b" Run simplifier only when the env is clean. This fixes #10896. In the indexed-types/should_fail/BadSock test, there is a bad type definition. This gets type-checked, an error gets reported, but then **GHC keeps going**. Later, when running the simplifier to do an ambiguity check, the bad type environment causes GHC to fall over. My solution: only run the simplifier in a clean, error-free type environment. A downside of this is that fewer error messages are reported. This makes me a bit sad, but I'm not sure how to avoid the problem. Suggestions welcome. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10896#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10896: BadSock triggers failing ASSERT -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_fail/BadSock Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1260 -------------------------------------+------------------------------------- Changes (by goldfire): * testcase: => indexed-types/should_fail/BadSock * status: patch => closed * resolution: => fixed Comment: All set now. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10896#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10896: BadSock triggers failing ASSERT -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_fail/BadSock Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1260 Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): Simon, I remember you suggesting a better approach here. But I'm afraid I didn't note it down nor implement it. Do you remember what it was? Was it to protect all calls to `checkValidType` from !TcTyClsDecls? Thanks! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10896#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10896: BadSock triggers failing ASSERT -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_fail/BadSock Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1260 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Ug. This is all paged out, so I can't remember. I think I have something in my tree... The current situation it not terrible. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10896#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10896: BadSock triggers failing ASSERT -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_fail/BadSock Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1260 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"924f851700ca9ba7e0e7483b7ca4de62a4a74e15/ghc" 924f8517/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="924f851700ca9ba7e0e7483b7ca4de62a4a74e15" Refactor default methods (Trac #11105) This patch does some signficant refactoring to the treatment of default methods in class declarations, and more generally to the type checking of type/class decls. Highlights: * When the class has a generic-default method, such as class C a where op :: a -> a -> Bool default op :: Ord a => a -> a -> a the ClassOpItem records the type of the generic-default, in this case the type (Ord a => a -> a -> a) * I killed off Class.DefMeth in favour of the very-similar BasicTypes.DefMethSpec. However it turned out to be better to use a Maybe, thus Maybe (DefMethSpec Type) with Nothing meaning "no default method". * In TcTyClsDecls.tcTyClGroup, we used to accumulate a [TyThing], but I found a way to make it much simpler, accumulating only a [TyCon]. Much less wrapping and unwrapping. * On the way I also fixed Trac #10896 in a better way. Instead of killing off all ambiguity checks whenever there are any type errors (the fix in commit 8e8b9ed), I instead recover in TcTyClsDecls.checkValidTyCl. There was a lot of associated simplification all round }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10896#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10896: BadSock triggers failing ASSERT -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_fail/BadSock Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1260 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"1e041b7382b6aa329e4ad9625439f811e0f27232/ghc" 1e041b73/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="1e041b7382b6aa329e4ad9625439f811e0f27232" Refactor treatment of wildcards This patch began as a modest refactoring of HsType and friends, to clarify and tidy up exactly where quantification takes place in types. Although initially driven by making the implementation of wildcards more tidy (and fixing a number of bugs), I gradually got drawn into a pretty big process, which I've been doing on and off for quite a long time. There is one compiler performance regression as a result of all this, in perf/compiler/T3064. I still need to look into that. * The principal driving change is described in Note [HsType binders] in HsType. Well worth reading! * Those data type changes drive almost everything else. In particular we now statically know where (a) implicit quantification only (LHsSigType), e.g. in instance declaratios and SPECIALISE signatures (b) implicit quantification and wildcards (LHsSigWcType) can appear, e.g. in function type signatures * As part of this change, HsForAllTy is (a) simplified (no wildcards) and (b) split into HsForAllTy and HsQualTy. The two contructors appear when and only when the correponding user-level construct appears. Again see Note [HsType binders]. HsExplicitFlag disappears altogether. * Other simplifications - ExprWithTySig no longer needs an ExprWithTySigOut variant - TypeSig no longer needs a PostRn name [name] field for wildcards - PatSynSig records a LHsSigType rather than the decomposed pieces - The mysterious 'GenericSig' is now 'ClassOpSig' * Renamed LHsTyVarBndrs to LHsQTyVars * There are some uninteresting knock-on changes in Haddock, because of the HsSyn changes I also did a bunch of loosely-related changes: * We already had type synonyms CoercionN/CoercionR for nominal and representational coercions. I've added similar treatment for TcCoercionN/TcCoercionR mkWpCastN/mkWpCastN All just type synonyms but jolly useful. * I record-ised ForeignImport and ForeignExport * I improved the (poor) fix to Trac #10896, by making TcTyClsDecls.checkValidTyCl recover from errors, but adding a harmless, abstract TyCon to the envt if so. * I did some significant refactoring in RnEnv.lookupSubBndrOcc, for reasons that I have (embarrassingly) now totally forgotten. It had to do with something to do with import and export Updates haddock submodule. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10896#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC