[Gc] Valgrind patch

No Itisnt theseaisinhere at gmail.com
Mon Mar 8 12:48:14 PST 2010


As you all know valgrind and libgc don't play nice with eachother. I
believe this is because valgrind modifies the program's address space,
and libgc gets the stack base from the kernel, which is invalid after
valgrind's modifications. The attached patch allows valgrind to run
libgc programs on Linux with pthreads. It does this by using pthread
attributes to get the stack base when the environment variable
'GC_VALGRIND' is set. A more elegant method would be to check
/proc/self/maps for valgrind, but I wanted to get feedback before
writing that. This patch, against CVS, has been tested with Guile
Scheme, and in any case, any problems it may cause can be avoided by
not setting GC_VALGRIND.

Let me know what you think.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: valgrind.patch
Type: application/octet-stream
Size: 1655 bytes
Desc: not available
Url : http://napali.hpl.hp.com/pipermail/gc/attachments/20100308/ddea22e2/valgrind.obj


More information about the Gc mailing list