|
From: Philippe W. <phi...@sk...> - 2012-06-27 19:19:28
|
> > A setuid related problem, maybe? We have had those in the past. Alternatively, it might be an interaction between the subshell fork and the $(...) construct: the subshell will be run under Valgrind; so will output more than it would without Valgrind. If the output of Valgrind (e.g. the error output) is inserted at the $(...), then this might make the arithmetic fail ? If that is the case, it might maybe be avoided using the -q Valgrind arg and/or carefully redirection stderr. Otherwise, more generally, your application might fail under Valgrind and that is not necessarily a bug in Valgrind. E.g. a race condition might only manifest itself under Valgrind. Philippe > > J > > On Wednesday, June 27, 2012, Roland Mainz wrote: >> Hi! >> >> ---- >> >> Does anyone remember any reasons why an application under control of $ >> valgrind --tool=none ... # can fail (valgrind version is 3.7.0)? >> We're seeing the following failures (test script attached as >> "ksh_valgrind_arith_sh_compound_var_arithmetic_failed.sh.txt") with >> recent ksh93 versions and I'm not sure why it even fails with >> "--tool=none" (if I remember it right applications should never fail >> with --tool=none unless it's a valgrind bug... right ?) ... >> >> Steps to reproduce: >> -- snip -- >> $ wget --http-user="I accept www.opensource.org/licenses/eclipse" >> --http-passwd="." >> 'http://www.research.att.com/sw/download/beta/INIT.2012-06-26.tgz' >> $ wget --http-user="I accept www.opensource.org/licenses/eclipse" >> --http-passwd="." >> 'http://www.research.att.com/sw/download/beta/ast-ksh.2012-06-26.tgz' >> $ gunzip -c <INIT.2012-06-26.tgz | tar -xf - >> $ gunzip -c <ast-ksh.2012-06-26.tgz | tar -xf - >> $ CC='gcc -g -ggdb -fno-builtin' ./bin/package make 2>&1 | tee -a >> buildlog.log $ cd arch/*/bin >> $ valgrind --tool=none ./ksh valgr_ksh_cmdsubfail.sh >> ==23175== Nulgrind, the minimal Valgrind tool >> ==23175== Copyright (C) 2002-2011, and GNU GPL'd, by Nicholas Nethercote. >> ==23175== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info >> ==23175== Command: /home/test001/bin/ksh valgr_ksh_cmdsubfail.sh >> ==23175== >> ==23178== >> compound var arithmetic failed, expected '( bar=2 baz=3 foo=1 )', got '' >> ==23179== >> compound var arithmetic failed, expected '( faz=0 )', got '' >> ==23180== >> compound var arithmetic failed, expected '( foz=777 )', got '' >> ==23181== >> compound var arithmetic failed, expected '( foz=777 )', got '' >> ==23182== >> compound var arithmetic failed, expected '( fuz=777 )', got '' >> ==23183== >> compound var arithmetic failed, expected 0, got '' >> ==23184== >> compound var arithmetic failed, expected 0, got '' >> ==23175== >> -- snip -- >> >> Any ideas/clues/etc. would be welcome... >> >> ---- >> >> Bye, >> Roland >> >> ---------- Forwarded message ---------- >> From: Roland Mainz <rol...@nr...> >> Date: Sun, May 27, 2012 at 12:25 AM >> Subject: ast-ksh.2012-05-18 failures in "arith.sh" when under valgrind >> control... >> To: ast...@re... >> >> >> Hi! >> >> ---- >> >> Attached (as "ksh_valgrind_arith_sh_compound_var_arithmetic_failed.sh.txt") >> is a test script (derived from the "arith.sh" test module) which fails >> when running ast-ksh.2012-05-18 on SuSE 12.1/AMD64 under valgrind >> control like this: >> -- snip -- >> $ valgrind --trace-children=yes --log-file=/dev/null ksh xxx.sh >> compound var arithmetic failed, expected '( bar=2 baz=3 foo=1 )', got '' >> compound var arithmetic failed, expected '( faz=0 )', got '' >> compound var arithmetic failed, expected '( foz=777 )', got '' >> compound var arithmetic failed, expected '( foz=777 )', got '' >> compound var arithmetic failed, expected '( fuz=777 )', got '' >> compound var arithmetic failed, expected 0, got '' >> compound var arithmetic failed, expected 0, got '' >> -- snip -- >> Note that "valgrind" does not report any hits... the example uses >> --log-file=/dev/null only to avoid noise in this example. >> >> I assume this is a bug (and not something caused by valgrinds >> interference with fd usage) because if I change the script and >> uncomment the line containing the '#force_subshell_fork="ulimit -c 0"' >> (the use of "ulimit -c 0" in a subshell will trigger a |fork()| to >> make sure this subshell really runs in a seperate process (this is >> neccesary since calls to "ulimit" can't be undone)) the script works. >> >> ---- >> >> Bye, >> Roland >> >> -- >> __ . . __ >> (o.\ \/ /.o) rol...@nr... >> \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer >> /O /==\ O\ TEL +49 641 3992797 >> (;O/ \/ \O;) > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |