]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
10 years agoBug 338803 followup. Only print cross-CU warning when -v is given.
Mark Wielaard [Mon, 8 Sep 2014 09:25:55 +0000 (09:25 +0000)] 
Bug 338803 followup. Only print cross-CU warning when -v is given.

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

10 years agodrd/tests: Follow-up for r14478 - make regression test output independent of --read...
Bart Van Assche [Mon, 8 Sep 2014 08:04:40 +0000 (08:04 +0000)] 
drd/tests: Follow-up for r14478 - make regression test output independent of --read-inline-info

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

10 years agomips64: use generic MK_(guess_and_register_stack)
Petar Jovanovic [Mon, 8 Sep 2014 01:03:17 +0000 (01:03 +0000)] 
mips64: use generic MK_(guess_and_register_stack)

Follow up to Philippe's change in r14392 which does a cleanup and makes
all architectures use the same code to guess and register stack.

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

10 years agoDisable default-yes setting of read-inline-info for MacOS, and enable
Julian Seward [Sun, 7 Sep 2014 19:53:41 +0000 (19:53 +0000)] 
Disable default-yes setting of read-inline-info for MacOS, and enable
it for drd on Linux.

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

10 years agoMore stack-end-semantics fixups for MacOS following r14422 and r14392.
Julian Seward [Sun, 7 Sep 2014 16:08:20 +0000 (16:08 +0000)] 
More stack-end-semantics fixups for MacOS following r14422 and r14392.
May fix #338878.

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

