Bug (1): A totally clean, top of the CVS tree does not work on NT 4.0.

Behavior: returns with no result, any program.
Strange: Adding '+RTS -s' makes things work fine.
I think that there is not enough stack space on the C stack,
and the "change %esp register is failing us". The alloca
function is for this.

Andy Gill

Here are two runs;

bash% ./main.exe
bash% ./main.exe +RTS -s
   1) [2,4,6,1,3,5]
   2) [3,6,2,5,1,4]
   3) [4,1,5,2,6,3]
   4) [5,3,1,6,4,2]

Here are two runs; both have a debug rts turned on.

bash% ./main.exe +RTS -D1
---- Initialised TSO 1 (0x141c0000), stack size = f3 words
scheduler: created thread 1, stack size = f3 words
Stack[2] (0x141c03f4) = 0x42bb3c                        FUN(0x414190, 0x402b08)
Stack[1] (0x141c03f8) = 0x42b0bc                        FUN(0x402b34)
Object 0x141c03fc = StopFrame(0x41d980)
scheduler: new main thread (1)
scheduler: running thread 1
bash% ./main.exe +RTS -s -D1
---- Initialised TSO 1 (0x141c0000), stack size = f3 words
scheduler: created thread 1, stack size = f3 words
Stack[2] (0x141c03f4) = 0x42bb3c                        FUN(0x414190, 0x402b08)
Stack[1] (0x141c03f8) = 0x42b0bc                        FUN(0x402b34)
Object 0x141c03fc = StopFrame(0x41d980)
scheduler: new main thread (1)
scheduler: running thread 1
   1) [2,4,6,1,3,5]
scheduler: thread 1 stopped: HeapOverflow
scheduler: running thread 1
   2) [3,6,2,5,1,4]
   3) [4,1,5,2,6,3]
scheduler: thread 1 stopped: HeapOverflow
scheduler: running thread 1
   4) [5,3,1,6,4,2]
scheduler: thread 1 finished
scheduler: main thread (1) finished
---- Initialised TSO 2 (0x141bc000), stack size = f3 words
scheduler: created thread 2, stack size = f3 words
Stack[2] (0x141bc3f4) = 0x42bb3c                        FUN(0x414190, 0x402b08)
Stack[1] (0x141bc3f8) = 0x141be4e8                      FUN(0x4062e0, 0x141be454
)
Object 0x141bc3fc = StopFrame(0x41d980)
scheduler: new main thread (2)
scheduler: running thread 2
scheduler: thread 2 finished
scheduler: main thread (2) finished

Now here is the gdb run, with no arguments (the one that fails above)

bash% gdb ./main
GNU gdb 4.17.1
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-cygwin32"...
(gdb) run
Starting program: /Ideas/Hood/./main.exe
61000000:/cygnus/cygwin-b20/H-i586-cygwin32/bin/cygwin1.dll

[failed reading symbols from DLL]
"/WINNT/system32/advapi32.dll": error reading line numbers


[failed reading symbols from DLL]
"/WINNT/system32/KERNEL32.dll": error reading line numbers

77e70000:/WINNT/system32/USER32.dll
77ed0000:/WINNT/system32/GDI32.dll
77e10000:/WINNT/system32/RPCRT4.dll
77bf0000:/WINNT/System32/rpcltc1.dll
   1) [2,4,6,1,3,5]
   2) [3,6,2,5,1,4]
   3) [4,1,5,2,6,3]
   4) [5,3,1,6,4,2]

Program exited normally.
(gdb)

--------------------------------------------------------------------------
The -v of the build:

bash% /master/ghc2/ghc/driver/ghc-inplace Main.hs -o main.exe -v
The Glorious Glasgow Haskell Compilation System, version 4.07

Effective command line: -o main.exe -v

Ineffective C pre-processor:
        echo '{-# LINE 1 "Main.hs" -}' > c:/tmp/ghc20460.cpp && cat Main.hs >> c
:/tmp/ghc20460.cpp

real    0m0.010s
user    0m0.000s
sys     0m0.000s

Haskell compiler:
        /master/ghc2/ghc/driver/../compiler/hsc c:/tmp/ghc20460.cpp  -fignore-in
