]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
13 years agoFormat functions: change format specifier %t into %pS. Remove the _no_f_c formatting...
Bart Van Assche [Thu, 6 Oct 2011 19:08:37 +0000 (19:08 +0000)] 
Format functions: change format specifier %t into %pS. Remove the _no_f_c formatting function variants.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12108

13 years agohelgrind/tests/pth_barrier*: Update expected output after drd/tests/pth_barrier.c...
Bart Van Assche [Thu, 6 Oct 2011 06:39:02 +0000 (06:39 +0000)] 
helgrind/tests/pth_barrier*: Update expected output after drd/tests/pth_barrier.c changes

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12107

13 years agoDeclare _exit as "noreturn". This will avoid a GCC warning.
Florian Krohm [Wed, 5 Oct 2011 14:51:55 +0000 (14:51 +0000)] 
Declare _exit as "noreturn". This will avoid a GCC warning.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12106

13 years agoFix GCC warnings about incompatible pointer assignments.
Florian Krohm [Wed, 5 Oct 2011 14:49:12 +0000 (14:49 +0000)] 
Fix GCC warnings about incompatible pointer assignments.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12105

13 years agoDeclare _exit as "noreturn". This will avoid a GCC warning.
Florian Krohm [Wed, 5 Oct 2011 14:36:00 +0000 (14:36 +0000)] 
Declare _exit as "noreturn". This will avoid a GCC warning.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12104

13 years agodrd, s390: Make the annotate_ignore_* and the pth_barrier* tests produce
Bart Van Assche [Wed, 5 Oct 2011 13:10:30 +0000 (13:10 +0000)] 
drd, s390: Make the annotate_ignore_* and the pth_barrier* tests produce
the same output on s390 as on other systems (not tested yet).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12103

13 years agoMore fixes for unaligned accesses in the debuginfo code. BZ#282527.
Tom Hughes [Wed, 5 Oct 2011 08:48:07 +0000 (08:48 +0000)] 
More fixes for unaligned accesses in the debuginfo code. BZ#282527.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12102

13 years agoppc64-linux only: fix incorrect line number reports in client requests
Julian Seward [Wed, 5 Oct 2011 07:39:07 +0000 (07:39 +0000)] 
ppc64-linux only: fix incorrect line number reports in client requests
that create stack traces.  Fixes #283243.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12101

13 years agoAttempt to unbreak this testcase on systems with GCC 4.5.1 and newer.
Florian Krohm [Wed, 5 Oct 2011 03:29:57 +0000 (03:29 +0000)] 
Attempt to unbreak this testcase on systems with GCC 4.5.1 and newer.
I suspect the breakage is related to GCC's debug info.
Replace initialization with explicit assignment statement.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12100

13 years agoChange the filter order. Filename base backtrace filtering
Florian Krohm [Wed, 5 Oct 2011 03:09:01 +0000 (03:09 +0000)] 
Change the filter order. Filename base backtrace filtering
must come first before the filename gets changed to bogus.S
This should unbreak the failure on x86_64. But I can't test it.
We shall see.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12099

13 years agoUpdate exp files for memcheck's supp_unknown testcase.
Florian Krohm [Wed, 5 Oct 2011 02:34:33 +0000 (02:34 +0000)] 
Update exp files for memcheck's supp_unknown testcase.
Promote the s390x exp file to be the golden one because it has the
correct result. Add an exp-kfail file for those platforms where the testcase
fails (x86).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12098

13 years agoRewrite badjump and badjump2 such that the error occurs now on the
Florian Krohm [Tue, 4 Oct 2011 20:14:59 +0000 (20:14 +0000)] 
Rewrite badjump and badjump2 such that the error occurs now on the
same line for all architectures.
Promote the s390x exp file to be the golden one because it has the
correct result. Add exp-kfail files for those platforms where the testcases
fail (x86).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12097

13 years agoChange the nightly script to gather information about the run
Florian Krohm [Tue, 4 Oct 2011 16:53:34 +0000 (16:53 +0000)] 
Change the nightly script to gather information about the run
and its environment.
Simplify z900.sendmail accordingly.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12096

13 years agoHelgrind and exp-sgcheck, XML error reporting: move the code printing <kind>...<...
Bart Van Assche [Tue, 4 Oct 2011 16:28:42 +0000 (16:28 +0000)] 
Helgrind and exp-sgcheck, XML error reporting: move the code printing <kind>...</kind> out of a switch statement.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12095

13 years agoFix execve2 testcase.
Florian Krohm [Tue, 4 Oct 2011 03:55:04 +0000 (03:55 +0000)] 
Fix execve2 testcase.
First, due to a typo in Makefile.am it was compiled with the wrong flags.
Secondly, the testcase gives an incorrect backtrace on x86 (missing the
line where the error occurs). Updated the generic exp to contain the
correct result and added exp-kfail for platforms where this test fails.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12094

13 years agoTurns out there is at least one version of glibc tat contains
Florian Krohm [Tue, 4 Oct 2011 03:33:59 +0000 (03:33 +0000)] 
Turns out there is at least one version of glibc tat contains
a file name writev.c. This screws our filename based backtrace
filtering. Rename writev to writev1 to avoid that problem.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12093

13 years agoThe testcases execve1 and fwrite actually fail on x86 in the sense that
Florian Krohm [Tue, 4 Oct 2011 03:15:38 +0000 (03:15 +0000)] 
The testcases execve1 and fwrite actually fail on x86 in the sense that
they produce an incomplete backtrace. Added exp-kfail files to capture the
results with the incomplete backtraces. Updated the generic exp files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12092

13 years agoImprove filtering of backtrace noise in the memcheck bucket
Florian Krohm [Mon, 3 Oct 2011 23:39:54 +0000 (23:39 +0000)] 
Improve filtering of backtrace noise in the memcheck bucket
and update exp files accordingly. This works well for x86
and all testcases pass on my machine.
New file filter_memcheck to do the work.
There is a bit of a ripple here as filter_memcheck requires
command line arguments to be passed in. So all users of
filter_memcheck (direct or indirect) were updated as well.
filter_stderr was simplified as was filter_libc.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12091

13 years agoRename testcase from execve to execve1.
Florian Krohm [Mon, 3 Oct 2011 23:05:56 +0000 (23:05 +0000)] 
Rename testcase from execve to execve1.
The reason is that the point of failure is in glibc
in a file named execve.c  The backtrace filtering
(which is filename based) cannot distinguish the
two execve.c file names. Renaming the testcsae does the
trick.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12090

13 years agoFix another read_UInt that should be read_Addr.
Tom Hughes [Mon, 3 Oct 2011 17:01:57 +0000 (17:01 +0000)] 
Fix another read_UInt that should be read_Addr.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12089

13 years agoUpdate names of vgdb pipes in documentation. Followup to r12071.
Florian Krohm [Mon, 3 Oct 2011 16:55:26 +0000 (16:55 +0000)] 
Update names of vgdb pipes in documentation. Followup to r12071.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12088

13 years agoLimit number of backtrace frames to 3 so as to avoid junk frames.
Julian Seward [Mon, 3 Oct 2011 16:15:16 +0000 (16:15 +0000)] 
Limit number of backtrace frames to 3 so as to avoid junk frames.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12087

13 years agoFix multiple problems with this test:
Julian Seward [Mon, 3 Oct 2011 16:10:45 +0000 (16:10 +0000)] 
Fix multiple problems with this test:

* when creating threads, just ask for a 256k stack size, since creating
  498 threads each with the default 8M stack size fails on 32 bit machines.

* limit number of callers to 3 so as to remove junk frames that cause
  different output on 32 vs 64 bit targets.

* add a proper self-check at the end, to verify the number of detected errors
  is as expected

* update output accordingly

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12086

13 years agoAlso parse stdoutB_filter_args and stderrB_filter_args.
Florian Krohm [Mon, 3 Oct 2011 00:19:05 +0000 (00:19 +0000)] 
Also parse stdoutB_filter_args and stderrB_filter_args.
Forgot to do that in r12045.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12085

13 years agoAdd read_Addr and use it so that we work on systems where an address
Tom Hughes [Sun, 2 Oct 2011 12:12:38 +0000 (12:12 +0000)] 
Add read_Addr and use it so that we work on systems where an address
is bigger that an int.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12084

13 years agoAvoid using direct access to read multi-byte values from DWARF files
Tom Hughes [Sun, 2 Oct 2011 10:49:35 +0000 (10:49 +0000)] 
Avoid using direct access to read multi-byte values from DWARF files
and use read_Type routines instead as they work rather better on strict
aligned (or semi-strict a la ARM) machines. Fixes #282527.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12083

13 years agoUse read_UInt to get the CRC as it may not be aligned. Fixes #283154.
Tom Hughes [Sun, 2 Oct 2011 10:22:08 +0000 (10:22 +0000)] 
Use read_UInt to get the CRC as it may not be aligned. Fixes #283154.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12082

13 years agoMove read_<type> routines from readdwarf.c to be module level
Tom Hughes [Sun, 2 Oct 2011 10:20:12 +0000 (10:20 +0000)] 
Move read_<type> routines from readdwarf.c to be module level
routines in misc.c so that other parts of the debuginfo module
can access them.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12081

