[ ghc-Bugs-1225368 ] Typechecker loop and stack overflow in 6.4
SourceForge.net
noreply at sourceforge.net
Tue Jun 28 05:55:29 EDT 2005
Bugs item #1225368, was opened at 2005-06-22 08:29
Message generated for change (Settings changed) made by simonpj
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1225368&group_id=8032
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Compiler (Type checker)
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Einar Karttunen (ekarttun)
Assigned to: Nobody/Anonymous (nobody)
Summary: Typechecker loop and stack overflow in 6.4
Initial Comment:
The following seems to trigger an loop in the typechecker,
which does from stack overflow after a while.
The example is quite pointless but shows
the bug.
newtype PRef a = PRef a
type Drop1 a = a
class Ref a r | a -> r where readRef :: a -> r
instance Ref (PRef a) (Drop1 a) where readRef (PRef v) = v
Here is a dump from the test (bug.hs contains the above code):
e at yui ~/work/pcl/hpclc $ ghci -v -fglasgow-exts bug.hs
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 6.4, for Haskell 98.
/ /_\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.
Using package config file: /usr/lib/ghc-6.4/package.conf
Using package config file: /home/e/.ghc/i386-linux-6.4/package.conf
Hsc static flags: -static
*** Parser:
*** Desugar:
*** Simplify:
*** CorePrep:
*** ByteCodeGen:
Loading package base-1.0 ... linking ... done.
*** Parser:
*** Desugar:
*** Simplify:
*** CorePrep:
*** ByteCodeGen:
*** Chasing dependencies:
unload: retaining objs []
unload: retaining bcos []
Stable modules:
unload: retaining objs []
unload: retaining bcos []
*** Compiling Main ( bug.hs, interpreted ):
compile: input file bug.hs
*** Checking old interface for Main:
Compiling Main ( bug.hs, interpreted )
*** Parser:
*** Renamer/typechecker:
*** Exception: stack overflow
----------------------------------------------------------------------
Comment By: Simon Peyton Jones (simonpj)
Date: 2005-06-28 09:36
Message:
Logged In: YES
user_id=50165
Excellent point. Now fixed.
tc195.hs tests this case.
Thank you for the report
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1225368&group_id=8032
More information about the Glasgow-haskell-bugs
mailing list