terface-pragmas -fomit-interface-pragmas -fsimplify [ -fmax-simplifier-iteration
s4 ]   -fwarn-overlapping-patterns -fwarn-missing-methods -fwarn-missing-fields
-fwarn-deprecations -fwarn-duplicate-exports -fhi-version=407 -static "-himap=.%
.hi:/master/ghc2/ghc/driver/../lib/std%.hi" "-himap-sep=:"    -v -hifile=c:/tmp/
ghc20460.hi -C=c:/tmp/ghc20460.hc -F=c:/tmp/ghc20460_stb.c -FH=c:/tmp/ghc20460_s
tb.h +RTS -H6000000 -K1000000
Glasgow Haskell Compiler, version 4.07, for Haskell 98, compiled by GHC version
4.03

real    0m3.025s
user    0m0.020s
sys     0m0.000s

Pin on Haskell consistency info:
        echo 'static char ghc_hsc_ID[] = "@(#)hsc Main.hs       40.0,,";' >> c:/
tmp/ghc20460.hc

real    0m0.010s
user    0m0.000s
sys     0m0.010s
*** New hi file follows...
__interface Main 407 where
__export Main main;
main :: PrelIOBase.IO PrelBase.Z0T ;


ghc-inplace: module version unchanged at 5

Replace .hi file, if changed:
        cmp -s Main.hi c:/tmp/ghc20460.hi-new || ( rm -f Main.hi && cp c:/tmp/gh
c20460.hi-new Main.hi )

real    0m0.050s
user    0m0.020s
sys     0m0.030s

C compiler:
        gcc -v  -DDONT_WANT_WIN32_DLL_SUPPORT -S -Wimplicit -O -DSTOLEN_X86_REGS
=4 -fomit-frame-pointer -fno-defer-pop  -I. -I/master/ghc2/ghc/driver/../include
s ghc20460.c > c:/tmp/ghc20460.ccout 2>&1 && ( if [ ghc20460.s != c:/tmp/ghc2046
0_o.s ] ; then mv ghc20460.s c:/tmp/ghc20460_o.s ; else exit 0 ; fi )

real    0m1.181s
user    0m0.931s
sys     0m0.150s
Reading specs from C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-
cygwin32\egcs-2.91.57\specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-cygwin32\egcs-2.91
.57\cpp.exe -lang-c -v -I. -I/master/ghc2/ghc/driver/../includes -iprefix C:\cyg
nus\cygwin-b20\H-i586-cygwin32\bin\..\lib/gcc-lib/i586-cygwin32\egcs-2.91.57\ -u
ndef -D__GNUC__=2 -D__GNUC_MINOR__=91 -Di386 -D_WIN32 -DWINNT -D_X86_=1 -D__STDC
__=1 -D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__
)) -D__declspec(x)=__attribute__((x)) -D__i386__ -D_WIN32 -D__WINNT__ -D_X86_=1
-D__STDC__=1 -D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((_
_cdecl__)) -D__declspec(x)=__attribute__((x)) -D__i386 -D__WINNT -Asystem(winnt)
 -Acpu(i386) -Amachine(i386) -D__OPTIMIZE__ -Wimplicit -remap -Acpu(i386) -Amach
ine(i386) -Di386 -D__i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pe
ntium -D__pentium__ -D__CYGWIN32__ -D__CYGWIN__ -DDONT_WANT_WIN32_DLL_SUPPORT -D
STOLEN_X86_REGS=4 ghc20460.c c:/tmp\ccy2uLxc.i
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 .
 \master\ghc2\ghc\driver\..\includes
 C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-cygwin32\egcs-2.91
.57\..\..\..\..\..\include
 C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-cygwin32\egcs-2.91
.57\..\..\..\..\i586-cygwin32\include
 C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-cygwin32\egcs-2.91
.57\include
 \cygnus\cygwin-b20\H-i586-cygwin32\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\..\..
\..\..\..\include
 \cygnus\cygwin-b20\H-i586-cygwin32\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\..\..
\..\..\i586-cygwin32\include
 \cygnus\cygwin-b20\H-i586-cygwin32\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\inclu
de
End of search list.
 C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-cygwin32\egcs-2.91
.57\cc1.exe c:/tmp\ccy2uLxc.i -quiet -dumpbase ghc20460.c -O -Wimplicit -version
 -fomit-frame-pointer -fno-defer-pop -o ghc20460.s
GNU C version egcs-2.91.57 19980901 (egcs-1.1 release) (i586-cygwin32) compiled
by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).

Unix assembler:
        gcc -o Main.o -c  -I. -I/master/ghc2/ghc/driver/../includes c:/tmp/ghc20
460.s
0.09user 0.03system 0:00.12elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps

Linker:
        gcc -v -u _PrelMain_mainIO_closure -u _PrelBase_Izh_static_info -u _Prel