13 years agoUpdate for x86.
Florian Krohm [Sun, 2 Oct 2011 03:06:39 +0000 (03:06 +0000)] 
Update for x86.
r8744 gave mainSort the "noinline" attribute, thereby changing
the backtrace. Nox fixed.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12080

13 years agoAdd exp file for x86. This test is known to fail on that platform
Florian Krohm [Sun, 2 Oct 2011 00:38:22 +0000 (00:38 +0000)] 
Add exp file for x86. This test is known to fail on that platform
by omitting a frame in the backtrace. Hence, the "kfail" in the
file name.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12079

13 years agoUpdate for x86. This should have happened in r11741 which
Florian Krohm [Sun, 2 Oct 2011 00:18:29 +0000 (00:18 +0000)] 
Update for x86. This should have happened in r11741 which
changed the message format.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12078

13 years agoChange the filtering of helgrind's XML output.
Florian Krohm [Sat, 1 Oct 2011 21:07:32 +0000 (21:07 +0000)] 
Change the filtering of helgrind's XML output.
New file helgrind/tests/filter_xml.
Update expected result for tc06_two_races_xml.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12077

13 years agoUpdate re OSX 10.7.
Julian Seward [Fri, 30 Sep 2011 17:55:13 +0000 (17:55 +0000)] 
Update re OSX 10.7.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12076

13 years ago* (marginally) fix debug printing for new 10.7 syscalls
Julian Seward [Fri, 30 Sep 2011 17:51:21 +0000 (17:51 +0000)] 
* (marginally) fix debug printing for new 10.7 syscalls
* also, remove SfMayBlock annotations for those that obviously won't

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12075

13 years agoFix a couple of buffer overruns. n-i-bz.
Julian Seward [Fri, 30 Sep 2011 07:11:13 +0000 (07:11 +0000)] 
Fix a couple of buffer overruns.  n-i-bz.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12074

13 years agoMake wqthread_hijack not assert on x86-darwin. Same hack as
Julian Seward [Fri, 30 Sep 2011 07:05:17 +0000 (07:05 +0000)] 
Make wqthread_hijack not assert on x86-darwin.  Same hack as
for the 64-bit case.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12073

13 years agoUse <sys/mman.h> instead of <linux/mman.h> to fix a compile problem
Florian Krohm [Fri, 30 Sep 2011 01:27:26 +0000 (01:27 +0000)] 
Use <sys/mman.h> instead of <linux/mman.h> to fix a compile problem
on SLES 10.  Patch by Rich Coe (rcoe@wi.rr.com). Fixes bugzilla #282238.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12072

13 years agoChange the name of the pipes for vgdb by adding username and hostname.
Florian Krohm [Thu, 29 Sep 2011 21:20:49 +0000 (21:20 +0000)] 
Change the name of the pipes for vgdb by adding username and hostname.
Those are obtained by looking at some commonly defined environment
variables.
That should help with problems where /tmp is shared or process IDs get
recycled. We had some intermittent nightly build issues because of that.
Partial fix for bugzilla #280757.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12071

13 years agoMake {amd64,x86}-darwin use the direct implementations of
Julian Seward [Thu, 29 Sep 2011 18:29:41 +0000 (18:29 +0000)] 
Make {amd64,x86}-darwin use the direct implementations of
VG_MINIMAL_SETJMP and VG_MINIMAL_LONGJMP introduced in r12067.

With this commit, it should be possible to build a working 64 bit
Valgrind using the default gcc as supplied with Xcode 4.1 on OSX 10.7.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12070

13 years agoUn-break the compiler version check on Darwin (introduced by r12066)
Julian Seward [Thu, 29 Sep 2011 18:18:37 +0000 (18:18 +0000)] 
Un-break the compiler version check on Darwin (introduced by r12066)
without (hopefully) breaking it on any other platform.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12069

13 years agoBe a bit more careful about the return type for VG_MINIMAL_SETJMP,
Julian Seward [Thu, 29 Sep 2011 17:34:17 +0000 (17:34 +0000)] 
Be a bit more careful about the return type for VG_MINIMAL_SETJMP,
both the home-grown versions and the versions that feed through to
__builtin_setjmp.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12068

13 years agox86-linux, amd64-linux: Implement VG_MINIMAL_SETJMP and
Julian Seward [Thu, 29 Sep 2011 17:33:58 +0000 (17:33 +0000)] 
x86-linux, amd64-linux: Implement VG_MINIMAL_SETJMP and
VG_MINIMAL_LONGJMP directly, rather than using __builtin_setjmp
and __builtin_longjmp, since clang-2.9 miscompiles the latter
(by completely ignoring it.)

Also, add comment about the return type for VG_MINIMAL_SETJMP.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12067

