stg_ap_v_ret porting crash: solved?

Rafael Martinez Torres rmartine at fdi.ucm.es
Fri Sep 26 13:53:35 EDT 2003




On Fri, 26 Sep 2003, Rafael Martinez Torres wrote:

>
> I enabled the flags -g
>


Sorry , the previous mail was incomplete. "send" button fired.

GhcRtsHcOpts= -g -optc-DDEBUG
GhcRtsCcOpts= -g

This is my session with gdb , ghc-6.0.1 and mips-sgi-irix65.

I thinks this has nothing to do with the gmp library, but with
StgPrimFloat.c  , line 250

DEbugging with gdb on a multithread RTS seems not easy . When the program
crash - I ask - is there any thread other than evaluator one present
at RTS ?
I don't understand very much on RTS internals, but, I guess a simple
"Hello World" thread may not deal with "decodeFloat operations"

May be the compiler gcc-3.0 is faulty for big binaries, due to MULTIGOT
linker, as gcc-2.95 was , and pointers are out of control.  I will try
gcc-3.2 then ..

Cheers.



bash-2.05a$ !gdb
gdb ghc/compiler/stage1/ghc-6.0.1
(gdb) set args "-B./" -"hello.hs"
(gdb) break main
Breakpoint 1 at 0x1155242c: file Main.c, line 56.
(gdb) run
Starting program: /scratch/users/eden/6.0.1/ghc-6.0.1-mips/ghc/compiler/stage1/ghc-6.0.1 "-B./" "hello.hs"

Breakpoint 1, main (argc=3, argv=0x7fff2e84) at Main.c:56
56          startupHaskell(argc,argv,__stginit_Main);
(gdb) n
108         status = rts_mainLazyIO((HaskellObj)mainIO_closure, NULL);
(gdb) s
rts_mainLazyIO (p=0x116b3620, ret=0x0) at SchedAPI.h:54
54      createIOThread(nat stack_size,  StgClosure *closure) {
(gdb) n
59        t = createThread(stack_size);
..
..
..
428         scheduleThread(tso);
(gdb) n
429         return waitThread(tso, ret);
(gdb) n
waitThread (tso=0x41c0000, ret=0x116b3620) at Schedule.c:2276
2276    {
(gdb) n
2280      m = stgMallocBytes(sizeof(StgMainThread), "waitThread");
(gdb) n
2281      m->tso = tso;
(gdb) n
..
..
..
(gdb) n
2291      main_threads = m;
(gdb) n
2297      stat = waitThread_(m);
(gdb) n
0x1153c0e8 in waitThread ()
Current language:  auto; currently asm
(gdb) s
Single stepping until exit from function waitThread,
which has no line number information.
0x1153b164 in updateStablePtrTable ()
(gdb) n
Single stepping until exit from function updateStablePtrTable,
which has no line number information.

Program received signal SIGSEGV, Segmentation fault.
__decodeFloat (man=0x7fff2d00, exp=0x7fff2d10, flt=66.6666641) at StgPrimFloat.c:250
250             if (sign < 0)
Current language:  auto; currently c
(gdb) quit
The program is running.  Exit anyway? (y or n) y




More information about the Glasgow-haskell-users mailing list