10 years agoGo back to $test_dirs after each test run or tests dir run
Philippe Waroquiers [Sun, 7 Sep 2014 12:36:58 +0000 (12:36 +0000)] 
Go back to $test_dirs after each test run or tests dir run
Otherwise, we get an error for the 2nd dir if specifying 2 directories e.g.

  perl tests/vg_regtest cachegrind/tests callgrind/tests
  -- Running  tests in cachegrind/tests ----------------------------------
  chdir:           valgrind   ./chdir
  clreq:           valgrind   -q ./clreq
  dlclose:         valgrind   ./dlclose
  notpower2:       valgrind   --I1=32768,8,64 --D1=24576,6,64 --LL=3145728,12,64 ./../../tests/true
  wrap5:           valgrind   ./../../memcheck/tests/wrap5
  -- Running  tests in cachegrind/tests/x86 ------------------------------
  fpu-28-108:      valgrind   ./fpu-28-108
  -- Finished tests in cachegrind/tests/x86 ------------------------------
  -- Finished tests in cachegrind/tests ----------------------------------
  `callgrind/tests' neither a directory nor a readable test file/name

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

10 years agoupdate callgrind and cachegrind filtering logic following rev 14469
Philippe Waroquiers [Sun, 7 Sep 2014 12:15:52 +0000 (12:15 +0000)] 
update callgrind and cachegrind filtering logic following rev 14469
rev 14469 gives better description of the tweak done to the
simulated cache. Update filtering logic to filter this (variable) tweaking
msg.

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

10 years agoDo not modify a character string that could be a readonly
Florian Krohm [Sat, 6 Sep 2014 20:40:28 +0000 (20:40 +0000)] 
Do not modify a character string that could be a readonly
string literal.

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

10 years agoreadstabs.c: Don't include a.out.h, just define the stabs symbol nlist entry.
Mark Wielaard [Sat, 6 Sep 2014 19:29:51 +0000 (19:29 +0000)] 
readstabs.c: Don't include a.out.h, just define the stabs symbol nlist entry.

readstabs.c tries to include a.out.h to get the stabs symbol list entry
definition. STABS isn't specifically tied to the a.out format though.
The symbol entry structure just happens to be defined in the a.out.h
header. The header isn't really standard though. It might be provided
by glibc or the kernel in different locations. And not all arches support
the a.out format so the header might not even exist. Just define the
needed nlist struct entry directly in readstabs.c for VGO_linux. All
arches in glibc and the kernel use the same one anyway.

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

10 years agonightly: source is a bashism, use '.' instead
Mark Wielaard [Sat, 6 Sep 2014 18:33:14 +0000 (18:33 +0000)] 
nightly: source is a bashism, use '.' instead

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

10 years agonightly: Try harder to get vendor stuff.
Mark Wielaard [Sat, 6 Sep 2014 17:37:55 +0000 (17:37 +0000)] 
nightly: Try harder to get vendor stuff.

/etc/issue.net might just contain control chars (like \S) a generic welcome
message or omit the precise version. The newest standard is /etc/os-release
http://www.freedesktop.org/software/systemd/man/os-release.html
Otherwise there is often lsb_release
http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/lsbrelease.html
Try those first, fall back to /etc/issue.net if neither is there.

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

10 years agonightly: Try even more locations for finding glibc.
Mark Wielaard [Sat, 6 Sep 2014 17:37:54 +0000 (17:37 +0000)] 
nightly: Try even more locations for finding glibc.

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

10 years agoAvoid a compiler warning about int-to-ptr casting.
Julian Seward [Sat, 6 Sep 2014 15:25:08 +0000 (15:25 +0000)] 
Avoid a compiler warning about int-to-ptr casting.

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

10 years agoRename "--kernel-variant=android-emulator-no-hw-tls" to
Julian Seward [Sat, 6 Sep 2014 14:45:12 +0000 (14:45 +0000)] 
Rename "--kernel-variant=android-emulator-no-hw-tls" to
"=android-no-hw-tls" per suggestion from Philippe.

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

10 years agodrd: Make regression test output independent of --read-inline-info
Bart Van Assche [Sat, 6 Sep 2014 12:19:23 +0000 (12:19 +0000)] 
drd: Make regression test output independent of --read-inline-info

There are plans to enable --read-inline-info=yes for all Valgrind
tools. Hence make the DRD regression test output independent of how
--read-inline-info has been set.

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

10 years agodrd/docs/drd-manual.xml: Remove a redundant phrase.
Bart Van Assche [Sat, 6 Sep 2014 06:23:15 +0000 (06:23 +0000)] 
drd/docs/drd-manual.xml: Remove a redundant phrase.

This was reported by Dilyan Palauzov

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

10 years agoPartial bypass for 338803 Handling of dwz debug alt files or cross-CU is broken
Philippe Waroquiers [Sat, 6 Sep 2014 00:13:47 +0000 (00:13 +0000)] 
Partial bypass for 338803 Handling of dwz debug alt files or cross-CU is broken

This patch avoids dereferencing absori that are in other CUs than
the CU currently being read.
This avoids dwarf reading errors when reading inlined information.
The bypass results in inlined function being reported as
UnknownInlinedFun rather than the real correct function name.

--read-var-info=yes is still broken for unknown reasons
(probably type reading is doing some other cross-CU references ?).

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

10 years agoFix 338698 race condition between gdbsrv and vgdb on startup
Philippe Waroquiers [Fri, 5 Sep 2014 23:57:57 +0000 (23:57 +0000)] 
Fix 338698  race condition between gdbsrv and vgdb on startup

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

10 years agoAlways check crc in open_debug_file for now. Bug #338791 followup.
Mark Wielaard [Fri, 5 Sep 2014 22:50:51 +0000 (22:50 +0000)] 
Always check crc in open_debug_file for now. Bug #338791 followup.

Revision r14464 made it so that debug alt files could be found by their
build-id or their (relative) file path. Debug alt files are matched using
the given build-id, but by crc. Calculating the full CRC is costly, but
currently still needed to avoid misidentifying the main file as debug
file. Slightly more efficient would be to use fstat to check we aren't
actually opening the main file under any other name (but that only works
for local DiImages). Or we could check that the file being opened actually
has at least one .debug* section. But this change was the minimal patch
to make things work as before.

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

10 years agoImproved argument checking for sys_kcmp. Derived from patch from
Julian Seward [Fri, 5 Sep 2014 21:11:18 +0000 (21:11 +0000)] 
Improved argument checking for sys_kcmp.  Derived from patch from
Christian Borntraeger.  Followup to r14451.  Pertains to #338106.

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

10 years agoevh__new_mem_heap: get rid of pointless conditional. Spotted by
Julian Seward [Fri, 5 Sep 2014 20:29:10 +0000 (20:29 +0000)] 
evh__new_mem_heap: get rid of pointless conditional.  Spotted by
Coverity and Florian Krohm.

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

10 years agoBe more careful to separate build flags for the preload shared objects
Julian Seward [Fri, 5 Sep 2014 20:00:22 +0000 (20:00 +0000)] 
Be more careful to separate build flags for the preload shared objects
as opposed to the valgrind code proper.  In particular, make sure that
-mpreferred-stack-boundary=2 does not get used for the preload shared
objects, since that can cause the stack to become misaligned and leads
to segfaults.  Modified version of a patch from Matthias Schwarzott
(zzam@gentoo.org).  Fixes #324050.

Also, fix the configure check in configure.ac for
-mpreferred-stack-boundary=2 so that it checks whether this is
allowable for 32-bit code generation even on 64-bit (x86) hosts.  This
check was wrong before now and led to 32-bit builds on 64-bit hosts
generating poorer code for speed critical helper functions (eg
helperc_LOADV32le) than on 32-bit builds on 32-bit hosts.

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

10 years agoFix function prototype as pointed out by clang.
Florian Krohm [Fri, 5 Sep 2014 19:23:20 +0000 (19:23 +0000)] 
Fix function prototype as pointed out by clang.

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

10 years agomaybe_tweak_LLc: generalise this so that it can mash more or less any
Julian Seward [Fri, 5 Sep 2014 19:05:20 +0000 (19:05 +0000)] 
maybe_tweak_LLc: generalise this so that it can mash more or less any
cache size and associativity pair into something the simulator can
actually handle, by increasing the associativity whilst reducing the
number of sets, so that the number of sets becomes a power of two.
Fixes #333501.

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

10 years agoThe purpose of the test is to see whether the exported header files
Florian Krohm [Fri, 5 Sep 2014 18:36:26 +0000 (18:36 +0000)] 
The purpose of the test is to see whether the exported header files
compile OK with gcc -ansi.  Therefore, add drd.h

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

10 years agoFix most clang warnings.
Florian Krohm [Fri, 5 Sep 2014 18:30:05 +0000 (18:30 +0000)] 
Fix most clang warnings.

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

10 years agoThe update fixes a format issue in the PPC test
Carl Love [Fri, 5 Sep 2014 18:05:24 +0000 (18:05 +0000)] 
The update fixes a format issue in the PPC test
none/tests/ppc32/jm-insns.c and none/tests/ppc64/jm-insns.c.
The BE and LE output expect files are updated as well.

There is no Bugzilla related to this update.  The issue
was found and the initial patch and BE output update
was done by Florian Krohm <florian@eich-krohm.de>.
Carl Love <cel@us.ibm.com> added the LE output update.

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

10 years agoMove the endianess test for ppc64 to the correct place.
Florian Krohm [Fri, 5 Sep 2014 14:49:17 +0000 (14:49 +0000)] 
Move the endianess test for ppc64 to the correct place.

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

10 years agoBug 338791 Handle debug alt dwz files that are relative to the debug file.
Mark Wielaard [Fri, 5 Sep 2014 14:25:17 +0000 (14:25 +0000)] 
Bug 338791 Handle debug alt dwz files that are relative to the debug file.

readdwarf3 would only look for alt dwz files using the build-id.
But alt files can be installed relative to the debug (or main) file.
Fix find_debug_file to allow searching of relative files even if
we don't want an ET_REL (rel_ok) file, and pass the build-id to
open_debug_file so it can be checked. Add the debug file path to
_DebugInfoFSM and set it in find_debug_file once opened. Pass the
dbgname or filename as relative file to resolve an altfile in
read_elf_debug_info when we ahava an debugaltlink_escn.

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

10 years agoMake sure valgrind builds with clang 3.5.0
Florian Krohm [Fri, 5 Sep 2014 14:08:51 +0000 (14:08 +0000)] 
Make sure valgrind builds with clang 3.5.0

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

10 years agoRemove unneeded variable.
Julian Seward [Fri, 5 Sep 2014 07:49:54 +0000 (07:49 +0000)] 
Remove unneeded variable.

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

10 years agoadd more system call numbers for s390. While we are at it
Christian Borntraeger [Thu, 4 Sep 2014 19:57:17 +0000 (19:57 +0000)] 
add more system call numbers for s390. While we are at it
also wire up the common linux kcmp system call.

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

10 years agoRevert an accidentally checked in change.
Florian Krohm [Thu, 4 Sep 2014 18:37:56 +0000 (18:37 +0000)] 
Revert an accidentally checked in change.

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

10 years agoAdd a few more tasks to consider.
Florian Krohm [Thu, 4 Sep 2014 18:37:02 +0000 (18:37 +0000)] 
Add a few more tasks to consider.

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

10 years agoarm64: enable test cases for str bN, [reg, reg etc] and str hN, [reg,
Julian Seward [Thu, 4 Sep 2014 11:45:26 +0000 (11:45 +0000)] 
arm64: enable test cases for str bN, [reg, reg etc] and str hN, [reg,
reg etc].  Pertaining to #337762, vex r2943.

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

10 years agoFix off-by-one error in size of coredumps. Patch from Ivo Raisr
Julian Seward [Thu, 4 Sep 2014 11:28:11 +0000 (11:28 +0000)] 
Fix off-by-one error in size of coredumps.  Patch from Ivo Raisr
(ivosh@ivosh.net).  Fixes #338300.

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

10 years agoarm64-linux: enable sys_mlock, sys_mlockall. Fixes #337766.
Julian Seward [Thu, 4 Sep 2014 11:22:31 +0000 (11:22 +0000)] 
arm64-linux: enable sys_mlock, sys_mlockall.  Fixes #337766.

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

10 years agoPatch adding support for V4L2/media ioctls. Patch from Hans Verkuil
Julian Seward [Thu, 4 Sep 2014 11:08:45 +0000 (11:08 +0000)] 
Patch adding support for V4L2/media ioctls.  Patch from Hans Verkuil
(hverkuil@xs4all.nl).  Fixes #338023.

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

10 years agoAdd Xen 4.4 evtchn ioctl wrappers. Patch from Antony Saba
Julian Seward [Thu, 4 Sep 2014 11:02:24 +0000 (11:02 +0000)] 
Add Xen 4.4 evtchn ioctl wrappers.  Patch from Antony Saba
(antony.saba@fireeye.com).  Second of two patches from #337740.

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

10 years agoAdd support for Xen hypercalls used by libvmi. Patch from Antony Saba
Julian Seward [Thu, 4 Sep 2014 10:59:50 +0000 (10:59 +0000)] 
Add support for Xen hypercalls used by libvmi.  Patch from Antony Saba
(antony.saba@fireeye.com).  First of two patches from #337740.

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

10 years agoAdd support for ppc32 syscalls used by uClibc. Patch from Kristof
Julian Seward [Thu, 4 Sep 2014 10:51:49 +0000 (10:51 +0000)] 
Add support for ppc32 syscalls used by uClibc.  Patch from Kristof
Provost (kde-bugzilla@sigsegv.be).  Fixes #330594.

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

10 years agoAdd support for sys_kcmp. Patch from Chris Jones
Julian Seward [Thu, 4 Sep 2014 10:17:08 +0000 (10:17 +0000)] 
Add support for sys_kcmp.  Patch from Chris Jones
(cjones.bugs@gmail.com).  Fixes #338106.

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

10 years agoRemove accidentally committed bit of text.
Julian Seward [Thu, 4 Sep 2014 10:15:52 +0000 (10:15 +0000)] 
Remove accidentally committed bit of text.

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

10 years agomips64: add tests for Cavium BBIT0 and BBIT1
Petar Jovanovic [Thu, 4 Sep 2014 01:07:08 +0000 (01:07 +0000)] 
mips64: add tests for Cavium BBIT0 and BBIT1

Follow up to VEX r2942 in which support for Cavium BBIT0/1 instructions
has been added.

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

10 years agoDocument the new --kernel-variant options committed in r14440.
Julian Seward [Wed, 3 Sep 2014 22:21:25 +0000 (22:21 +0000)] 
Document the new --kernel-variant options committed in r14440.

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

10 years agoSlightly change the help text for some options that involve
Julian Seward [Wed, 3 Sep 2014 21:58:54 +0000 (21:58 +0000)] 
Slightly change the help text for some options that involve
user-supplied enumeration values.

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

10 years agoreaddwarf3.c: Improve error message on bad DW_FORM_GNU_[ref|strp]_alt usage.
Mark Wielaard [Wed, 3 Sep 2014 18:35:28 +0000 (18:35 +0000)] 
readdwarf3.c: Improve error message on bad DW_FORM_GNU_[ref|strp]_alt usage.

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

10 years agonightly/bin/nightly: Handle libc.so being in /lib or /lib64.
Mark Wielaard [Wed, 3 Sep 2014 17:06:05 +0000 (17:06 +0000)] 
nightly/bin/nightly: Handle libc.so being in /lib or /lib64.

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

10 years agoAdd std_thread2.supp to the tarball.
Florian Krohm [Wed, 3 Sep 2014 16:59:43 +0000 (16:59 +0000)] 
Add std_thread2.supp to the tarball.

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

10 years agoAdd a redirection for the 'index' function.
Florian Krohm [Wed, 3 Sep 2014 16:01:10 +0000 (16:01 +0000)] 
Add a redirection for the 'index' function.
Fixes BZ #327943

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

10 years agoImprovements for Android:
Julian Seward [Wed, 3 Sep 2014 15:19:25 +0000 (15:19 +0000)] 
Improvements for Android:

* All Linux targets: add minimal ioctl support for the ION_IOC family

* Android targets: change proprietary-ioctl support for GPUs from
  being a build-time #define kludge to being controlled by --kernel-variant,
  as it should be.  Update documentation accordingly.

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

10 years agoUpdate after more triaging.
Julian Seward [Wed, 3 Sep 2014 07:25:06 +0000 (07:25 +0000)] 
Update after more triaging.

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

10 years agogcc on arm64 -Og produces a (false positive) warning that
Philippe Waroquiers [Tue, 2 Sep 2014 22:20:14 +0000 (22:20 +0000)] 
gcc on arm64 -Og produces a (false positive) warning that
stackPos might be used uninitialised.

Silence gcc by assigning a value to stackPos.
This value must be overriden if a stack description is found.
The fact that the value is overriden is asserted.

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

10 years agofix a typo in NEWS
Philippe Waroquiers [Tue, 2 Sep 2014 20:59:13 +0000 (20:59 +0000)] 
fix a typo in NEWS

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

10 years agoUpdate helgrind default suppression so that it matches with
Philippe Waroquiers [Tue, 2 Sep 2014 20:03:34 +0000 (20:03 +0000)] 
Update helgrind default suppression so that it matches with
both --read-inline-info=yes or =no

Some piece of code in glibc produces an error to be suppressed
with default helgrind supp file.
The stacktrace with inline info is:
==14392== Possible data race during write of size 1 at 0x5BB36A7 by thread #1
==14392== Locks held: none
==14392==    at 0x4C2B3B5: mempcpy (vg_replace_strmem.c:1354)
==14392==    by 0x40107FD: _dl_allocate_tls_init (dl-tls.c:437)
==14392==    by 0x4E3BF0F: get_cached_stack (allocatestack.c:250)
==14392==    by 0x4E3BF0F: allocate_stack (allocatestack.c:486)
==14392==    by 0x4E3BF0F: pthread_create@@GLIBC_2.2.5 (pthread_create.c:460)
==14392==    by 0x4C3039C: pthread_create_WRK (hg_intercepts.c:270)
==14392==    by 0x4C304AB: pthread_create@* (hg_intercepts.c:301)
==14392==    by 0x400926: main (tc22_exit_w_lock.c:42)

stack trace without inline info:
==5432==    at 0x4C2B3B5: mempcpy (vg_replace_strmem.c:1354)
==5432==    by 0x40107FD: _dl_allocate_tls_init (dl-tls.c:437)
==5432==    by 0x4E3BF0F: pthread_create@@GLIBC_2.2.5 (allocatestack.c:250)
==5432==    by 0x4C3039C: pthread_create_WRK (hg_intercepts.c:270)
==5432==    by 0x4C304AB: pthread_create@* (hg_intercepts.c:301)
==5432==    by 0x400926: main (tc22_exit_w_lock.c:42)

The suppression supposed to match the above is:
{
   helgrind---_dl_allocate_tls
   Helgrind:Race
   fun:mempcpy
   fun:_dl_allocate_tls_init
   fun:pthread_create@@GLIBC_2.2*
   fun:pthread_create_WRK
   fun:pthread_create@*
}

This only matches the 2nd stack trace, does not match the one
with inline info.

2 solutions:
* only match the last top 2 fun, i.e. a suppression such as:
{
   helgrind---_dl_allocate_tls
   Helgrind:Race
   fun:mempcpy
   fun:_dl_allocate_tls_init
}

Or alternatively use ...
{
   helgrind---_dl_allocate_tls
   Helgrind:Race
   fun:mempcpy
   fun:_dl_allocate_tls_init
   ...
   fun:pthread_create@@GLIBC_2.2*
   fun:pthread_create_WRK
   fun:pthread_create@*
}

As helgrind suppressions are usually precise and/or use ...,
this last approach chosen

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

10 years agoFix wrong operator = (instead of ==) in assertion
Philippe Waroquiers [Tue, 2 Sep 2014 19:26:40 +0000 (19:26 +0000)] 
Fix wrong operator = (instead of ==) in assertion
Assertion had a side effect (detected by Coverity)

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

10 years agoFix wrong operator (detected by Coverity)
Philippe Waroquiers [Tue, 2 Sep 2014 18:34:25 +0000 (18:34 +0000)] 
Fix wrong operator (detected by Coverity)

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

10 years agoFix a few incorrect format strings. Spotted by the Coverity checker.
Florian Krohm [Tue, 2 Sep 2014 14:21:25 +0000 (14:21 +0000)] 
Fix a few incorrect format strings. Spotted by the Coverity checker.

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

10 years agoAdd support for some more tun/tap ioctls. BZ#315952.
Tom Hughes [Tue, 2 Sep 2014 12:54:29 +0000 (12:54 +0000)] 
Add support for some more tun/tap ioctls. BZ#315952.

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

10 years agoThe 4th parameter of lzo1x_decompress_safe has lzo_uint * type
Florian Krohm [Tue, 2 Sep 2014 12:05:15 +0000 (12:05 +0000)] 
The 4th parameter of lzo1x_decompress_safe has lzo_uint * type
which, despite the name, is a pointer to an unsigned long.
So we should be passing arguments of matching type.
Spotted by the Coverity checker.

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

10 years agoRemove some unneeded checks. These were spotted by the Coverity checker.
Florian Krohm [Tue, 2 Sep 2014 11:58:10 +0000 (11:58 +0000)] 
Remove some unneeded checks. These were spotted by the Coverity checker.

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

10 years agoAvoid memory leak.
Florian Krohm [Tue, 2 Sep 2014 11:38:09 +0000 (11:38 +0000)] 
Avoid memory leak.

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

10 years ago--> 3.10.0.BETA1
Julian Seward [Tue, 2 Sep 2014 10:30:12 +0000 (10:30 +0000)] 
--> 3.10.0.BETA1

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

10 years agoTweak gdbserver_tests/mcinfcallWSRU.stderrB.exp to match more gdb versions.
Mark Wielaard [Tue, 2 Sep 2014 10:16:42 +0000 (10:16 +0000)] 
Tweak gdbserver_tests/mcinfcallWSRU.stderrB.exp to match more gdb versions.

Some gdb versions don't show the source line:number after switching
threads in #0  0x........ in do_burn (). Filter "at line:number" out
and don't expect it.

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

10 years agoAdd a clarifying comment.
Florian Krohm [Tue, 2 Sep 2014 09:49:53 +0000 (09:49 +0000)] 
Add a clarifying comment.

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

10 years agoTidy this up for the 3.10.0 beta.
Julian Seward [Tue, 2 Sep 2014 09:38:27 +0000 (09:38 +0000)] 
Tidy this up for the 3.10.0 beta.

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

10 years agoAdd a ( that was missed in r14419 (Prepare to change the default for
Julian Seward [Mon, 1 Sep 2014 22:37:57 +0000 (22:37 +0000)] 
Add a ( that was missed in r14419 (Prepare to change the default for
--read-inline-info from =no to =yes)

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

10 years agoMake --read-inline-info=yes be the default on Memcheck and Helgrind
Julian Seward [Mon, 1 Sep 2014 22:32:52 +0000 (22:32 +0000)] 
Make --read-inline-info=yes be the default on Memcheck and Helgrind
(just temporarily).

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

10 years agoFollowup to r14392 (fix up of stack bounds semantics) needed to keep
Julian Seward [Mon, 1 Sep 2014 22:31:07 +0000 (22:31 +0000)] 
Followup to r14392 (fix up of stack bounds semantics) needed to keep
the darwin port from asserting at startup.  Patch from PhilippeW.

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

10 years agoVG_(getdents64) is only needed on Linux, and causes build problems
Julian Seward [Mon, 1 Sep 2014 22:26:18 +0000 (22:26 +0000)] 
VG_(getdents64) is only needed on Linux, and causes build problems
on Darwin, so make it exist only on Linux.

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

10 years agoprepare for changing the default of --read-inline-info
Philippe Waroquiers [Mon, 1 Sep 2014 21:52:47 +0000 (21:52 +0000)] 
prepare for changing the default of --read-inline-info
suppvarinfo5 is using suppression entries that explicitely checks
for a stack trace without inline info.
So, indicate to not read the inline info.
This also means we will have (and keep) at least one test testing the
behaviour of --read-inline-info=no

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

10 years agoPrepare to change the default for --read-inline-info from =no to =yes
Philippe Waroquiers [Mon, 1 Sep 2014 21:46:52 +0000 (21:46 +0000)] 
Prepare to change the default for --read-inline-info from =no to =yes

The interception/replacements functions should preferrably not
depend on the value of --read-inline-info.
The idea is to change the default from no to yes.
Depending on the no or yes, some intercept/replacement functions
that are inlined will be shown or not shown in stacktraces.

To have such stack traces not depending on the value of --read-inline-info,
such functions should either be marked as
  noinline
or be defined as macros.

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

10 years agoUpdate list of ignored files.
Florian Krohm [Mon, 1 Sep 2014 21:27:06 +0000 (21:27 +0000)] 
Update list of ignored files.

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

10 years agoAdd a missing VKI_ prefix. No functional change.
Julian Seward [Mon, 1 Sep 2014 21:25:03 +0000 (21:25 +0000)] 
Add a missing VKI_ prefix.  No functional change.

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

10 years agoEM_PPC64 isn't defined by some older Android NDKs. Define it
Julian Seward [Mon, 1 Sep 2014 21:17:01 +0000 (21:17 +0000)] 
EM_PPC64 isn't defined by some older Android NDKs.  Define it
if necessary.

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

10 years agoTidying up (no functional change)
Julian Seward [Mon, 1 Sep 2014 21:16:02 +0000 (21:16 +0000)] 
Tidying up (no functional change)

* add indentation to functions AC_GCC_WARNING_SUBST_NO and
  AC_GCC_WARNING_COND

* remove an extraneous (I hope) "-CFLAGS=$safe_CFLAGS"

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

10 years agoFix bogus bracketing. No functional change.
Julian Seward [Mon, 1 Sep 2014 21:12:44 +0000 (21:12 +0000)] 
Fix bogus bracketing.  No functional change.

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

10 years agoFollowup to r13469. lineno has already been asserted to be != NULL.
Florian Krohm [Mon, 1 Sep 2014 21:03:54 +0000 (21:03 +0000)] 
Followup to r13469.  lineno has already been asserted to be != NULL.
No need to check it again.

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

10 years agoRename a bunch of __unused fields to __unused0, since some Android
Julian Seward [Mon, 1 Sep 2014 20:50:56 +0000 (20:50 +0000)] 
Rename a bunch of __unused fields to __unused0, since some Android
NDK's appear to #define __unused to __attribute__((__unused__)),
causing the build to fail in bizarre ways.

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

10 years agoFix typo in deprecate msg + reformat to 80 char max
Philippe Waroquiers [Mon, 1 Sep 2014 20:47:55 +0000 (20:47 +0000)] 
Fix typo in deprecate msg + reformat to 80 char max

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

10 years agoRemove two extraneous Ls introduced by mistake in r14319, which had
Julian Seward [Mon, 1 Sep 2014 19:32:07 +0000 (19:32 +0000)] 
Remove two extraneous Ls introduced by mistake in r14319, which had
the effect of causing CFLAGS environment variable settings to be
ignored for certain parts of the build (genoffsets.c, for one).

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

10 years agomips64: add missing system call numbers
Petar Jovanovic [Mon, 1 Sep 2014 16:47:34 +0000 (16:47 +0000)] 
mips64: add missing system call numbers

r14384 introduced use of getdents64 syscall and we missed a system call
value for MIPS64, so it broke the build for it. Add missing values now.

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

10 years agoFix a comment. No functional change.
Florian Krohm [Mon, 1 Sep 2014 15:56:05 +0000 (15:56 +0000)] 
Fix a comment. No functional change.

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

10 years agoBug 338703 helgrind on arm-linux gets false positives in dynamic loader.
Mark Wielaard [Mon, 1 Sep 2014 15:29:55 +0000 (15:29 +0000)] 
Bug 338703 helgrind on arm-linux gets false positives in dynamic loader.

There are a couple of issues with helgrind on arm-linux with glibc:

- Thread creation stack traces cannot unwind through clone
  (cfi ends right after syscall)
- ld.so has a special "hard float" name that isn't recognized as special
  (ld-linux-armhf.so.3)
- Races are found when manipulating GOT sections.

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

10 years agoAdjust cmdline expected test output after r14401 BZ#337871.
Mark Wielaard [Mon, 1 Sep 2014 14:16:49 +0000 (14:16 +0000)] 
Adjust cmdline expected test output after r14401 BZ#337871.

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

10 years agoTrack vex r2939 (renaming and arg-order change for Iop_Extract{64,V128}).
Julian Seward [Mon, 1 Sep 2014 11:34:32 +0000 (11:34 +0000)] 
Track vex r2939 (renaming and arg-order change for Iop_Extract{64,V128}).

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

10 years agoRemove memory (load/store) tests from integer.c and move them
Julian Seward [Mon, 1 Sep 2014 09:35:42 +0000 (09:35 +0000)] 
Remove memory (load/store) tests from integer.c and move them
into their own file, memory.c.

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

10 years agoRemove unused variable.
Julian Seward [Mon, 1 Sep 2014 08:41:43 +0000 (08:41 +0000)] 
Remove unused variable.

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

10 years agoDeprecate --db-attach Fixes BZ #337871
Florian Krohm [Mon, 1 Sep 2014 06:37:07 +0000 (06:37 +0000)] 
Deprecate --db-attach   Fixes BZ #337871

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

10 years agoUpdate list of ignored files.
Florian Krohm [Mon, 1 Sep 2014 06:30:34 +0000 (06:30 +0000)] 
Update list of ignored files.

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

10 years agoImprove description of an address that is on a stack but below sp.
Philippe Waroquiers [Sun, 31 Aug 2014 22:27:19 +0000 (22:27 +0000)] 
Improve description of an address that is on a stack but below sp.

An address below the sp will be described as being on a stack, but below sp.

The stack for such an address is found in the registered stacks.

Also, if there is a guard page at the end of the stack (lowest address)
an address in this page will be described as being in thread guard page.
A guard page is recognised as being a page not readable/writable/executable.

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

10 years agoBug 338681 Enable clone backtrace hack for i386-linux in helgrind.
Mark Wielaard [Sat, 30 Aug 2014 20:37:40 +0000 (20:37 +0000)] 
Bug 338681 Enable clone backtrace hack for i386-linux in helgrind.

glibc doesn't provide CFI unwind information right after the clone call
(because it would be invalid in the child). Enable the same workaround
for i386-linux that is already used for amd64-linux (subtract 3 from ip).

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

10 years agoFix (kludge) stack unwinding through clone on arm64-linux. This is
Julian Seward [Sat, 30 Aug 2014 19:24:05 +0000 (19:24 +0000)] 
Fix (kludge) stack unwinding through clone on arm64-linux.  This is
the same problem as shown in #338681, except for arm64-linux instead
of x86-linux.

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

10 years agoHelgrind needs to know the soname of ld.so, and on arm64-linux
Julian Seward [Sat, 30 Aug 2014 19:21:48 +0000 (19:21 +0000)] 
Helgrind needs to know the soname of ld.so, and on arm64-linux
it is different (ld-linux-aarch64.so.1) from all other targets.
(Why?)  This makes Helgrind at least somewhat usable on arm64-linux.

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

10 years agoInitial triage pass for all remaining newly opened bugs.
Julian Seward [Sat, 30 Aug 2014 10:09:30 +0000 (10:09 +0000)] 
Initial triage pass for all remaining newly opened bugs.

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

10 years agodrd/tests/pth_create_chain: Reduce stack usage
Bart Van Assche [Sat, 30 Aug 2014 06:48:01 +0000 (06:48 +0000)] 
drd/tests/pth_create_chain: Reduce stack usage

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

10 years agodocument in NEWS the fact that stack registration start/end boundaries
Philippe Waroquiers [Fri, 29 Aug 2014 23:24:20 +0000 (23:24 +0000)] 
document in NEWS the fact that stack registration start/end boundaries
are the lowest/highest addressable bytes

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

10 years agoThe semantic of the stack bounds is not consistent or is not described.
Philippe Waroquiers [Fri, 29 Aug 2014 22:53:19 +0000 (22:53 +0000)] 
The semantic of the stack bounds is not consistent or is not described.
At various places, there were either some assumption that the 'end'
boundary (highest address) was either not included, included,
or was the highest addressable word, or the highest addressable byte.
This e.g. was very visible when doing:
  ./vg-in-place -d -d ./helgrind/tests/tc01_simple_race|&grep regi
giving
  --24040:2:stacks     register 0xBEDB4000-0xBEDB4FFF as stack 0
  --24040:2:stacks     register 0x402C000-0x4A2C000 as stack 1
showing that the main stack end was (on x86) not the highest word
but the highest byte, while for the thread 1, the registered end
was a byte not part of the stack.

The attached patch ensures that stack bounds semantic are documented and
consistent. Also, some of the stack handling code is factorised.

The convention that the patch ensures and documents is:
start is the lowest addressable byte, end is the highest addressable byte.
(the words 'min' and 'max' have been kept when already used, as this wording is
consistent with the new semantic of start/end).

In various debug log, used brackets [ and ] to make clear that
both bounds are included.

The code to guess and register the client stack was duplicated
in all the platform specific syswrap-<plat>-<os>.c files.
Code has been factorised in syswrap-generic.c

The patch has been regression tested on
   x86, amd64, ppc32/64, s390x.
It has been compiled and one test run on arm64.
Not compiled/not tested on darwin, android, mips32/64, arm

More in details, the patch does the following:

coregrind/pub_core_aspacemgr.h
include/valgrind.h
include/pub_tool_machine.h
coregrind/pub_core_scheduler.h
coregrind/pub_core_stacks.h
  - document start/end semantic in various functions
 also in pub_tool_machine.h:
  - replaces unclear 'bottommost address' by 'lowest address'
    (unclear as stack bottom is or at least can be interpreted as
     the 'functional' bottom of the stack, which is the highest
      address for 'stack growing downwards').
coregrind/pub_core_initimg.h
  replace unclear clstack_top by clstack_end
coregrind/m_main.c
  updated to clstack_end

coregrind/pub_core_threadstate.h
  renamed client_stack_highest_word to client_stack_highest_byte
coregrind/m_scheduler/scheduler.c
  computes client_stack_highest_byte as the highest addressable byte
  Update comments in call to VG_(show_sched_status)
coregrind/m_machine.c
coregrind/m_stacktrace.c
  updated to client_stack_highest_byte, and switched
    stack_lowest/highest_word to stack_lowest/highest_byte accordingly

coregrind/m_stacks.c
  clarify semantic of start/end,
  added a comment to indicate why we invert start/end in register call
  (note that the code find_stack_by_addr was already assuming that
  end was included as the checks were doing e.g.
    sp >= i->start && sp <= i->end

coregrind/pub_core_clientstate.h
coregrind/m_clientstate.c
  renames Addr  VG_(clstk_base) to Addr  VG_(clstk_start_base)
    (start to indicate it is the lowest address, base suffix kept
     to indicate it is the initial lowest address).

coregrind/m_initimg/initimg-darwin.c
   updated to  VG_(clstk_start_base)
   replace unclear iicii.clstack_top by iicii.clstack_end
   updated clstack_max_size computation according to both bounds included.

coregrind/m_initimg/initimg-linux.c
   updated to  VG_(clstk_start_base)
   updated VG_(clstk_end) computation according to both bounds included.
   replace unclear iicii.clstack_top by iicii.clstack_end

coregrind/pub_core_aspacemgr.h
  extern Addr VG_(am_startup) : clarify semantic of the returned value
coregrind/m_aspacemgr/aspacemgr-linux.c
   removed a copy of a comment that was already in pub_core_aspacemgr.h
     (avoid double maintenance)
   renamed unclear suggested_clstack_top to suggested_clstack_end
    (note that here, it looks like suggested_clstack_top was already
     the last addressable byte)

* factorisation of the stack guessing and registration causes
  mechanical changes in the following files:
      coregrind/m_syswrap/syswrap-ppc64-linux.c
      coregrind/m_syswrap/syswrap-x86-darwin.c
      coregrind/m_syswrap/syswrap-amd64-linux.c
      coregrind/m_syswrap/syswrap-arm-linux.c
      coregrind/m_syswrap/syswrap-generic.c
      coregrind/m_syswrap/syswrap-mips64-linux.c
      coregrind/m_syswrap/syswrap-ppc32-linux.c
      coregrind/m_syswrap/syswrap-amd64-darwin.c
      coregrind/m_syswrap/syswrap-mips32-linux.c
      coregrind/m_syswrap/priv_syswrap-generic.h
      coregrind/m_syswrap/syswrap-x86-linux.c
      coregrind/m_syswrap/syswrap-s390x-linux.c
      coregrind/m_syswrap/syswrap-darwin.c
      coregrind/m_syswrap/syswrap-arm64-linux.c
 Some files to look at more in details:
  syswrap-darwin.c : the handling of sysctl(kern.usrstack) looked
    buggy to me, and has probably be made correct by the fact that
     VG_(clstk_end) is now the last addressable byte. However,unsure
    about this, as I could not find any documentation about
    sysctl(kern.usrstack). I only find several occurences on the web,
    showing that the result of this is page aligned, which I guess
    means it must be 1+ the last addressable byte.
  syswrap-x86-darwin.c and syswrap-amd64-darwin.c
   I suspect the code that was computing client_stack_highest_word
   was wrong, and the patch makes it correct.
  syswrap-mips64-linux.c
    not sure what to do for this code. This is the only code
    that was guessing the stack differently from others.
    Kept (almost) untouched. To be discussed with mips maintainers.

coregrind/pub_core_libcassert.h
coregrind/m_libcassert.c
  * void VG_(show_sched_status):
     renamed Bool valgrind_stack_usage to Bool stack_usage
     if stack_usage, shows both the valgrind stack usage and
     the client stack boundaries
coregrind/m_scheduler/scheduler.c
coregrind/m_gdbserver/server.c
coregrind/m_gdbserver/remote-utils.c
   Updated comments in callers to VG_(show_sched_status)

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

10 years agomake prereq fail with 1 if host command not installed
Philippe Waroquiers [Fri, 29 Aug 2014 22:49:21 +0000 (22:49 +0000)] 
make prereq fail with 1 if host command not installed
as prereq must return 0 or 1. Any other return value aborts the regtests.

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

10 years agoAdd missing file in EXTRA_DIST
Philippe Waroquiers [Fri, 29 Aug 2014 22:48:27 +0000 (22:48 +0000)] 
Add missing file in EXTRA_DIST

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