13 years agoAccept clang-2.9 as an allowable compiler.
Julian Seward [Thu, 29 Sep 2011 17:30:13 +0000 (17:30 +0000)] 
Accept clang-2.9 as an allowable compiler.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12066

13 years agoCompile everything with -fno-builtin, so as to disable LLVM's
Julian Seward [Thu, 29 Sep 2011 17:29:53 +0000 (17:29 +0000)] 
Compile everything with -fno-builtin, so as to disable LLVM's
idiom-recognition optimisation.  This identifies memset-style
loops and turns them into calls to memset, which in this case
leads to infinite recursion because it does this transformations
in VG_(memset), which is called from memset(), which we also define.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12065

13 years agoFix a regression (none/tests/cmdline[12]) which was introduced
Florian Krohm [Thu, 29 Sep 2011 14:26:38 +0000 (14:26 +0000)] 
Fix a regression (none/tests/cmdline[12]) which was introduced
by r12063.
VG_(clo_vgdb_prefix) was used before it was initialized.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12064

13 years agoRemove hardwired /tmp directory in vgdb. Honour VG_TMPDIR
Florian Krohm [Thu, 29 Sep 2011 03:03:45 +0000 (03:03 +0000)] 
Remove hardwired /tmp directory in vgdb. Honour VG_TMPDIR
and TMPDIR which was introduced when fixing bugzilla #267020.
Factor out VG_(tmpdir). New function VG_(vgdb_path_prefix).
Partially fixes bugzilla #280757.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12063

13 years agoFix a NULL pointer dereference issue spotted by IBM's BEAM checker.
Florian Krohm [Wed, 28 Sep 2011 17:43:44 +0000 (17:43 +0000)] 
Fix a NULL pointer dereference issue spotted by IBM's BEAM checker.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12062

13 years agoUpdate how-to-build documentation.
Julian Seward [Tue, 27 Sep 2011 11:54:01 +0000 (11:54 +0000)] 
Update how-to-build documentation.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12061

13 years agoAdd support for hardware-specific ioctl wrappers on Android,
Julian Seward [Tue, 27 Sep 2011 11:40:24 +0000 (11:40 +0000)] 
Add support for hardware-specific ioctl wrappers on Android,
starting with those required for the graphics hardware on
Nexus S.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12060

13 years agoAndroid: add wrappers for ashmem and binder ioctls. From the AOSP
Julian Seward [Tue, 27 Sep 2011 10:26:52 +0000 (10:26 +0000)] 
Android: add wrappers for ashmem and binder ioctls.  From the AOSP
port of Valgrind.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12059

13 years agoUn-break debuginfo image finding on non-Android Linuxes following
Julian Seward [Tue, 27 Sep 2011 10:24:52 +0000 (10:24 +0000)] 
Un-break debuginfo image finding on non-Android Linuxes following
r12057, duh.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12058

13 years agoAdd a facility for ad-hoc location of debuginfo files on Android.
Julian Seward [Tue, 27 Sep 2011 09:26:39 +0000 (09:26 +0000)] 
Add a facility for ad-hoc location of debuginfo files on Android.
All other platforms are unaffected.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12057

13 years agoML_(read_elf_debug_info): (no functional change, I hope): fix up
Julian Seward [Tue, 27 Sep 2011 08:57:41 +0000 (08:57 +0000)] 
ML_(read_elf_debug_info): (no functional change, I hope): fix up
confusing control flow, by separating the logic for "is there a
debuginfo file to be found?" from that of "if a debuginfo file was
found, let's record certain facts (section offsets etc) about it."

This makes it possible to add arbitrary other schemes for finding
debuginfo files without further complicating the existing control flow.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12056

13 years agoAndroid only: don't ignore zero-sized symbols, since some of them
Julian Seward [Tue, 27 Sep 2011 08:06:14 +0000 (08:06 +0000)] 
Android only: don't ignore zero-sized symbols, since some of them
are ones that m_redir really needs to see.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12055

13 years agoarm_linux_android: intercept __dl_strcmp and __dl_strlen in
Julian Seward [Mon, 26 Sep 2011 20:20:19 +0000 (20:20 +0000)] 
arm_linux_android: intercept __dl_strcmp and __dl_strlen in
/system/bin/linker, for the usual reason.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12054

13 years agoInitial suppressions from Android 2.3.5 (on ARM).
Julian Seward [Mon, 26 Sep 2011 20:18:29 +0000 (20:18 +0000)] 
Initial suppressions from Android 2.3.5 (on ARM).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12053

13 years agoHeap profiler: reduce threshold at which a new profile is shown for
Julian Seward [Mon, 26 Sep 2011 20:17:41 +0000 (20:17 +0000)] 
Heap profiler: reduce threshold at which a new profile is shown for
an arena from 10% to 5%.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12052

