[nhc-bugs] Debugging a segfault

Donald Bruce Stewart dons at cse.unsw.edu.au
Sat Oct 22 22:09:32 EDT 2005


Hey,

I need some help chasing down a segfault in nhc98 1.1{6,8} on OpenBSD/powerpc.
The x86 version runs nicely (after the mmap patch), however both 1.16 and 1.18
die at the following point in the build process:

    cd src/prelude/powerpc-OpenBSD/NHC; gmake clean all     # Patch machine-specific parts.
    gmake[1]: Entering directory `/home/hack/dons/build/nhc98-1.18/src/prelude/powerpc-OpenBSD/NHC'
    rm -f *.hi
    rm -f /home/hack/dons/build/nhc98-1.18/targets/powerpc-OpenBSD/obj/prelude/DErrNo/*.o *.o
    rm -f 
    rm -f 
    /home/hack/dons/build/nhc98-1.18/script/nhc98 -c +CTS -lib  -redefine -CTS   +RTS -H32M -RTS -o /home/hack/dons/build/nhc98-1.18/targets/powerpc-OpenBSD/obj/prelude/DErrNo/DErrNo.o DErrNo.hs
    Segmentation fault (core dumped) 
    Segmentation fault (core dumped) 
    Segmentation fault (core dumped) 
    Segmentation fault (core dumped) 
    gmake[1]: *** [/home/hack/dons/build/nhc98-1.18/targets/powerpc-OpenBSD/obj/prelude/DErrNo/DErrNo.o] Error 1

And we see:
    $ cd /home/hack/dons/build/nhc98-1.18/src/prelude/powerpc-OpenBSD/NHC
    $ ls
    DErrNo.hc           DErrNo.p.c          Makefile            hmake-PRAGMA.core
    DErrNo.hs           DErrNo.z.c          Makefile.inc        nhc98comp.core

nhc98comp.core says:
    (gdb) where
    #0  0x01802224 in ?? ()
    #1  0x01803018 in ?? ()
    Previous frame identical to this frame (corrupt stack?)

Whereas hmake-PRAGMA.core gives us:
    (gdb) where
    #0  0x01801f08 in run ()
    #1  0x01801d68 in main ()

How do I go about debugging this? gdb wasn't particularly revealing. Is there a
way to get debugging symbols compiled in?

-- Don


More information about the Nhc-bugs mailing list