8816 Commits

Author SHA1 Message Date
Florian Krohm
d2b0c7d982 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
2011-10-04 03:33:59 +00:00
Florian Krohm
c8d25c1a22 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
2011-10-04 03:15:38 +00:00
Florian Krohm
ad7a355b4a 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
2011-10-03 23:39:54 +00:00
Florian Krohm
d13b1b34c8 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
2011-10-03 23:05:56 +00:00
Tom Hughes
64d14c247b Fix another read_UInt that should be read_Addr.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12089
2011-10-03 17:01:57 +00:00
Florian Krohm
080f2bb992 Update names of vgdb pipes in documentation. Followup to r12071.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12088
2011-10-03 16:55:26 +00:00
Julian Seward
ef47922e1a Limit number of backtrace frames to 3 so as to avoid junk frames.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12087
2011-10-03 16:15:16 +00:00
Julian Seward
65f6c85aa8 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
2011-10-03 16:10:45 +00:00
Florian Krohm
a84d8c766f 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
2011-10-03 00:19:05 +00:00
Tom Hughes
acc83cb540 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
2011-10-02 12:12:38 +00:00
Tom Hughes
8ecff4c133 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
2011-10-02 10:49:35 +00:00
Tom Hughes
c5b8629171 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
2011-10-02 10:22:08 +00:00
Tom Hughes
8437facdd1 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
2011-10-02 10:20:12 +00:00
Florian Krohm
ead612df79 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
2011-10-02 03:06:39 +00:00
Florian Krohm
8da681a43e 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
2011-10-02 00:38:22 +00:00
Florian Krohm
dbf8393445 Update for x86. This should have happened in r11741 which
changed the message format.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12078
2011-10-02 00:18:29 +00:00
Florian Krohm
6925f05d35 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
2011-10-01 21:07:32 +00:00
Julian Seward
976435b321 Update re OSX 10.7.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12076
2011-09-30 17:55:13 +00:00
Julian Seward
5806ea6327 * (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
2011-09-30 17:51:21 +00:00
Julian Seward
96c9deba29 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
2011-09-30 07:11:13 +00:00
Julian Seward
9272b8d947 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
2011-09-30 07:05:17 +00:00
Florian Krohm
ac33c6041e 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
2011-09-30 01:27:26 +00:00
Florian Krohm
f8b208153d 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
2011-09-29 21:20:49 +00:00
Julian Seward
fc16ea6412 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
2011-09-29 18:29:41 +00:00
Julian Seward
e3b8fb9ac1 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
2011-09-29 18:18:37 +00:00
Julian Seward
f77496fcf0 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
2011-09-29 17:34:17 +00:00
Julian Seward
fee9cdc61e 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
2011-09-29 17:33:58 +00:00
Julian Seward
c5f048d7b6 Accept clang-2.9 as an allowable compiler.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12066
2011-09-29 17:30:13 +00:00
Julian Seward
e8ce3f7abb 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
2011-09-29 17:29:53 +00:00
Florian Krohm
ab466bd7b7 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
2011-09-29 14:26:38 +00:00
Florian Krohm
47c681afb8 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
2011-09-29 03:03:45 +00:00
Florian Krohm
6e43c5d786 Fix a NULL pointer dereference issue spotted by IBM's BEAM checker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12062
2011-09-28 17:43:44 +00:00
Julian Seward
aecb3876cb Update how-to-build documentation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12061
2011-09-27 11:54:01 +00:00
Julian Seward
57b66d4b7d 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
2011-09-27 11:40:24 +00:00
Julian Seward
cea6601bf2 Android: add wrappers for ashmem and binder ioctls. From the AOSP
port of Valgrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12059
2011-09-27 10:26:52 +00:00
Julian Seward
941df4bd6c Un-break debuginfo image finding on non-Android Linuxes following
r12057, duh.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12058
2011-09-27 10:24:52 +00:00
Julian Seward
e843da3851 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
2011-09-27 09:26:39 +00:00
Julian Seward
b5f30896db 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
2011-09-27 08:57:41 +00:00
Julian Seward
bda076043c 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
2011-09-27 08:06:14 +00:00
Julian Seward
ef5296e445 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
2011-09-26 20:20:19 +00:00
Julian Seward
bf10526128 Initial suppressions from Android 2.3.5 (on ARM).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12053
2011-09-26 20:18:29 +00:00
Julian Seward
f2f5329313 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
2011-09-26 20:17:41 +00:00
Julian Seward
efc3e2cef5 Pretty up the debugging hack that allows printing of stack traces
for selected syscalls.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12051
2011-09-26 20:16:15 +00:00
Julian Seward
4725b367ab 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
2011-09-26 20:15:07 +00:00
Julian Seward
99602cf81a 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
2011-09-26 17:50:46 +00:00
Julian Seward
34a86e3b10 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
2011-09-26 16:46:04 +00:00
Julian Seward
a69c68d8d5 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
2011-09-26 11:28:20 +00:00
Florian Krohm
78be7b727e Make filter_helgrind executable. Should unbreak the build.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12046
2011-09-26 04:35:45 +00:00
Florian Krohm
387089d67d 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
2011-09-26 00:29:44 +00:00
Florian Krohm
166c3bcd27 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
2011-09-25 00:15:54 +00:00