[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    valgrind/coregrind
From:       Jeremy Fitzhardinge <jeremy () goop ! org>
Date:       2004-01-04 23:53:00
Message-ID: 20040104235300.5C47593D3 () office ! kde ! org
[Download RAW message or body]

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.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic