Another porting question... (SPARC-Linux this time)
Michael Weber
michael.weber@post.rwth-aachen.de
Tue, 22 May 2001 14:58:31 +0200
On Tue, May 22, 2001 at 09:48:18 +0100, Simon Marlow wrote:
> First thing to do is run gdb on the hsc binary (ok, you have to jump
> through a couple of hoops to do this with 4.08: run ghc -v and ^Z when
> hsc starts running, then cut-n-paste the command line into gdb). If
> this gives you enough information to track down the problem, then all
> well and good.
[...]
Program received signal SIGSEGV, Segmentation fault.
0xd20e94 in evacuate ()
(gdb) bt
#0 0xd20e94 in evacuate ()
#1 0xd22c04 in scavenge_stack ()
#2 0xd21f34 in scavengeTSO ()
#3 0xd23194 in scavenge_large ()
#4 0xd1fb8c in GarbageCollect ()
#5 0xd13a34 in schedule ()
#6 0xd13ed8 in waitThread ()
#7 0xd123ac in rts_evalIO ()
#8 0xd11dbc in main ()
#9 0x7008c464 in __libc_start_main () from /lib/libc.so.6
> Otherwise we'll have to dig deeper... compile the RTS with debugging
> turned on (see config.mk for the options to turn on), and we'll take
> it from there.
Ok, I rebuild it with debugging turned on:
[226]% ./ghc-inplace -optc-DNO_REGS -optc-DUSE_MINIINTERPRETER -fno-asm-mangling -funregisterised -fvia-C foo.hs
ASSERTION FAILED: file GC.c, line 1311
Haskell compiler received signal 6 (core dumped)
Here's what gdb says:
(gdb) bt
#0 evacuate (q=0x500ac000) at GC.c:1310
#1 0xd242fc in MarkRoot (root=0x500ac000) at GC.c:1041
#2 0xd15458 in GetRoots () at Schedule.c:1965
#3 0xd2352c in GarbageCollect (get_roots=0xd1540c <GetRoots>, force_major_gc=16134288) at GC.c:376
#4 0xd14e44 in schedule () at Schedule.c:1119
#5 0xd153ac in waitThread (tso=0x500bc000, ret=0x0) at Schedule.c:1800
#6 0xd1311c in rts_evalIO (p=0xf2b278, ret=0x0) at RtsAPI.c:356
#7 0xd12b34 in main (argc=27, argv=0xeffff1cc) at Main.c:103
(gdb) print *q
$4 = {header = {info = 0xedb4e4}, payload = 0x500ac004}
(gdb) print *(q->header.info)
$8 = {srt = 0x0, layout = {payload = {ptrs = 0, nptrs = 0}, bitmap = 0,
selector_offset = 0, large_bitmap = 0x0}, type = 59, srt_len = 0,
entry = 0xd1f2b0 <TSO_entry>, vector = 0xedb4f4}
> > * sizeof(int) == 4 (despite Sparc_64_)
>
> sizeof(void *) better be 4 too, otherwise we're into untested territory
> (the 64-bit support hasn't been used for a while).
*err* yes, that's what i meant to write, of course! sizeof(int) == 4
does hold even on Alphas... =)
Cheers,
Michael
--
() ASCII ribbon campaign | Chair for Computer Science II | GPG: F65C68CD
/\ against HTML mail | RWTH Aachen, Germany | PGP: 1D0DD0B9