3651 Commits

Author SHA1 Message Date
Julian Seward
dc53563392 Intercept strlen in ld.so on x86. Fixes #266961.
(Jakub Jelinek, jakub@redhat.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11668
2011-03-28 08:22:55 +00:00
Bart Van Assche
9df672f236 Add VALGRIND_RESIZEINPLACE_BLOCK() and hence close #267819.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11666
2011-03-25 20:07:25 +00:00
Julian Seward
d6740217a1 Add support for sys_ptrace. Fixes #269079.
(Ulrich Weigand, uweigand@de.ibm.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11664
2011-03-24 11:34:12 +00:00
Bart Van Assche
a170de4e78 Linux/ppc: Added support for the ppoll() system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11655
2011-03-18 17:47:38 +00:00
Bart Van Assche
47fa81b4bf Process PDB files with a path that contains spaces properly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11617
2011-03-10 12:49:50 +00:00
Julian Seward
6107fd666c Add a port to IBM z/Architecture (s390x) running Linux -- Valgrind
side components. (Florian Krohm <britzel@acm.org> and Christian
Borntraeger <borntraeger@de.ibm.com>).  Fixes #243404.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11604
2011-03-07 16:05:35 +00:00
Julian Seward
62134f346f Back out r11568 (Add a new constructor for empty XArrays,
VG_(newSizedXA)) since r11571 removes the only use of the
functionality that r11568 introduces.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11573
2011-02-27 23:53:32 +00:00
Julian Seward
0c2371837b Add a new constructor for empty XArrays, VG_(newSizedXA). This is
identical to VG_(newXA) but allows passing in a size hint.  In the
case where the likely final size of the XArray is known at creation
time, this allows avoiding the repeated (implicit) resizing and
copying of the array as elements are added, which can save a vast
amount of dynamic memory allocation turnover.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11568
2011-02-23 13:22:24 +00:00
Julian Seward
0e228dac5d Fix a scalability problem observed whilst running Helgrind on a large
workload: when scanning a freelist of a given size for a big-enough
block (to allocate), don't scan all the way around the list.  Instead
give up after 100 blocks and try the freelist above.  The pathological
case (as observed) is that the freelist contains tens of thousands of
blocks, but all are too small for the current request, hence they are
all visited pointlessly.  If the new heuristic is used, the freelist
start point is moved along by one block, so that future searches
eventually inspect the entire freelist, just very slowly.

Also, some improvements to stats gathering, and rename of some
existing stats fields in struct Arena.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11567
2011-02-23 13:18:56 +00:00
Julian Seward
46bbd35ea3 Make ld.so:index redir mandatory for glibc-2.12 and later, on x86-linux.
Also, improve the failure message a bit, so as to tell people what package
they need to install, in at least some cases.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11538
2011-02-11 16:47:03 +00:00
Bart Van Assche
b3f1163f39 Removed an unused variable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11537
2011-02-10 21:09:25 +00:00
Julian Seward
afa6fa71cb Handle Dwarf3 types created by GNAT. Fixes #255130.
(Philippe Waroquiers <philippe.waroquiers@skynet.be>)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11517
2011-02-01 23:10:14 +00:00
Julian Seward
3bb7892440 Don't produce suppression stack pseudo-traces with more than
VG_MAX_SUPP_CALLERS entries in them.  Fixes #255822.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11515
2011-01-28 00:44:52 +00:00
Julian Seward
6904ae851c In 3 error-path cases, place the closing </valgrindoutput> on the
correct stream (XML instead of plain-text).  Fixes #255888.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11514
2011-01-28 00:19:25 +00:00
Nicholas Nethercote
4f4749956f Print a stack trace as part of the "unhandled instruction bytes" warning.
Useful if the program in question catches signals, in which case the usual
"Process terminating..." stack trace isn't shown.  Requested by Jesse
Ruderman.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11504
2011-01-18 05:16:21 +00:00
Julian Seward
ebfe3fcbe9 Improve performance of smc-checks substantially, by:
(1) allowing translations to chase across BB boundaries, as in the
    non-smc-check case

(2) on 64-bit targets, do the checksumming with 64-bit loads
    instead of 32-bit ones.

(valgrind-side change, to match vex r2070)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11495
2011-01-10 15:09:23 +00:00
Julian Seward
1852adcac0 Memcheck, None: update avg translation size to be more realistic.
Massif: specify avg translation size at all, so as to avoid excessive
retranslations caused by the fact that the default value is far below
reality for Massif.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11494
2011-01-10 15:01:03 +00:00
Julian Seward
30dcecc9c9 Un-break the trunk build on OSX (broken by r11483 on 6 Dec '10).
Fixes #261654.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11489
2011-01-04 14:18:35 +00:00
Nicholas Nethercote
c318a53a2a When a shmat() size is passed to the tool, round it up to a page size. This
is how mmap() sizes are treated.  It fixes an assertion failure in Massif
with --pages-as-heap=yes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11485
2010-12-08 02:51:43 +00:00
Julian Seward
906915e79b New command line option: --trace-children-skip-by-arg, which allows
chase/nochase decisions for child processes to be made on the basis
of their argv[] entries rather than on the name of their executables.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11483
2010-12-06 11:40:04 +00:00
Julian Seward
401f70d784 Minor improvements to PDB reading:
* better progress messages, to make it clear that reading of a
  PDB is finished, and how much stuff was read from it

* don't mmap PDB files to read them -- instead use VG_(read).
  This is because CIFS filesystem mounting only works reliably on
  Linux when mounted with option '-o directio', and that
  disallows mmap-ing files.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11482
2010-12-06 11:11:29 +00:00
Julian Seward
ce9c5ac16a Size the ARM_LINUX_FAKE_COMMPAGE correctly and add explanatory
comments.  Fixes #254556.  (Peter Maydell, peter.maydell@linaro.org)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11460
2010-10-20 15:43:09 +00:00
Tom Hughes
77171c6bfb Avoid a double free when a binary has a build-id and no debuglink section.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11458
2010-10-19 13:12:59 +00:00
Tom Hughes
8a3cde403f Add support for DW_ATE_UTF from DWARF4 which is needed for char16_t
support in C++0X.

Patch from Christian Borntraeger on bug #254550.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11450
2010-10-18 14:57:58 +00:00
Tom Hughes
9900b430c5 Don't look for build-id notes if NT_GNU_BUILD_ID is not defined.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11449
2010-10-18 13:04:13 +00:00
Tom Hughes
c8aedaf422 Add support for using build-id to find debugging information as
some distributions are starting to drop the old debuglink support
now. Fixes #254257.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11448
2010-10-18 12:38:22 +00:00
Julian Seward
b43eec1219 Documentation update for 3.6.0 (not including NEWS).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11440
2010-10-13 21:47:29 +00:00
Julian Seward
1375448f10 Make the --prefix-to-strip=... command-line option added in r11312
behave more like the original proposal in #245535.  This makes it
more flexible and general.  Also rename it.

* new name is --fullpath-after=

* allow multiple instances of --fullpath-after=

* don't require the specified strings to be prefixes, only substrings

But retain the elegant backwards-compatibility trick in Bart's r11312
commit: if --fullpath-after= is not specified at all, then behave
exactly as before.

Fixes #245535.  A mixture of patches from Bart Van Assche
(bart.vanassche@gmail.com), Alexander Potapenko (glider@google.com),
and me (integration and documentation).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11430
2010-10-12 00:44:05 +00:00
Julian Seward
2569c4fc94 Remove some fluff detected by llvm-2.8 (clang):
- "*(int *)0 = " is apparently ignored by LLVM for who-knows-why
  reason.  Cast the zero to a volatile int * instead.

- remove an unused function that gcc failed to mention was unused
  (why?  because it was marked __attribute__((noreturn)) ?)

As an aside, clang/llvm-2.8 seemed to be able to successfully
compile Valgrind.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11429
2010-10-11 19:15:33 +00:00
Julian Seward
1a7379bf89 Enable support for sys_ppoll on arm-linux (Rodrigo Belem, rodrigo.belem@openbossa.org).
See #253636.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11428
2010-10-11 19:09:53 +00:00
Julian Seward
18503c8e64 Dwarf3 reader: handle Dwarf3 created by gcc-4.5.1. In other words,
work around the all-new-buggy-Dwarf3 created by gcc-4.5.1.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11418
2010-10-08 23:57:25 +00:00
Julian Seward
bee9b6b321 chmod_extended and fchmod_extended: handle NULL xsecurity argument correctly.
Fixes #247510.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11412
2010-10-07 15:38:51 +00:00
Julian Seward
7028b51512 Local-ise some variables that don't need to be visible outside this file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11409
2010-10-07 10:01:40 +00:00
Julian Seward
d1bad49f00 Only use VKI_O_LARGEFILE on platforms where it exists. This
unbreaks the build breakage on Darwin introduced in r11397, which
was a fix for #234064.  The breakage was subsequently reported
in #253420 and #253452, which this commit fixes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11406
2010-10-07 09:56:19 +00:00
Julian Seward
cb3fbb46d7 The amd64-linux unwinder rejects stacks of smaller than 512 bytes as
bogus, and produces essentially useless traces from them.  With
gcc-4.4 and later, some valid thread stacks really are smaller than
this.  Hence change the limit down to 256 bytes.  Investigated by
Evgeniy Stepanov, eugeni.stepanov@gmail.com.
See bug 243270 comment 21.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11403
2010-10-06 22:45:18 +00:00
Julian Seward
566a25cf7e Make client sys_shmat work properly on arm-linux by taking into
account rounding requirements to SHMLBA.  Modified version of a patch
by Kirill Batuzov, batuzovk@ispras.ru.  This fixes the main bug in
#222545.  Temporarily breaks the build on all other platforms though.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11399
2010-10-06 15:24:39 +00:00
Julian Seward
12dd8bd181 get_shm_size(): pass VKI_IPC_64 to our shmctl call if it is available,
except on amd64-linux.  This fixes a secondary problem discussed
in bug 222545.  (Kirill Batuzov, batuzovk@ispras.ru)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11398
2010-10-06 12:59:44 +00:00
Julian Seward
c72198e061 When opening an mmaped file to see if it's an ELF file that we should
read debuginfo from, use VKI_O_LARGEFILE, so as to ensure the open
succeeds for large files on 32-bit systems.  Fixes #234064.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11397
2010-10-06 11:38:01 +00:00
Julian Seward
669d87bcc1 Support sys_readahead on Linux.
(Sean Bartell, wingedtachikoma@gmail.com)  Fixes #247894.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11394
2010-10-04 20:03:27 +00:00
Julian Seward
f5e67f801d Make readdwarf.c big endianess safe to enable unwinding on big endian
systems.  (Christian Borntraeger, borntraeger@de.ibm.com).  Fixes
#248893.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11391
2010-09-30 15:11:01 +00:00
Tom Hughes
00ae2c5c8c Calling VG_(am_relocate_nooverlap_client) will destroy the descriptor
for the old segment so we need to save the permissions from it before
the call so that we can use them when notifying tools of the new space
afterwards, or we will notify them of the wrong permissions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11384
2010-09-27 15:08:34 +00:00
Julian Seward
0bb6f49531 On arm-linux, add r7 to the set of registers that the CFI unwinder
knows how to unwind.  This is important when unwinding Thumb code
the CFA is often stated as being at some offset from r7.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11377
2010-09-23 22:05:59 +00:00
Julian Seward
4953c95227 DW_CFA_advance_loc{,1,2,4} fail to multiply the delta by
code_alignment_factor, thereby assuming it is 1.  This happens to be
OK on amd64-linux and s390x-linux because it really is 1, but on
arm-linux it is 2, and hence the boundaries between code-unwind areas
are simply wrong after any of DW_CFA_advance_loc{,1,2,4} are
processed.  This patch provides the obvious fix.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11376
2010-09-23 13:24:48 +00:00
Julian Seward
0bfbb21837 arm-linux: zero out the least significant bit of R15 that we
ptrace into the child, so as to be a legitimate instruction
address in both ARM and Thumb mode.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11375
2010-09-23 11:02:48 +00:00
Julian Seward
19bc251432 arm-linux: determine whether the host supports Neon by looking at our
AUXV at startup, rather than by trying to execute a Neon instruction
and seeing whether it SIGILLs.  Apparently the latter is not a
reliable way to ascertain the presence of usable Neon support.  Fixes
#249775.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11347
2010-09-09 07:25:58 +00:00
Julian Seward
437bec2e42 Fix somewhat nonsensical ifdeffery.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11345
2010-09-08 15:12:33 +00:00
Julian Seward
0dfc00b23f Don't scan the entire Valgrind stack to check for impending
stack-overflow situations.  This causes an immense number of L2 misses
which are completely pointless, and the recent increase of the
Valgrind per-thread stack size from 64k to 1M greatly aggravates the
situation.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11343
2010-09-08 08:30:31 +00:00
Bart Van Assche
8504416a46 Consistency improvement: made sure that VG_TRACK(die_mem_stack, address, len)
is not invoked with a zero third argument.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11342
2010-09-07 16:32:53 +00:00
Julian Seward
f150e720c1 Stop gcc complaining that dcbz_szB is used uninitialised.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11339
2010-09-04 00:43:14 +00:00
Julian Seward
efef31093f Support the DCBZL instruction. Also, query the host CPU at startup
time to find out how much space DCBZL really clears, and make the
guest CPU act accordingly.  (valgrind-side changes).
(Dave Goodell, goodell@mcs.anl.gov)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11337
2010-09-03 15:51:34 +00:00