|
From: Crispin F. <val...@fl...> - 2003-08-14 15:25:05
|
On Thu, 2003-08-14 at 08:35, Santeri Paavolainen wrote: > Nicholas Nethercote wrote: > > >This all sounds very complicated, for a case that comes up very rarely in > >practice. What do you think of just improving the error message produced > >by VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) so it says something like "you > >changed $VG_ARGS, so Valgrind can't continue", and similar for LD_PRELOAD > >and LD_LIBRARY_PATH? > > > > > I agree, this issue is anyway already covered in the FAQ now and I just > stumbled on it because the program I was testing sanitized the > environmental variables for its children. > > (I was just pointing out that putenv/clearenv/setenv are not the access > point to environmental variables, but the `environ' global variable is, > so if someone feels like patching valgrind, they should watch `environ', > not the individual functions that modify it..) Monitoring the environ variable is not perfect either as you can quite happily call execve directly and pass a brand new environment in. This is presumably all the valgrind sees at the moment (AIUI all the other exec functions are libc wrappers). Wouldn't it be possible for valgrind to realise that the required environment variables aren't present and add them in again, either by mallocing some space for the new env array and the env entries, or by using a few static buffers ? Crispin |