On 09/06/2010 14:45, Marco Túlio Gontijo e Silva wrote:
Hi.
I'm replying to myself, since I'm stuck for some days in the same thing, and I
thought that asking may help me move on. By the way, have you received my last
e-mail? I'm asking because I could not see it correctly in
http://www.haskell.org/pipermail/cvs-ghc/2010-June/054293.html .
Excerpts from Marco Túlio Gontijo e Silva's message of Sex Jun 04 22:46:27
-0300 2010:
(...)
I'm currently studying the allocation part of the code, in alloc_for_copy
from Evac.c
In addition to the changes I've described in my last blog post[0], I've made
this change to alloc_for_copy:
if (gen< gct->evac_gen) {
if (gct->eager_promotion) {
gen = gct->evac_gen;
} else {
gct->failed_to_evac = rtsTrue;
}
}
+ if(size<= BITS_IN(W_)&& gen->first_line != NULL) {
+ to = gen->first_line;
+ gen->first_line = (StgPtr) *gen->first_line;
+ return to;
+ }
+
Sorry for the delay, we've had mailing list outages with haskell.org.
Well, there's a few things wrong here. I can't immediately tell what's
causing the crash, but we want to do things a bit differently here anyway.
I think we should set ws->todo_free and ws->todo_lim to point to the
current line(s) being allocated into, and instead of checking for an
object being small enough, check for an object being too big. That way
we'll be able to allocate more than one object per line, whereas your
code above only gets one object into each line.
This gave me all sorts of errors, from segfaults to corruption of values in the
program. I've tried changing some parameters to find out a fix, without
success. I tried using size == BITS_IN(W_) and small sizes like size<= 2. I
also tried to check the type of the evacuated object to find a correlation
between this and a specific object type, and found nothing. I tried using only
one free line for each generation, and got the same problem.
Notice I can write 0 in all the area reserved for free lines, with this code:
// StgPtr start;
// for(start = gen->first_line; start< gen->first_line + BITS_IN(W_);
start++)
// *start = 0;
without problems. The problem only happens when I return a pointer to a free
line in alloc_for_copy.
Any help is apreciated. Thanks in advance.
Now would be a good time to get acquainted with using gdb for debugging
the GC. You'll need it eventually anyway!
Cheers,
Simon
0: http://marcotmarcot.wordpress.com/2010/06/04/summer-of-code-weekly-report-4/
(...)
_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc
_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc