|
From: Dan K. <da...@ke...> - 2009-11-18 20:36:08
|
Using valgrind r10990 with --trace-children=yes, I noticed that sometimes
the environment variables in the client app were
not all there. I managed to track it down a
bit - in coregrind/m_initimg/initimg-linux.c, on entry to
setup_client_env(), on about the fourth time through,
there was an empty environment variable (no name,
no =, no value) inserted after LD_PRELOAD=, i.e.
"LD_PRELOAD="
""
"XAUTHORITY=/home/dank/.Xauthority"
Could the LD_PRELOAD munging in that file have
misbehaved somehow?
- Dan
|
|
From: Dan K. <da...@ke...> - 2009-11-18 21:18:51
|
On Wed, Nov 18, 2009 at 12:36 PM, Dan Kegel <da...@ke...> wrote: > Using valgrind r10990 with --trace-children=yes, I noticed that sometimes > the environment variables in the client app were > not all there. I managed to track it down a > bit - in coregrind/m_initimg/initimg-linux.c, on entry to > setup_client_env(), on about the fourth time through, > there was an empty environment variable (no name, > no =, no value) inserted after LD_PRELOAD=, i.e. > "LD_PRELOAD=" > "" > "XAUTHORITY=/home/dank/.Xauthority" > > Could the LD_PRELOAD munging in that file have > misbehaved somehow? I should mention: this probably wouldn't affect most client apps, but I was running Wine, which processes the environment as a list, and stops when it finds an empty variable. I have a local patch in Wine to skip those, and I'm back in business for now. |
|
From: Madhan S. <mad...@gm...> - 2010-08-12 07:10:53
Attachments:
denv.c
|
This seems to be a valid issue: - Valgrind empties out the variable immediately after LD_PRELOAD - This happens when LD_PRELOAD is not set or is empty before starting the program with valgrind. Please try the attached testcase: valgrind --trace-children=yes denv >& denv.log The test binary forks and execs itself till it can add about 55 environment variables. It sets the environment variable before the exec. Reduce or increase the number 55 based on the number of env vars you already have in your environment. Add 5 to the number of existing variables to arrive at this number. After running, check the output log and watch the variable after LD_PRELOAD. After the second cycle the variable is emptied out. - The code is in coregrind/m_libcproc.c, function mash_colon_env - mash_colon_env does a *varp++ twice when there is a match and while(*varp) overshoots the \0 - confirmed on x86 and AMD64 bit systems with Valgrind 3.5.0. Thanks, Madhan. On Thu, Nov 19, 2009 at 2:48 AM, Dan Kegel <da...@ke...> wrote: > On Wed, Nov 18, 2009 at 12:36 PM, Dan Kegel <da...@ke...> wrote: >> Using valgrind r10990 with --trace-children=yes, I noticed that sometimes >> the environment variables in the client app were >> not all there. I managed to track it down a >> bit - in coregrind/m_initimg/initimg-linux.c, on entry to >> setup_client_env(), on about the fourth time through, >> there was an empty environment variable (no name, >> no =, no value) inserted after LD_PRELOAD=, i.e. >> "LD_PRELOAD=" >> "" >> "XAUTHORITY=/home/dank/.Xauthority" >> >> Could the LD_PRELOAD munging in that file have >> misbehaved somehow? > > I should mention: this probably wouldn't affect most client > apps, but I was running Wine, which processes the environment > as a list, and stops when it finds an empty variable. > I have a local patch in Wine to skip those, and I'm back in > business for now. > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
|
From: Dan K. <da...@ke...> - 2010-08-12 07:15:55
|
On Thu, Aug 12, 2010 at 12:10 AM, Madhan Sadasivam <mad...@gm...> wrote: > This seems to be a valid issue: See https://bugs.kde.org/show_bug.cgi?id=215914 > - confirmed on x86 and AMD64 bit systems with Valgrind 3.5.0. Please check trunk, it should be fixed there if it's the same problem I was hitting. |
|
From: Julian S. <js...@ac...> - 2010-08-12 10:05:02
|
On Thursday, August 12, 2010, Madhan Sadasivam wrote: > This seems to be a valid issue: > [..] > - confirmed on x86 and AMD64 bit systems with Valgrind 3.5.0. As Dan says, this is already fixed in the trunk. Please check out and try it using the directions listed at http://www.valgrind.org/downloads/repository.html J |
|
From: Madhan S. <mad...@gm...> - 2010-08-12 09:32:50
|
Thanks Julian, Dave, I picked the patch from the bug and verified that it indeed addresses the issue. Madhan. 2010/8/12 Julian Seward <js...@ac...>: > On Thursday, August 12, 2010, Madhan Sadasivam wrote: >> This seems to be a valid issue: >> [..] >> - confirmed on x86 and AMD64 bit systems with Valgrind 3.5.0. > > As Dan says, this is already fixed in the trunk. Please check out > and try it using the directions listed at > http://www.valgrind.org/downloads/repository.html > > J > |