13 years agoPretty up the debugging hack that allows printing of stack traces
Julian Seward [Mon, 26 Sep 2011 20:16:15 +0000 (20:16 +0000)] 
Pretty up the debugging hack that allows printing of stack traces
for selected syscalls.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12051

13 years agoRe-enable the use of loctab (line number table) trimming, for a 5% to
Julian Seward [Mon, 26 Sep 2011 20:15:07 +0000 (20:15 +0000)] 
Re-enable the use of loctab (line number table) trimming, for a 5% to
10% reduction in debuginfo storage requirements for large applications
on 32 bit platforms.  This code had been present since the MacOSX port
was merged but had been disabled.  Remove equivalent code for
shrinking the symbol tables since they are much (4 x) smaller than the
line number tables, trimming them is hardly worth the effort.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12050

13 years agorun_a_thread_NORETURN: add trashed-register annotations for the magic
Julian Seward [Mon, 26 Sep 2011 17:50:46 +0000 (17:50 +0000)] 
run_a_thread_NORETURN: add trashed-register annotations for the magic
bits of assembly which finally cause the thread to exit.  How this
ever worked before, on any platform, beats me.  The lack was causing
some Android builds to segfault at thread exit.  Only the s390 version
was correct.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12049

13 years agoPrint a slightly less useless failure message if VG_(mkstemp) fails to
Julian Seward [Mon, 26 Sep 2011 16:46:04 +0000 (16:46 +0000)] 
Print a slightly less useless failure message if VG_(mkstemp) fails to
create a temp file, as often happens on Android.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12048

13 years agom_mallocfree.c: generalise 'reclaimSuperBlock' to also reclaim
Julian Seward [Mon, 26 Sep 2011 11:28:20 +0000 (11:28 +0000)] 
m_mallocfree.c: generalise 'reclaimSuperBlock' to also reclaim
splittable superblocks.  Bug #282105.

(Philippe Waroquiers, philippe.waroquiers@skynet.be)

A previous patch (bug 250101) introduced the concept of reclaimable
superblock: a superblock that cannot be splitted in smaller blocks
and that can be munmapped.

This patch generalises the reclaimable concept : all superblocks are
now reclaimable. To reduce fragmentation, big superblocks are still
kept unsplittable.

The patch has 4 aspects:
1 The previous concept of 'reclaimable superblock' is renamed
  'unsplittable superblock' (this is a mechanical change).
2 Ensure that splittable blocks can be reclaimed :
  After each free, if the free results in a merged block which
  completely covers the superblock, then the superblock can be reclaimed.
3 If a superblock is reclaimed and there exists some translations
  for this superblock then discard the translations.
  Note : I did not understand the comment speaking about
  circular dependency. Just calling VG_(discard_translations) seems
  to cause no problem. As m_transtab.c does not allocate client memory,
  I believe no circular (dynamic) dependency can be done.
4 Activate 'unsplittable superblock' for all arenas.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12047

13 years agoMake filter_helgrind executable. Should unbreak the build.
Florian Krohm [Mon, 26 Sep 2011 04:35:45 +0000 (04:35 +0000)] 
Make filter_helgrind executable. Should unbreak the build.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12046

13 years agoChange the backtrace filtering machinery for the helgrind regression
Florian Krohm [Mon, 26 Sep 2011 00:29:44 +0000 (00:29 +0000)] 
Change the backtrace filtering machinery for the helgrind regression
bucket. Instead of removing what we don't want to see in a backtrace
(e.g. path segments through libc and libpthread), we simply keep what
we do want to see. That way .exp files can be generic.
We need to make sure that GCC inlining does not get in the way. So all
the ..._WRK function in hg_intercepts.c are attributed as noinline.
The backtrace filtering is done in the new filter_helgrind script.
filter_stderr is simplified quite a bit.
Fixes bug #281468. See also the comments #5 and #6 there.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12045

13 years agoRemove code duplication from the dispatchers. Keep the core loop
Florian Krohm [Sun, 25 Sep 2011 00:15:54 +0000 (00:15 +0000)] 
Remove code duplication from the dispatchers. Keep the core loop
in common.
To accomplish that without penalizing the non-profiling dispatcher
we do the stats gathering *after* the jitted code returns to the
dispatcher. For that to work properly, we need to stash away the
instruction adddress before entering the jitted code so we can use
it later. (See also VEX r2208).

Two other tweaks are included here:
(1) For the non-profiling dispatcher it is not necessary to update
    the LR in each iteration. Quite obviously the jitted code cannot
    modify the LR in its iteration because it needs it at the very end
    when it returns. So we move this step out of the core loop.
(2) Move loading the address of VG_(tt_fast) past testing for a changed
    guest state pointer.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12044