Base_Czh_static_info -u _PrelFloat_Fzh_static_info -u _PrelFloat_Dzh_static_info
 -u _PrelAddr_Azh_static_info -u _PrelAddr_Wzh_static_info -u _PrelAddr_I64zh_st
atic_info -u _PrelAddr_W64zh_static_info -u _PrelStable_StablePtr_static_info -u
 _PrelBase_Izh_con_info -u _PrelBase_Czh_con_info -u _PrelFloat_Fzh_con_info -u
_PrelFloat_Dzh_con_info -u _PrelAddr_Azh_con_info -u _PrelAddr_Wzh_con_info -u _
PrelAddr_I64zh_con_info -u _PrelAddr_W64zh_con_info -u _PrelStable_StablePtr_con
_info -u _PrelBase_False_static_closure -u _PrelBase_True_static_closure -u _Pre
lPack_unpackCString_closure -u _PrelException_stackOverflow_closure -u _PrelExce
ption_heapOverflow_closure -u _PrelException_NonTermination_static_closure -o ma
in.exe Main.o -L/master/ghc2/ghc/driver/../rts -L/master/ghc2/ghc/driver/../rts/
gmp -L/master/ghc2/ghc/driver/../lib/std -L/master/ghc2/ghc/driver/../lib/std/cb
its  -lHS -lHS_cbits -lHSrts -lwinmm -lwsock32 -lgmp
Reading specs from C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-
cygwin32\egcs-2.91.57\specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-cygwin32\egcs-2.91
.57\collect2.exe -o main.exe -u _PrelMain_mainIO_closure -u _PrelBase_Izh_static
_info -u _PrelBase_Czh_static_info -u _PrelFloat_Fzh_static_info -u _PrelFloat_D
zh_static_info -u _PrelAddr_Azh_static_info -u _PrelAddr_Wzh_static_info -u _Pre
lAddr_I64zh_static_info -u _PrelAddr_W64zh_static_info -u _PrelStable_StablePtr_
static_info -u _PrelBase_Izh_con_info -u _PrelBase_Czh_con_info -u _PrelFloat_Fz
h_con_info -u _PrelFloat_Dzh_con_info -u _PrelAddr_Azh_con_info -u _PrelAddr_Wzh
_con_info -u _PrelAddr_I64zh_con_info -u _PrelAddr_W64zh_con_info -u _PrelStable
_StablePtr_con_info -u _PrelBase_False_static_closure -u _PrelBase_True_static_c
losure -u _PrelPack_unpackCString_closure -u _PrelException_stackOverflow_closur
e -u _PrelException_heapOverflow_closure -u _PrelException_NonTermination_static
_closure C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-cygwin32\e
gcs-2.91.57\..\..\..\..\i586-cygwin32\lib\crt0.o -L/master/ghc2/ghc/driver/../rt
s -L/master/ghc2/ghc/driver/../rts/gmp -L/master/ghc2/ghc/driver/../lib/std -L/m
aster/ghc2/ghc/driver/../lib/std/cbits -LC:\cygnus\cygwin-b20\H-i586-cygwin32\bi
n\..\lib\gcc-lib\i586-cygwin32\egcs-2.91.57 -LC:\cygnus\cygwin-b20\H-i586-cygwin
32\bin\..\lib\gcc-lib -L\cygnus\cygwin-b20\H-i586-cygwin32\lib\gcc-lib\i586-cygw
in32\egcs-2.91.57 -LC:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586
-cygwin32\egcs-2.91.57\..\..\..\..\i586-cygwin32\lib -L\cygnus\cygwin-b20\H-i586
-cygwin32\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\..\..\..\..\i586-cygwin32\lib -
LC:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-cygwin32\egcs-2.91
.57\..\..\.. Main.o -lHS -lHS_cbits -lHSrts -lwinmm -lwsock32 -lgmp -lgcc -lcygw
in -lkernel32 -ladvapi32 -lshell32 -lgcc
0.40user 0.32system 0:01.03elapsed 69%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps

rm -f c:/tmp/ghc20460*
bash%

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

Bug (2) BTW, attempting to compiled StgCRun, to use the Mini interpreter failes
with gcc 2.91.57 on NT 4.0:

StgCRun.c:43: warning: unused parameter `basereg'
StgCRun.c:43: warning: argument `f' might be clobbered by `longjmp' or `vfork'
StgCRun.c:62: fixed or forbidden register 4 (si) was spilled for class SIREG.
This may be due to a compiler bug or to impossible asm
statements or clauses.
deleting... ghc10033.c ghc10033.s /tmp/ghc10033.s

Reply via email to