guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Valgrind fix


From: No Itisnt
Subject: RE: Valgrind fix
Date: Mon, 8 Mar 2010 12:49:48 -0600

Here's a program that demonstrates the actual issue at hand.
Basically, libgc finds the stack address from either glibc or the
kernel, which is not what it wants because valgrind messes with the
address space of the host program. This is only on Linux, but I
understand the issue is similar on other BSD systems.

This is the Mono file that contains some workarounds (specifically
mono/metadata/boehm-gc.c:mono_gc_base_init) . Contrary to the comments
in the file the issue does not appear to be thread-related, although
it is solved using pthread functionality.

http://anonsvn.mono-project.com/viewvc/trunk/mono/mono/metadata/boehm-gc.c?view=log

The attached program grabs the stack address from the kernel, glibc,
and by taking the address of a stack object, then prints the
difference. When run normally, the differences are minimal, but when
run under valgrind, there is a giant difference between the base of
the actual program and the base given by the kernel.

Ideally, this would be patched in libgc, but we'd need a way to detect
whether the program is running under valgrind and the current
workaround would only work for threaded versions. I'm going to take a
crack at libgc CVS later on.

Attachment: demo.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]