13 years agoAdd initial support for Mac OS X 10.7 (Lion). Tracked by bug #275168.
Julian Seward [Wed, 21 Sep 2011 08:43:08 +0000 (08:43 +0000)] 
Add initial support for Mac OS X 10.7 (Lion).  Tracked by bug #275168.

* configure.in support

* new supp file darwin11.supp

* comment out many intercepts in mc_replace_strmem.c and
  vg_replace_malloc.c that are apparently unnecessary for Darwin

* add minimal handling for the following new syscalls and mach traps:
    mach_port_set_context
    task_get_exception_ports
    getaudit_addr
    psynch_mutexwait
    psynch_mutexdrop
    psynch_cvbroad
    psynch_cvsignal
    psynch_cvwait
    psynch_rw_rdlock
    psynch_rw_wrlock
    psynch_rw_unlock
    psynch_cvclrprepost

* wqthread_hijack on amd64-darwin: deal with
  tst->os_state.pthread having an apparently different offset,
  which caused an assertion failure

* m_debuginfo: for 32 bit processes on Lion, use the DebugInfoFSM
  cleanup added in r12041/12042 to handle apparently new dyld
  behaviour, which is to map text areas r-- first and only
  vm_protect them later to r-x.

The following cleanups remain to be done

* remove apparently pointless, commented out wrapper macro
  invokations in mc_replace_strmem.c, eg

  //MEMMOVE(VG_Z_DYLD,        memmove)

  (or determine that they are still necessary, and uncomment)

* ditto in vg_replace_malloc.c, plus general VGO_darwin cleanups
  there

* write proper syscall wrappers for
    mach_port_set_context
    task_get_exception_ports
    getaudit_addr
    psynch_mutexwait
    psynch_mutexdrop
    psynch_cvbroad
    psynch_cvsignal
    psynch_cvwait
    psynch_rw_rdlock
    psynch_rw_wrlock
    psynch_rw_unlock
    psynch_cvclrprepost
  These are currently just no-ops and may be causing Memcheck to
  report false undef-value errors

* figure out why it doesn't work properly unless built with gcc-4.2 on
  Lion.

  gcc-4.2 is the "normal" gcc (i686-apple-darwin11-gcc-4.2.1).  Plain
  gcc is the hybrid gcc-front-end clang-back-end thing
  (i686-apple-darwin11-llvm-gcc-4.2).  Whereas on Snow Leopard, plain
  gcc is the normal gcc.

  The symptoms of the failure are that wqthread_hijack in
  syswrap-amd64-linux.c hits this /*NOTREACHED*/ vg_assert(0); right
  at the end (you need a pretty complex threaded app to trigger this),
  which makes me think that either ML_(wqthread_continue_NORETURN) or
  call_on_new_stack_0_1 do return, which they are not expected to.

* figure out if some of the uninitialised value errors reported in
  system libraries on are caused by Memcheck being confused by LLVM
  generated code, as per bug #242137

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12043

13 years agoUn-break Darwin build following r12041 (creation of struct _DebugInfoFSM)
Julian Seward [Tue, 20 Sep 2011 22:36:26 +0000 (22:36 +0000)] 
Un-break Darwin build following r12041 (creation of struct _DebugInfoFSM)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12042

13 years agoA refactoring change; no functional effect. struct _DebugInfo
Julian Seward [Tue, 20 Sep 2011 21:59:50 +0000 (21:59 +0000)] 
A refactoring change; no functional effect.  struct _DebugInfo
contains a bunch of fields which are used as a very simple state
machine that observes mmap calls and decides when to read debuginfo
for the associated file.  This change moves these fields into their
own structure, struct _DebugInfoFSM, for cleanness, so as to make it
clear they have a common purpose.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12041

13 years agoGet rid of DebugInfo::memname, a hangover from the now-removed
Julian Seward [Tue, 20 Sep 2011 16:10:59 +0000 (16:10 +0000)] 
Get rid of DebugInfo::memname, a hangover from the now-removed
AIX5 support.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12040

13 years agoDisable sending diffs for the z900 build for now.
Florian Krohm [Mon, 19 Sep 2011 02:33:35 +0000 (02:33 +0000)] 
Disable sending diffs for the z900 build for now.
They are too big to be posted to the mailing list without
moderator interaction.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12039

13 years agoFix tc23_bogus_condwait.c testcase for s390x.
Florian Krohm [Sun, 18 Sep 2011 00:11:12 +0000 (00:11 +0000)] 
Fix tc23_bogus_condwait.c testcase for s390x.
The testcase used to cause a SIGILL because the address of the bogus
mutex  1 + (char*)&mx[0]  denotes a memory location that will eventually
appear in a compare-and-swap instruction. That insn does not allow
memory operands that are not word-aligned. Hence, the SIGILL.
With this fix both incarnations of this testcase (in helgrind and drd)
pass.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12038

