logo       

[ ghc-Bugs-1278003 ] compiler panic: msg#00002

lang.haskell.glasgow.bugs

Subject: [ ghc-Bugs-1278003 ] compiler panic

Bugs item #1278003, was opened at 2005-08-31 22:52
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1278003&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: GHCi
Group: 6.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: compiler panic

Initial Comment:
I played with cyclic lists in GHCI.
My session looked like:

% ghci

___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version
6.4, for Haskell 98.
/ /_\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.

Loading package base-1.0 ... linking ... done.
Prelude> let cl = cycle [1..5]
Prelude> take 100 cl
[1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5]
Prelude> let cl = cycle [-2,2]
Prelude> take 100 cl
[-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2]
Prelude> let cl = cycle [-2..2]
Prelude> sum $ take 1000 cl
0
Prelude> sum $ take 10000 cl
0
Prelude> sum $ take 100000 cl
0
Prelude> sum $ take 1000000 cl
*** Exception: stack overflow
Prelude> sum $! take 1000000 cl
*** Exception: stack overflow
Prelude> foldl' (+) 0 $! take 1000000 cl

<interactive>:1:0: Not in scope: `foldl''
Prelude> List.foldl' (+) 0 $! take 1000000 cl

<interactive>:1:0: Not in scope: `List.foldl''
Prelude> Data.List.foldl' (+) 0 $! take 1000000 cl
0
Prelude> Data.List.foldl' (+) 0 $! take 10000000 cl
0
Prelude> Data.List.foldl' (+) 0 $! take 100000000 cl
0
Prelude> Data.List.foldl' (+) 0 $! take 100000000 cl
0
Prelude> Data.List.foldl' (+) 0 $! take 1000000 cl
0
Prelude> Data.List.foldl (+) 0 $! take 1000000 cl
*** Exception: stack overflow

*********************

After that I read "TyingTheKnot" page of HaWiki and
desided to repeat example with double linked list. So i
created file. It already contained some garbage from my
previous experiments but I decided it's irrelevant:

% cat test13.hs

import Control.Exception as C

data DL a = DL {prev_dl::DL, el::a, next_dl::DL}

mkDL :: [a] -> DL a
mkDL xs = let (first,last) = go last xs first
in first

go :: DL a -> [a] -> DL a -> (DL a,DL a)
go prev [] next = (prev, next)
go prev (x:xs) next = let this = DL prev x rest
(rest,fin) = go this xs next
in this

takeF 0 lst = []
takeF n lst = (el lst):takeF (n-1) next_dl lst

takeR 0 lst = []
takeR n lst = (el lst):takeF (n-1) prev_dl lst





main = do putStrLn "hello"
r <- getLine
C.catch (action r) handler

action :: String -> IO()
action r = if (r=="") then C.ioError (userError "input
void")
else print $ r++r

handler :: Exception -> IO()
% cat test14.hs

~/coding/Haskell
% cat test13.hs

~/coding/Haskell
import Control.Exception as C

data DL a = DL {prev_dl::DL, el::a, next_dl::DL}

mkDL :: [a] -> DL a
mkDL xs = let (first,last) = go last xs first
in first

go :: DL a -> [a] -> DL a -> (DL a,DL a)
go prev [] next = (prev, next)
go prev (x:xs) next = let this = DL prev x rest
(rest,fin) = go this xs next
in this

takeF 0 lst = []
takeF n lst = (el lst):takeF (n-1) next_dl lst

takeR 0 lst = []
takeR n lst = (el lst):takeF (n-1) prev_dl lst





main = do putStrLn "hello"
r <- getLine
C.catch (action r) handler

action :: String -> IO()
action r = if (r=="") then C.ioError (userError "input
void")
else print $ r++r

handler :: Exception -> IO()

*** end of test13.hs

After file was ready I tried to load it in my ghci
session and got this:

Prelude> :l test13.hs
Compiling Main ( test13.hs, interpreted )
ghc-6.4: panic! (the `impossible' happened, GHC version
6.4):
Unify.unifyTauTyLists: mismatched type lists!

Please report it as a compiler bug to
glasgow-haskell-bugs@xxxxxxxxxxx,
or http://sourceforge.net/projects/ghc/.

>
>

Some info about my system.

% uname -a

Linux mausov_comp 2.6.10-as5 #1 Fri Jun 24 13:45:31 MSD
2005 i686 Intel(R) Celeron(R) CPU 2.30GHz GenuineIntel
GNU/Linux

% gcc -v

Reading specs from
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/specs
Configured with:
/var/tmp/portage/gcc-3.3.4-r1/work/gcc-3.3.4/configure
--prefix=/usr
--bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3
--includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info
--enable-shared --host=i686-pc-linux-gnu
--target=i686-pc-linux-gnu --with-system-zlib
--enable-languages=c,c++ --enable-threads=posix
--enable-long-long --disable-checking
--disable-libunwind-exceptions --enable-cstdio=stdio
--enable-version-specific-runtime-libs
--with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/include/g++-v3
--with-local-prefix=/usr/local --enable-shared
--enable-nls --without-included-gettext
--disable-multilib --enable-__cxa_atexit
--enable-clocale=generic
Thread model: posix
gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1,
ssp-3.3.2-2, pie-8.7.6)

I compiled ghc-6.4 using ghc-6.2.2

My email is v_dmitry@xxxxxxx

Hope that'l help











----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1278003&group_id=8032


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise