Fix a minor defect: only the first 14 chars of the 18 chars in the
--massif-out-file= option was being checked, which meant that if you did
--massif-out-filename=foo by mistake it would accept it and produce a file
called "ame=foo".
Bart Van Assche [Thu, 29 Jan 2009 09:57:22 +0000 (09:57 +0000)]
Suppress any error whose top frame is in libc.so. While not very elegant, this is an effective way to suppress data race reports triggered by glibc's stdio functions (which uses inlined locking functions).
Rechecking the diff of r9080 on the mailing list, I thought
I forgot to replace "|" with "+" in one spot. But that was part
of not-used code, so it actually does not matter.
So better get rid of this code part at all (no need to backport ;-).
Cachegrind/Callgrind: allow for cache sizes other than only powers of two
The number of sets, ie. number of cache lines divided by associativity,
and the cache line size still have to be powers of two.
This change is needed for default cache parameters used on some Intel
Core 2 and Atom processors.
Includes cachegrind manual update and explicit tests with 24KB D1/3MB L2
Reverts addition of 6MB warning to {cachegrind,callgrind}/tests/filter_stderr
Julian Seward [Mon, 26 Jan 2009 00:06:43 +0000 (00:06 +0000)]
Intercept and replace calls to calls to strnlen in glibc, for the
usual reasons. Also update an expected output (lines numbers in
h_intercepts.c should be removed by the regtest system, really).
Julian Seward [Sun, 25 Jan 2009 23:59:24 +0000 (23:59 +0000)]
Prior to this commit, exp-ptrcheck would assert if the DWARF3 data for
global or stack blocks described overlapping blocks (which are
nonsensical). Unfortunately it is naive to assume compilers will
always produce correct debug info. This commit makes exp-ptrcheck
much more robust against such (inevitable) anomalies: stack and global
blocks which overlap are simply ignored.
Julian Seward [Sun, 25 Jan 2009 23:50:32 +0000 (23:50 +0000)]
Handle a couple of artefacts produced by icc11: DW_TAG_reference_type
that doesn't have a size, and DW_FORM_ref_addr (assuming my
interpretation of the standard is correct.)
Julian Seward [Sat, 24 Jan 2009 00:07:53 +0000 (00:07 +0000)]
VG_(apply_StackTrace): following r8818, we should regard an entry of -1
as denoting the logical end of the stack. This change stops printing
of a lot of junk below the logical "-1" end mark. See added comments
for details.
Julian Seward [Sat, 24 Jan 2009 00:04:28 +0000 (00:04 +0000)]
Handle the case where a Compilation Unit (CU) (or, really, the CU and
its associated DIEs) occupies less space than stated in the CU's
header. icc9 appears to produce CUs with this anomaly. Not handling
the case causes the reader to lose sync at the start of the following
CU, since it hasn't skipped the junk bytes at the end of the current
CU, and it is basically hosed after that.
MERGE TO 3_4_BRANCH (?)
Move memcheck/tests/brk to the linux/ subdir, as it's Linux-specific (merged
from the DARWIN branch). Also filter the output more so the .stderr.exp2
isn't needed.
Merge some minor regtest updates from the DARWIN branch:
- avoid using <malloc.h> where it's not necessary, because on DARWIN it's
called <malloc/malloc.h>
- filter the output of brk2 more, which allows the .stderr.exp2 file to be
removed.
Julian Seward [Thu, 22 Jan 2009 22:44:30 +0000 (22:44 +0000)]
Move the test for __sync_bool_compare_and_swap almost to the bottom,
so it can use $mflag_primary. This makes the word size for which the
test is done (-m32 or -m64) be the same as for which it is actually
needed, and in some situations unbreaks building of the regtests in
32-bit mode on a 64-bit machine.
For the same reason, apply $mflag_primary to the test for OpenMP.
Rename all the arch/OS/platform-related variables in configure.in to make it
clearer what they mean:
- They all have VGCONF_ prefixes now, to indicate they come out of
configure.in (and are clearly distinguished from the VGA_/VGO_/VGP_
#defines passed in to C files).
- The ones that refer to the primary *or* secondary platform have _INCLUDES_
in them.
- The ones that are in all-caps have a _CAPS suffix.
So, for example, what was VGP_X86_LINUX is now
VGCONF_PLATFORMS_INCLUDE_X86_LINUX, which is more verbose but also a lot
clearer. The names of the #defines used in the C files (VGA_x86, VGO_linux,
etc) are unchanged.
cputest.c: changed to reflect the Valgrind installation's capabilities,
rather than the machine's capabilities. In particular, if
--enable-only32bit is used on a 64-bit machine, then this program will claim
to only support 32-bits. Also use the VGA/VGO/VGP macros which are clearer
than the __i386__ ones. (This is partially merged from the DARWIN branch.)
configure.in: clean up the comments, distinguish different sections more
clearly, and generally make it more readable.
valgrind.pc.in: try to make this more accurate. I doubt anyone's using it.
It doesn't appear to be set up to handle dual-architecture builds.
Julian Seward [Thu, 22 Jan 2009 21:18:15 +0000 (21:18 +0000)]
Minor tidyings:
search_all_symtabs: look for data symbols also in .sbss and .rodata
sections.
VG_(seginfo_sect_kind): identify addresses in .sbss sections.
VG_(pp_SectKind): handle missing case Vg_SectGOTPLT
search_all_loctabs, VG_(get_objname), VG_(find_seginfo): augment tests
"di->text_present" with "&& di->text_size > 0" (probably not
necessary, but is clearer, and more consistent in that most places
that look at DebugInfo.text_{size,avma} first perform both of those
tests).
Julian Seward [Thu, 22 Jan 2009 20:46:51 +0000 (20:46 +0000)]
Suppress any error at all that occurs in libpthread, without any
regard for any calling frames. Needed to hide the fact that we can't
see stdio locking stuff and hence end up reporting a lot of errors in
multithreaded stdio working.
MERGE TO 3_4_BRANCH.
Tom Hughes [Thu, 22 Jan 2009 13:24:06 +0000 (13:24 +0000)]
Improve detection of where ELF sections have been mapped by taking
the ELF segment table into account when deciding on the mapping
between SVMA and AVMA for a section.
This also allows the BSS kludge to be dropped, as the BSS address is
now correctly determined.
Julian Seward [Thu, 22 Jan 2009 01:36:51 +0000 (01:36 +0000)]
Don't hardwire @FLAG_M32@ in here, since this directory isn't arch
specific (and so the build fails eg on a 64 bit machine that does
not have a 32-bit toolchain installed). Use $(AM_FLAG_M3264_PRI)
instead.
- No longer using VG_ARCH_ALL to determine the DIST_SUBDIRS used for
arch/OS/platform-specific tool test dirs, instead writing it by hand.
This is important because up until now if we had any arch-specific test
dirs, we needed such dirs for all archs. Now that we also have
OS-specific and platform-specific test dirs, we don't want to have
(mostly) empty dirs for every arch/OS/platform.
- Correspondingly, removed several empty directories under memcheck/tests/
and cachegrind/tests that are no longer needed.
- Also removed VG_ARCH_ALL from configure.in.
- Also used an arch-specific guard rather than a platform-specific one where
appropriate in cachegrind/tests/Makefile.am.
- Split up m_ume.c into m_ume/{main,elf,script}.c. This will make merging
the DARWIN branch easier later.
- Remove the disabled vgtest_ume test, it's very unlikely it'll ever work
again.
- Move VG_(find_auxv) to initimg-linux.c, the only place it's used, and make
it static.
Bart Van Assche [Fri, 16 Jan 2009 11:57:50 +0000 (11:57 +0000)]
Obtain current time through time() instead of through clock_gettime(CLOCK_REALTIME), such that this test compiles on systems that do not support CLOCK_REALTIME.
Introduce a new type, PtrdiffT. Replace lots of uses of OffT (all those
that are memory offsets) with PtrdiffT; OffT should only be used for file
sizes and offsets.
Change Off64T from a ULong to a Long, as it should be. Replace some uses
of ULong in the address space manager with Off64T to match.
Also add a comment explaining the meanings of the basic types like Addr,
OffT, SizeT, etc.
Also fix the prototype for VG_(pread) -- the last arg is an OffT, not an
Int.
Bart Van Assche [Tue, 13 Jan 2009 07:49:14 +0000 (07:49 +0000)]
Do not only intercept SIGILL during detection of the supported instruction set
on ppc but also SIGFPE. This patch should make instruction set detection work
on the PowerPC 440EPx.
Fixes bug #176926.
trunk/nightly/bin/nightly
Use '.' instead of 'source', because that's how /bin/sh does it. This
should make the script more reliable on systems that don't have bash as
the /bin/sh, eg. Ubuntu and Debian.
trunk/memcheck/tests/Makefile.am
trunk/memcheck/tests/vcpu_bz2.c
trunk/memcheck/tests/vcpu_bz2.vgtest
vcpu_bz2.c was (I think) an "svn copy" of perf/bz2.c. Because it's a
copy, the two can get out of sync, which was a problem with Greg
Parker's Darwin patch. So we remove vcpu_bz2.c, and make
vcpu_bz2.vgtest invoke perf/bz2 directly.
trunk/cachegrind/tests/wrap5.c
trunk/cachegrind/tests/Makefile.am
trunk/cachegrind/tests/wrap5.vgtest
wrap5.c was likewise an "svn copy" of memcheck/tests/wrap5.c, so we do
the equivalent thing with it.