13 years agoTweak s390x dispatcher. Using CG elminates two load insns.
Florian Krohm [Sat, 17 Sep 2011 22:18:01 +0000 (22:18 +0000)] 
Tweak s390x dispatcher. Using CG elminates two load insns.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12037

13 years agoDispatcher tweak. Saves ALU operation. Suggested by Julian Seward.
Florian Krohm [Sat, 17 Sep 2011 15:46:59 +0000 (15:46 +0000)] 
Dispatcher tweak. Saves ALU operation. Suggested by Julian Seward.
Implemented by Christian Borntraeger (borntraeger@de.ibm.com).
See bugzilla #274378

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12036

13 years agoMake drd/drd_pthread_intercepts.c compile again on Linux systems without usable ...
Bart Van Assche [Sat, 17 Sep 2011 06:24:49 +0000 (06:24 +0000)] 
Make drd/drd_pthread_intercepts.c compile again on Linux systems without usable <linux/futex.h> header

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12035

13 years agoAdd exp files for s390x. GCC's use of the MVC insn causes
Florian Krohm [Tue, 13 Sep 2011 16:00:38 +0000 (16:00 +0000)] 
Add exp files for s390x. GCC's use of the MVC insn causes
duplicate errors and a different memory access pattern.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12034

13 years agoFix the system call wrapper for the clone system call (s390x).
Florian Krohm [Tue, 13 Sep 2011 14:57:35 +0000 (14:57 +0000)] 
Fix the system call wrapper for the clone system call (s390x).
Fixes #281883. Patch by Christian Borntraeger (borntraeger@de.ibm.com).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12033

13 years agoAdd an .exp for s390x. Certain older kernels had a bug in providing
Florian Krohm [Mon, 12 Sep 2011 20:22:38 +0000 (20:22 +0000)] 
Add an .exp for s390x. Certain older kernels had a bug in providing
an invalid siginfo for SIGBUS. Hunted down and fixed by
Christian Borntraeger (borntraeger@de.ibm.com).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12032

13 years agoThis testcase is sensitive to some sleep period. On slower
Florian Krohm [Sun, 11 Sep 2011 14:39:02 +0000 (14:39 +0000)] 
This testcase is sensitive to some sleep period. On slower
machines we need to sleep longer. See bugzilla #268623 comment #2.
So let's sleep 500ms instead of 100ms, get rid of the load
barrier and enable the testcase for s390x again.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12031

13 years agoAdd more .exp files for s390 due to GCC's use of the MVC insn.
Florian Krohm [Sat, 10 Sep 2011 21:46:08 +0000 (21:46 +0000)] 
Add more .exp files for s390 due to GCC's use of the MVC insn.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12030

13 years agoBack out r12026; instead add a new .exp file for s390x.
Florian Krohm [Sat, 10 Sep 2011 20:54:17 +0000 (20:54 +0000)] 
Back out r12026; instead add a new .exp file for s390x.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12029

13 years agoAdd config files for z900 nightly build
Florian Krohm [Sat, 10 Sep 2011 18:59:10 +0000 (18:59 +0000)] 
Add config files for z900 nightly build

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12028

13 years agoSensitivity fix. On slow machines (s390x z900) need to sleep longer.
Florian Krohm [Sat, 10 Sep 2011 18:28:57 +0000 (18:28 +0000)] 
Sensitivity fix. On slow machines (s390x z900) need to sleep longer.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12027

13 years agoFor s390x we also need to accept a reported size of 1.
Florian Krohm [Sat, 10 Sep 2011 17:56:21 +0000 (17:56 +0000)] 
For s390x we also need to accept a reported size of 1.
This is due to older versions of GCC who use the MVC insn for
assignments and that creates a sequence of 1-byte memory accesses.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12026

13 years agoUpdate build instructions.
Julian Seward [Sat, 10 Sep 2011 11:28:51 +0000 (11:28 +0000)] 
Update build instructions.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12025

13 years agoML_(read_elf_debug_info): debug printing of program header entries: print file
Julian Seward [Sat, 10 Sep 2011 11:21:59 +0000 (11:21 +0000)] 
ML_(read_elf_debug_info): debug printing of program header entries: print file
offsets consistently in base 10, not 16.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12024

13 years agoML_(read_elf_debug_info): if we exit from this routine via the BAD
Julian Seward [Sat, 10 Sep 2011 11:20:26 +0000 (11:20 +0000)] 
ML_(read_elf_debug_info): if we exit from this routine via the BAD
macro, set di->soname back to NULL, so that if we later reenter with
the same 'di', we don't fall over the initial di->soname == NULL
assertion.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12023

13 years agoAvoid excessive fragmentation in m_mallocfree by munmapping unused
Julian Seward [Sat, 10 Sep 2011 10:17:35 +0000 (10:17 +0000)] 
Avoid excessive fragmentation in m_mallocfree by munmapping unused
superblocks in some circumstances (second attempt).  Bug 250101
comment 15.  (Philippe Waroquiers, philippe.waroquiers@skynet.be).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12022

13 years agoProperly preserve FP registers (and, more generally, the entire guest
Julian Seward [Sat, 10 Sep 2011 09:10:03 +0000 (09:10 +0000)] 
Properly preserve FP registers (and, more generally, the entire guest
state) across signal deliveries.  Fixes #281488.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12021

13 years agoAdditional .exp file for s390x.
Florian Krohm [Sat, 10 Sep 2011 03:28:11 +0000 (03:28 +0000)] 
Additional .exp file for s390x.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12020

13 years agoDisable testcase on s390x. Still hangs occasionally.
Florian Krohm [Fri, 9 Sep 2011 20:58:13 +0000 (20:58 +0000)] 
Disable testcase on s390x. Still hangs occasionally.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12019

13 years agoFix testcase for s390x. Provide implementation of XCHG_M_R.
Florian Krohm [Fri, 9 Sep 2011 18:37:55 +0000 (18:37 +0000)] 
Fix testcase for s390x. Provide implementation of XCHG_M_R.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12018

13 years agoAdd a prerequisite because drd/tests/annotate_smart_pointer is not always
Florian Krohm [Fri, 9 Sep 2011 15:50:45 +0000 (15:50 +0000)] 
Add a prerequisite because drd/tests/annotate_smart_pointer is not always
built.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12017

13 years agoAdd config files for nightly s390 builds.
Florian Krohm [Fri, 9 Sep 2011 02:56:00 +0000 (02:56 +0000)] 
Add config files for nightly s390 builds.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12016

13 years agoSupport CLCL and MVCL instructions. This is the non-VEX part.
Florian Krohm [Thu, 8 Sep 2011 15:39:10 +0000 (15:39 +0000)] 
Support CLCL and MVCL instructions. This is the non-VEX part.
Fixes #279027.  See VEX r2200.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12015

13 years agoMake some vgdb interface to callgrind_control internal
Josef Weidendorfer [Tue, 6 Sep 2011 19:08:35 +0000 (19:08 +0000)] 
Make some vgdb interface to callgrind_control internal

The vgdb "status" monitor command is still available, but
used for pretty printing of status information now (acutally,
just some place holder for real information up to now: just
number of running threads). The internal interface used by
callgrind_control to provide stack traces and event counts
is using "status internal", and is not documented, as the
format is not for human consumption.

This also adds some documentation.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12014

13 years agoAllow overriding not-supported auto-detected cache configs
Josef Weidendorfer [Tue, 6 Sep 2011 19:08:31 +0000 (19:08 +0000)] 
Allow overriding not-supported auto-detected cache configs

Patch by Philippe Waroquiers, slightly changed.

This actually was a regression from 3.6.1, but the patch
also improves on printed messages, and refactors common
code between cachegrind and callgrind.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12013

13 years agoChange get_svn_revision to also work with older subversion releases
Florian Krohm [Tue, 6 Sep 2011 17:17:41 +0000 (17:17 +0000)] 
Change get_svn_revision to also work with older subversion releases
that do not allow specifying a revision with svn info.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12012

13 years agoPrint the (pseudo-)soname when doing debug printing for Mach-O
Julian Seward [Tue, 6 Sep 2011 11:26:31 +0000 (11:26 +0000)] 
Print the (pseudo-)soname when doing debug printing for Mach-O
debuginfo reading.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12011

13 years ago* whitespace changes
Julian Seward [Mon, 5 Sep 2011 22:18:13 +0000 (22:18 +0000)] 
* whitespace changes

* move MEMCPY(NONE, ZuintelZufastZumemcpy) to the correct ifdef;
  it got put in the wrong place by r12009 a couple of hours ago.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12010

13 years agoFor intercepts in libc and the dynamic linker (ld.so or dyld), split
Julian Seward [Mon, 5 Sep 2011 20:39:57 +0000 (20:39 +0000)] 
For intercepts in libc and the dynamic linker (ld.so or dyld), split
the Linux and Darwin definitions so they are in completely separate
ifdefs -- iow, remove any definitions that are common to both.  This
gives some duplication, but the upside is that it is now possible to
edit the Darwin intercepts without fear of breaking the Linux ones.
This will be important when it comes to supporting OSX 10.7.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12009