Some questions about GHC source code and wiki
marlowsd at gmail.com
Tue Jun 22 04:16:09 EDT 2010
On 18/06/2010 22:22, Marco Túlio Gontijo e Silva wrote:
> Hi Simon.
> Excerpts from Simon Marlow's message of Qua Jun 09 11:55:05 -0300 2010:
>> Now would be a good time to get acquainted with using gdb for debugging
>> the GC. You'll need it eventually anyway!
> Thanks for the tip. I haven't started with it before because I thought it was
> unnecessary, because I can obtain the same information with print commands. I
> still think like this, but after using it for a while after your suggestion,
> it's indeed sometimes much better.
> I'm doing this for more than a week now, stoping sometimes to do other things
> as described in my weblog. I plan to keep going on debugging, but maybe
> I'm missing something obvious for a someone looking from outside, so help is
> welcome in this.
I'm afraid I can't help with finding the specific bug(s) you're looking
for, but I can help with using gdb. Hopefully you've seen this page:
which has lots of good tips (not all relevant to you, but some are).
If you have a segmentation fault, the place to start looking is where
the fault happened: what was wrong? If the heap or stack contained some
invalid data, you need to find out how it got there, so the next step is
to move backward in time - one easy way to do that with the GC is to set
a breakpoint on the *previous* GC and have a look at the same heap
structures. If the structure got corrupted sometime between the start
of one GC and the next, set a watchpoint on the memory location to find
out when it gets modified.
Use the sanity checker (rts/sm/Sanity.c, turned on with +RTS -DS). Add
some code to the sanity checker to check your new data structures.
> 0: http://marcotmarcot.wordpress.com/2010/06/15/summer-of-code-weekly-report-5/
> 1: http://marcotmarcot.wordpress.com/2010/06/18/immix-on-ghc-summer-of-code-weekly-report-6/
Thanks for the updates!
> Cvs-ghc mailing list
> Cvs-ghc at haskell.org
More information about the Cvs-ghc