How to debug a segfault.

David Brown haskell2 at davidb.org
Wed Feb 28 11:10:04 EST 2007


Simon Marlow wrote:

> David Brown wrote:
>
>>     0x080b45b8 in s2EI_info ()
>
> Fortunately I wrote a wiki page on just this subject, mainly so that
> I can say RTFM :-)  After reading the FM, if you're still having
> difficulties then post a followup and we'll try to help if we can.
>
>   http://hackage.haskell.org/trac/ghc/wiki/DebuggingGhcCrashes

This looks quite helpful, but still like it is going to be a pain in
the neck.  I did figure a few things out last night.

  - I grepped all of the libraries going into the program, and found
    the s2EI_info defined in libHSbase.o
  - Thanks to the splitting, I un"ar"ed libHSbase.o into individual
    files, and found this label in a file that appears to be the code
    to 'Foreign.C.peekCAString'.  This makes sense with the assembly
    shown.
  - It appears to be trying to dereference a NULL pointer.

I'm going to try the back-in-time approach given to see if I can track
down what is calling this.

I discovered it isn't just x86, but appears to be this particular
machine.  My other machines work fine.  There might be a library
difference between the machines, or something like that.

Thanks,
David



More information about the Glasgow-haskell-users mailing list