1 From sah@ukc.ac.uk Thu Aug 13 16:22:15 1992
2 Return-Path: <sah@ukc.ac.uk>
3 Received: from dcs.glasgow.ac.uk by pp.dcs.gla.ac.uk with SMTP (PP)
4 id <18256-0@pp.dcs.gla.ac.uk>; Thu, 13 Aug 1992 16:21:57 +0100
5 Message-Id: <13760.9208131521@vanuata.dcs.glasgow.ac.uk>
6 Via: uk.ac.ukc; Thu, 13 Aug 92 16:21:50 BST
7 Received: from gos by mercury.ukc.ac.uk with UKC POP3+ id aa10412;
9 From: Steve Hill <sah@ukc.ac.uk>
10 To: glasgow-haskell-bugs@dcs.gla.ac.uk
11 Subject: Possible bug.
12 Date: Thu, 13 Aug 92 16:21:53 +0100
14 Report from Dr. Steve Hill, Computing Laboratory, University of Kent.
18 The following (rather silly) program causes a stack overflow (the B
23 #include "GhcPrelude.h"
26 main = print (final nums)
32 fromn n = n : fromn (n+1)
35 final (a:l) = seq (force a) (final l)
40 seq :: Int -> Int -> Int
44 I would expect it to be able to run in constant space - I may be wrong.
48 beech.ukc.ac.uk% a.out
49 croaked in StackOverflow
52 This is the output of a -v compilation:
54 beech.ukc.ac.uk% ghc -v Try.hs -cpp
55 The Glorious New Glasgow Haskell Compilation System, version 0.06
56 project label: `ghc'; setup label: `std'
57 using a `sun4' host to build a Haskell compiler to run on a
58 `sun4' host that will generate `C' code
60 Haskellised C pre-processor:
61 echo '{-# LINE 1 "Try.hs"-}' > /tmp/ghc15040.cpp;
62 /proj/haskell/ghc-0.06/./driver/.././utils/scripts/hscpp -v
63 -D__HASKELL1__=2 -D__GLASGOW_HASKELL__ -I.
64 -I/proj/haskell/ghc-0.06/imports Try.hs >> /tmp/ghc15040.cpp
65 0.1 real 0.0 user 0.0 sys
66 hscpp:CPP invoked: /lib/cpp -D__HASKELL1__=2
67 -D__GLASGOW_HASKELL__ -I. -I/proj/haskell/ghc-0.06/imports Try.hs
70 /proj/haskell/ghc-0.06/./driver/.././parsers/hsp/hsp -v -I.
71 -I/proj/haskell/ghc-0.06/imports /tmp/ghc15040.cpp > /tmp/ghc15040.hsp
72 Glasgow Haskell parser, version 0.06
73 Hash Table Contains 993 entries
74 1.2 real 0.4 user 0.2 sys
77 /proj/haskell/ghc-0.06/./driver/.././compiler/hsc <
78 /tmp/ghc15040.hsp - -v > /tmp/ghc15040.hsc
79 Glasgow Haskell Compiler, version 0.06
81 17.4 real 7.0 user 2.0 sys
83 Pin on Haskell consistency info:
84 echo 'static char ghc_hsc_ID[] = "@(#)hsc_comp Try.hs
85 ver=1.0,";' >> /tmp/ghc15040.hsc
86 0.1 real 0.0 user 0.0 sys
87 extracting C (/tmp/ghc15040.hc) and interface (Try.hi) from /tmp/ghc15040.hsc
88 interface really going into: Main.hi
90 Comparing old and new .hi files:
91 cmp -s /tmp/ghc15040.hi Main.hi || mv /tmp/ghc15040.hi Main.hi
92 0.2 real 0.0 user 0.0 sys
94 ANSI-C Haskell assembler:
95 cc -v -S -DDO_RUNTIME_PROFILING -DDO_RUNTIME_TRACE_UPDATES -g
96 -DGC2s -D__HASKELL1__=2 -D__GLASGOW_HASKELL__ -I.
97 -I/proj/haskell/ghc-0.06/imports /tmp/ghc15040.c -o /tmp/ghc15040.s
98 /lib/cpp -I. -I/proj/haskell/ghc-0.06/imports -undef -Dunix -Dsun
99 -Dsparc -DDO_RUNTIME_PROFILING -DDO_RUNTIME_TRACE_UPDATES -DGC2s
100 -D__HASKELL1__=2 -D__GLASGOW_HASKELL__ /tmp/ghc15040.c >/tmp/cpp.15067.0.i
101 /lib/ccom - -Xg </tmp/cpp.15067.0.i >/tmp/ghc15040.s
102 rm /tmp/cpp.15067.0.i
103 2.6 real 1.6 user 0.5 sys
106 as /tmp/ghc15040.s -o Try.o
107 2.3 real 1.1 user 0.5 sys
111 /proj/haskell/ghc-0.06/./driver/.././runtime/main/Preloads.sun4.o
112 -L/proj/haskell/ghc-0.06/./driver/.././runtime/objs-sun4
113 -L/proj/haskell/ghc-0.06/./driver/.././lib/objs-sun4 -lHS_2s -lHSrts_2s
114 51.1 real 12.1 user 5.6 sys
115 Checking consistency of: a.out