|
From: Jeremy F. <je...@go...> - 2004-01-04 23:53:29
|
CVS commit by fitzhardinge:
Fix problem with trace-children=yes when using a tool which replaces
malloc. The problem was that LD_PRELOAD was being left set with
our replacement .so files, which meant they were being applied to
stage1/stage2. This caused malloc to fail and a subsequent SIGSEGV.
This change unconditionally removes all of Valgrind's special environment
before each execve, since it will be replaced as needed by the child
Valgrind.
M +7 -3 vg_syscalls.c 1.75
--- valgrind/coregrind/vg_syscalls.c #1.74:1.75
@@ -1768,7 +1768,9 @@ PRE(execve)
VG_(nuke_all_threads_except)( VG_INVALID_THREADID );
- if (!VG_(clo_trace_children)) {
+ {
/* Make the LD_LIBRARY_PATH/LD_PRELOAD disappear so that the
- child doesn't get our libpthread and other stuff */
+ child doesn't get our libpthread and other stuff. This is
+ done unconditionally, since if we are tracing the child,
+ stage1/2 will set up the appropriate client environment. */
Int i;
Char** envp = (Char**)arg3;
@@ -1801,5 +1803,7 @@ PRE(execve)
/* XXX if variable becomes empty, remove it completely? */
}
- } else {
+ }
+
+ if (VG_(clo_trace_children)) {
/* If we're tracing the children, then we need to start it
with our starter+arguments.
|