rev 12001 has introduced a regression in VG_(env_remove_valgrind_env_stuff):
to avoid modifying a possibly read-only env string, the string is duplicated,
and the copy is modified. However, mash_env_column modifies the string
"in-place". The modified string was not put back in the env (and could not,
because the src string is only partially copied).
This means that the valgrind preload strings were not cleaned up and
when a 32 bit executable execs a 64 bits (or vice versa: 64 bit execs 32 bits),
LD_PRELOAD contains both the 32 bits and 64 bits versions of Valgrind
vgpreload.... => ld.so then gives an error msg, as it can't preload either
the 32 or the 64 bits version.
The patch fixes this by duplicating the whole env string, and passing
to mash_colon_env a pointer to the correct offset in the whole env string.
The duplicated string is replacing the original entry in envp.
This patch adds two regression tests : none/tests/allexec32 and
none/tests/allexec64. On a bi-arch valgrind, these will be 32bits and 64 bits
executables, exec-ing each other. On a single arch, one will be a symlink
to the other (to avoid different .exp files, and still test exec).
Give a better help message for gdbserver when VALGRIND_LIB
is set. This ensures a correct help msg is given when
the valgrind installation is moved, and VALGRIND_LIB is
then set to the new valgrind lib location.
Note it does not improve the help msg when valgrind
is run "in place" (e.g. when using vg-in-place).
(Patch from Paul Pluzhnikov).
Florian Krohm [Sat, 26 Nov 2011 04:12:01 +0000 (04:12 +0000)]
Tweaks for the benefit of the webpage.
- mention s390x/linux in README
- formatting tweak in README.s390 so things don't look ugly in html
- add README.s390 and README.android to distribution documents
Florian Krohm [Sat, 26 Nov 2011 04:05:47 +0000 (04:05 +0000)]
Yesterday I changed dist.authors.html and dist.news.html in r442
in the valgrind-www repository. These files are actually generated
from AUTHORS and NEWS, respectively.
Therefore, change AUTHORS and NEWS to reflect yesterday's change.
Things are now in synch again.
Julian Seward [Sun, 20 Nov 2011 09:35:51 +0000 (09:35 +0000)]
arm-linux: fix signal returning so that if SA_RESTORER is not
specified, the handler returns to the previous context rather than to
whatever value happens to be parked in the link register (duh).
Previous behaviour made complete nonsense of signal returning on
Android.
The sparse wa maintains the nr of elements in use at level 0.
So, replace the code which counts the nr of bits in the level0
bitmap by just returning the nr of elements in use.
To detect calls and returns, Callgrind's heuristic
starts with using the jumpkind got from VEX for
a control flow change instruction. However, for
side exits, it always assumed a (conditional) jump,
which holds true for x86, but e.g. not for ARM.
This fixes Callgrind to use the jumpkind found
by VEX for all exits, which should help making
Callgrind work for ARM. It also moves the check
whether a boring jump is actually a fall-through
to instrumentation time. This changes (fixes) the
result for indirect jumps to the next instruction,
which should not be classified as fall-through
(anyway, this case is probably very rare).
This patch introduces an own enum for jump kinds
in Callgrind. This is less confusing than misusing
the VEX jump kind type, as Callgrinds wants
to distinguish BB fall-throughs from real jumps
(which both are Ijk_Boring in VEX).
Also, setup_bbcc now stores separately whether the
jump kind is conditional or not.
This is the last part of moving from command file polling
to the vgdb ptrace method for interactive control of Callgrind.
VG 3.7.x ported callgrind_control to vgdb (in r11867), but
still did command file polling to support existing KCachegrind
releases. KCachegrind from upcoming KDE SC 4.8 will use
callgrind_control instead of manually writing command files.
The main benefit from this is, apart from getting rid of
continous file polling activity in Callgrind, that blocked
processes can now respond to callgrind_control.
Julian Seward [Tue, 8 Nov 2011 19:32:57 +0000 (19:32 +0000)]
When doing instrumentation, pay attention to the Ist.IMark.delta
fields. This makes the --ct-verbose=1 output make a lot more sense
for Thumb code. Should have no effect on any other platform.
Florian Krohm [Fri, 28 Oct 2011 21:37:19 +0000 (21:37 +0000)]
Fix the configure test for ssse3 support. GCC needs -msse or it
will reject the xmm7 clobber in the code snippet.
Fix the prereqs for the ssse3 tests. It is possible that hardware
supports ssse3 but the tool chain does not. So we need to have the
testcase executable as a prerequisite.
Florian Krohm [Fri, 28 Oct 2011 02:45:15 +0000 (02:45 +0000)]
Don't get the date of the build from the mail header. It is
often off-by one. Instead extract it from the message body,
namely, when the build was kicked off.
Florian Krohm [Fri, 28 Oct 2011 00:11:44 +0000 (00:11 +0000)]
Rewrite test to not use function clock_gettime. The purpose
of this is to not have to link against -lrt because that causes
a different back-trace on certain x86 and s390x environments.
See the thread with subject
"helgrind/tests/cond_timedwait_invalid failing on x86"
on valgrind-developers for more details.
Florian Krohm [Wed, 26 Oct 2011 15:27:41 +0000 (15:27 +0000)]
Give function copy_input_until_stop the noinline atribute.
At least one of the compilers for s390x nightly builds was inlining it.
Update exp files accoordingly. This should fix any residual back-trace
noise for this testcase.
Julian Seward [Wed, 26 Oct 2011 15:10:49 +0000 (15:10 +0000)]
Some fixes for Android:
* initial support for Pandaboard/Linaro
* on Android/ARM, ask for non-executable stacks in the executables
* disable Memcheck's strcasestr intercept; its use of tolower()
causes the dynamic linker to fail.
Julian Seward [Wed, 26 Oct 2011 15:07:56 +0000 (15:07 +0000)]
Disable the GDB server-by-default for the time being on Android, since
the mknod operations fail. It can still be used if you can get past
that point, but you need an explicit --vgdb=yes for the time being.
Julian Seward [Mon, 24 Oct 2011 13:21:57 +0000 (13:21 +0000)]
Fix #284384 (clang 3.1 -Wunused-value warnings in valgrind.h,
memcheck.h) by changing a bunch of VALGRIND_DO_CLIENT_REQUEST_EXPR
into VALGRIND_DO_CLIENT_REQUEST_STMT for cases where the return value
of the former would be unused. (Bart Van Assche, bart.vanassche@gmail.com)
Julian Seward [Mon, 24 Oct 2011 08:53:03 +0000 (08:53 +0000)]
Don't break fcntl locks when program does mmap. #280965.
(Rusty Russell, rusty@rustcorp.com.au)
tdb uses fcntl locks and mmap, and some of the tests fail under valgrind.
strace showed valgrind opening the tdb file, reading 1024 bytes, then closing
it. This is not allowed: POSIX says if you open and close a file, all fcntl
locks on it are dropped (insane, yes).
Finally got around to hacking the source to track this down: di_notify_mmap is
doing the damage. The simplest fix was to hand in an optional fd for it to
use, then have it do pread.
I had to fix your pread; surely this should seek back even if the platform
doesn't have pread support?
Julian Seward [Mon, 24 Oct 2011 07:36:57 +0000 (07:36 +0000)]
gdbsrv: factorize gdb version handling, fix doc and typos
* fix various typos in doc
* following commit in gdb
http://sourceware.org/ml/gdb-patches/2011-07/msg00742.html
means unlimited length for valgrind watchpoints is understood by the
(future) gdb 7.4 => doc updated
* factorize gdb version detection and reporting in
gdbserver_tests/make_local_links
* replace zignal by signal in a string used in umsg.
* updated gdbserver_tests/README_DEVELOPPERS (ref to --port vgdb option)
No functional change, tested on f12/x86, debian5/amd64, s390/RHEL4
Julian Seward [Mon, 24 Oct 2011 05:59:54 +0000 (05:59 +0000)]
Change the behaviour of VALGRIND_CHECK_MEM_IS_DEFINED slightly, so
that if the range is partially non-addressable and it contains
undefined data, both errors are reported.
Julian Seward [Sat, 22 Oct 2011 20:38:08 +0000 (20:38 +0000)]
Make vgdb.c work on Android, so that the GDB server as a whole
will work on Android. Fixes #283600.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)
This patch provides three improvements in the way the free list is
handled in memcheck.
First improvement: a new command line option --freelist-big-blocks
(default 1000000) specifies the size of "free list big blocks".
Such big blocks will be put on the free list, but will be re-cycled first
(i.e. in preference to block having a smaller size).
This fixes the bug https://bugs.kde.org/show_bug.cgi?id=250065.
Technically, the freed list is divided in two lists : small
and big blocks. Blocks are first released from the big block list.
Second improvement: the blocks of the freed list are re-cycled before
a new block is malloc-ed, not after a block is freed.
This gives better error messages for dangling pointer errors
when doing many frees without doing malloc between the frees.
(this does not uses more memory).
Third improvement: a block bigger than the free list volume will be
put in the free list (till a malloc is done, so as the needed memory
is not bigger than before) but will be put at the beginning of the
free list, rather than at the end. So, allocating then freeing such a
block does not cause any blocks in the free list to be released.
Results of the improvements above, with the new regression test
memcheck/test/big_blocks_freed_list: with the patch, 7 errors
are detected, 6 are giving the (correct) allocation stack.
Without the patch, only 6 errors are detected, 5 errors without
allocation stack, 1 with a (wrong) allocation stack.
Julian Seward [Sat, 22 Oct 2011 19:29:51 +0000 (19:29 +0000)]
Allow garbage collection of the LAOG data structure(s). This avoids
quadratic growth on some apparently simple test cases. Fixes #267925.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)
Bart Van Assche [Sat, 22 Oct 2011 14:38:47 +0000 (14:38 +0000)]
Revert r12195 because it triggers suspicious error messages on systems where
libtool has not been installed:
Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 196.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 196.