]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
13 years agoAdd support for the HCIINQUIRY ioctl.
Tom Hughes [Wed, 7 Mar 2012 11:22:42 +0000 (11:22 +0000)] 
Add support for the HCIINQUIRY ioctl.
Patch from Andrew Brampton to fix BZ#283961.

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

13 years agoAdd support for the I2C_RDWR ioctl.
Tom Hughes [Wed, 7 Mar 2012 10:21:33 +0000 (10:21 +0000)] 
Add support for the I2C_RDWR ioctl.
Patch from arnaud mouiche to fix BZ#286261.

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

13 years agoFix leak of range_list (see below an example) in readdwarf3.c.
Philippe Waroquiers [Tue, 6 Mar 2012 20:35:20 +0000 (20:35 +0000)] 
Fix leak of range_list (see below an example) in readdwarf3.c.
(found by running regression tests with an outer memcheck).

(validated by running all regression tests "natively" on x86 and amd64,
and re-running regressions tests with outer memcheck).

==7500== 160 bytes in 2 blocks are definitely lost in loss record 75 of 246
==7500==    at 0x2803CEF7: vgPlain_arena_malloc (m_mallocfree.c:1599)
==7500==    by 0x280AAFA5: vgModuleLocal_dinfo_zalloc (misc.c:48)
==7500==    by 0x2804E2A4: vgPlain_newXA (m_xarray.c:68)
==7500==    by 0x280B3CD6: unitary_range_list (readdwarf3.c:703)
==7500==    by 0x280B66CF: parse_var_DIE (readdwarf3.c:1631)
==7500==    by 0x280BA0A6: read_DIE (readdwarf3.c:3248)
==7500==    by 0x280BA170: read_DIE (readdwarf3.c:3269)
==7500==    by 0x280BABC4: T.364 (readdwarf3.c:3611)
==7500==    by 0x280BC634: vgModuleLocal_new_dwarf3_reader (readdwarf3.c:4035)
==7500==    by 0x280609F4: vgModuleLocal_read_elf_debug_info (readelf.c:2529)
==7500==    by 0x2805BD31: vgPlain_di_notify_mmap (debuginfo.c:610)
==7500==    by 0x280362E3: valgrind_main (m_main.c:1944)

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

13 years agoUpdate bug reporting URL.
Florian Krohm [Tue, 6 Mar 2012 15:54:28 +0000 (15:54 +0000)] 
Update bug reporting URL.

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

13 years agoFix a testcase. Constraint was incorrect allowing r0 to be used
Florian Krohm [Mon, 5 Mar 2012 23:12:47 +0000 (23:12 +0000)] 
Fix a testcase. Constraint was incorrect allowing r0 to be used
for the EX insn. Patch by Christian Borntraeger (borntraeger@de.ibm.com).

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

13 years ago* Improve documentation of --vgdb=full
Philippe Waroquiers [Mon, 5 Mar 2012 22:09:20 +0000 (22:09 +0000)] 
* Improve documentation of --vgdb=full
* make a reference to --vex-iropt-precise-memory-exns=yes
  to obtain up to date registers values.

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

13 years agoAvoid possibly unaligned memory access.
Florian Krohm [Sat, 3 Mar 2012 18:46:05 +0000 (18:46 +0000)] 
Avoid possibly unaligned memory access.

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

13 years ago* README_DEVELOPERS : complete/enhance the section about outer/inner
Philippe Waroquiers [Sat, 3 Mar 2012 12:01:48 +0000 (12:01 +0000)] 
* README_DEVELOPERS : complete/enhance the section about outer/inner
* manual-core.xml : fix a typo
* include/pub_tool_inner.h : new file, defining macros for inner annotation
  include/Makefile.am : reference this new file.
* syswrap-linux.c : when ENABLE_INNER, register the stacks for the outer.
   (otherwise, nothing works properly).
* m_redir.c : avoid inner interpreting the outer vgpreload instructions.
* sema.c : annotate the semaphore with RWLOCK annotations for helgrind
* ticket-lock-linux.c : similar.

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

13 years agonone/tests/mq.c: Fix a copy-paste bug
Bart Van Assche [Fri, 2 Mar 2012 09:57:14 +0000 (09:57 +0000)] 
none/tests/mq.c: Fix a copy-paste bug

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

13 years agoIn case VALGRIND_MALLOCLIKE_BLOCK is wrongly used, output
Philippe Waroquiers [Thu, 1 Mar 2012 22:00:36 +0000 (22:00 +0000)] 
In case VALGRIND_MALLOCLIKE_BLOCK is wrongly used, output
the execontext where the overlapping blocks have been reported
before crashing.

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

13 years agoHandle prlimit64 the same way we do getrlimit and setrlimit, with
Tom Hughes [Thu, 1 Mar 2012 13:42:18 +0000 (13:42 +0000)] 
Handle prlimit64 the same way we do getrlimit and setrlimit, with
some requests trapped and handled by valgrind.

Patch from Matthias Schwarzott via BZ#294047.

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

13 years agoAfter a fork, gdbserver_init can be called again.
Philippe Waroquiers [Tue, 28 Feb 2012 22:37:44 +0000 (22:37 +0000)] 
After a fork, gdbserver_init can be called again.
Buffers should not be re-allocated in such a case.
(memory leak detected by running memcheck on memcheck)

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

13 years agoFix leak found by running memcheck/tests/varinfo[1-6].vgtest
Philippe Waroquiers [Tue, 28 Feb 2012 20:10:05 +0000 (20:10 +0000)] 
Fix leak found by running memcheck/tests/varinfo[1-6].vgtest

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

13 years agoIncrease the size of buffers used for showing names when
Julian Seward [Tue, 28 Feb 2012 18:02:41 +0000 (18:02 +0000)] 
Increase the size of buffers used for showing names when
--trace-flags= is set.

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

13 years agoFix one more leak detected by running memcheck in memcheck
Philippe Waroquiers [Mon, 27 Feb 2012 21:52:45 +0000 (21:52 +0000)] 
Fix one more leak detected by running memcheck in memcheck
(started to run regression tests in an outer)

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

13 years agoAndroid only: make the debuginfo mapping hack more flexible.
Julian Seward [Mon, 27 Feb 2012 11:02:20 +0000 (11:02 +0000)] 
Android only: make the debuginfo mapping hack more flexible.
Previously it looked for the debuginfo object for "/system/X" in
"/sdcard/symbols/system/X".  This commit removes the requirement for
"system" as the first path component, so the mapping is now "/X" (viz,
any absolute path) to "/sdcard/symbols/X".

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

13 years agoFix some memory leaks found by running memcheck on annotated memcheck.
Philippe Waroquiers [Sun, 26 Feb 2012 21:26:00 +0000 (21:26 +0000)] 
Fix some memory leaks found by running memcheck on annotated memcheck.

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

13 years agoTighten up initial guest/shodow state on s390x.
Florian Krohm [Sun, 26 Feb 2012 17:51:28 +0000 (17:51 +0000)] 
Tighten up initial guest/shodow state on s390x.

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

13 years agoAnnounce.
Florian Krohm [Sun, 26 Feb 2012 17:01:22 +0000 (17:01 +0000)] 
Announce.

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

13 years agoFix buffer overflow bug when building the target file.
Philippe Waroquiers [Fri, 24 Feb 2012 11:25:58 +0000 (11:25 +0000)] 
Fix buffer overflow bug when building the target file.

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

13 years agoRevision 12396 (replacing pkglib_DATA by vglib_DATA) missed
Philippe Waroquiers [Fri, 24 Feb 2012 08:33:56 +0000 (08:33 +0000)] 
Revision 12396 (replacing pkglib_DATA by vglib_DATA) missed
once place. This was breaking vg-in-place on platforms
needing gdbserver target description files.

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

13 years agoFedora 17 is merging /lib into /usr/lib so any suppression which
Tom Hughes [Thu, 23 Feb 2012 12:54:50 +0000 (12:54 +0000)] 
Fedora 17 is merging /lib into /usr/lib so any suppression which
explicitly matches /lib/... needs to match /usr/lib/... as well.

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

13 years agoImplement malloc_size for the vg_default_zone on Darwin.
Julian Seward [Thu, 23 Feb 2012 07:36:03 +0000 (07:36 +0000)] 
Implement malloc_size for the vg_default_zone on Darwin.

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

13 years agoDocument the new --fair-sched option.
Philippe Waroquiers [Wed, 22 Feb 2012 20:23:29 +0000 (20:23 +0000)] 
Document the new --fair-sched option.

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

13 years agoAvoid having holes in the VgdbShared struct.
Philippe Waroquiers [Wed, 22 Feb 2012 19:47:27 +0000 (19:47 +0000)] 
Avoid having holes in the VgdbShared struct.

These holes are not initialized,
and writing these uninitialised bytes to the mapped file
causes an error being reported when running Valgrind
inside Valgrind. Having no holes avoid having this error.

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

13 years agoHide our use of pkglibdir to stop automake 1.11.2 and later complaining.
Tom Hughes [Tue, 21 Feb 2012 15:53:35 +0000 (15:53 +0000)] 
Hide our use of pkglibdir to stop automake 1.11.2 and later complaining.

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

13 years agoAdd test cases for MPSADBW. See #294048.
Julian Seward [Tue, 21 Feb 2012 11:03:38 +0000 (11:03 +0000)] 
Add test cases for MPSADBW.  See #294048.

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

13 years agox86: don't forget to initialise guest %es from the host %es when
Julian Seward [Tue, 21 Feb 2012 08:38:04 +0000 (08:38 +0000)] 
x86: don't forget to initialise guest %es from the host %es when
constructing the initial guest register state.  Fixes #291253.

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

13 years agoARM/Thumb only: fix a bug in which stack unwinding halts in some
Julian Seward [Mon, 20 Feb 2012 15:33:24 +0000 (15:33 +0000)] 
ARM/Thumb only: fix a bug in which stack unwinding halts in some
functions that do FP arithmetic.  This is due to the Dwarf3 CFI
mentioning Dwarf registers above N_CFI_REGS, in particular FP
registers, which have values of about 80.  This fixes the problem by
increasing N_CFI_REGS to a level that covers all known registers.
(n-i-bz)

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

13 years agoWith the change in VEX r2258 the guest IA will now also be accessed
Florian Krohm [Mon, 20 Feb 2012 15:03:02 +0000 (15:03 +0000)] 
With the change in VEX r2258 the guest IA will now also be accessed
in the low word only. Adjust code accordingly.

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

13 years agoUpdate status and build instructions for ICS (Android 4.0.3).
Julian Seward [Fri, 17 Feb 2012 15:13:55 +0000 (15:13 +0000)] 
Update status and build instructions for ICS (Android 4.0.3).

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

13 years agoAdd test cases for PHMINPOSUW (SSE 4.1). See #287301.
Julian Seward [Thu, 16 Feb 2012 22:02:47 +0000 (22:02 +0000)] 
Add test cases for PHMINPOSUW (SSE 4.1).  See #287301.

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

13 years agoAdd test cases for 16 bit PCMPxSTRx variants. See #293754.
Julian Seward [Thu, 16 Feb 2012 15:24:17 +0000 (15:24 +0000)] 
Add test cases for 16 bit PCMPxSTRx variants.  See #293754.
(Eliot Moss, moss@cs.umass.edu)

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

13 years ago* compare vgdb-error with n_errs_shown, not with n_errs_found.
Philippe Waroquiers [Wed, 15 Feb 2012 22:29:30 +0000 (22:29 +0000)] 
* compare vgdb-error with n_errs_shown, not with n_errs_found.
  Using n_errs_shown allows the user to stop on an error
  identified in a previous run by counting errors shown.
* shows also n_errs_shown in monitor command v.info n_errs_found
* slightly clarified the manual, updated to new output of v.info n_errs_found

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

13 years agoAnnounce bug fix.
Florian Krohm [Wed, 15 Feb 2012 04:05:52 +0000 (04:05 +0000)] 
Announce bug fix.

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

13 years agoUse LC_ALL=C for a controlled environment.
Florian Krohm [Wed, 15 Feb 2012 03:57:27 +0000 (03:57 +0000)] 
Use LC_ALL=C for a controlled environment.
Patch by zzam@gentoo.org. Fixes #294055.

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

13 years agoWire up a few more syscalls.
Florian Krohm [Wed, 15 Feb 2012 03:32:50 +0000 (03:32 +0000)] 
Wire up a few more syscalls.
Patch by Christian Borntraeger (borntraeger@de.ibm.com).

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

13 years ago* fix Bug 290655 - Add support for AESKEYGENASSIST instruction
Philippe Waroquiers [Tue, 14 Feb 2012 21:35:46 +0000 (21:35 +0000)] 
* fix Bug 290655 - Add support for AESKEYGENASSIST instruction
  (Valgrind part : test for AES instructions (AESKEYGENASSIST, AESIMC,
  AESENC, AESENCLAST, AESDEC, AESDECLAST).

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

13 years agoChange the garbage collection policy for the secondary VBit table
Julian Seward [Tue, 14 Feb 2012 12:11:47 +0000 (12:11 +0000)] 
Change the garbage collection policy for the secondary VBit table
(that holds partially defined bytes), to GC more aggressively.
Details in the comments.  This largely avoids a sometimes massive
space leak, that has been observed (eg) running the Firefox test suite
on Memcheck.  Without this patch it cannot complete with 4 million
nodes in the table; with the patch it completes comfortably with 50000
ish nodes.  This reduces the total memory use needed for the run
from above 7GB down to 6.2GB.

Smaller improvements have been seen with other programs too.  Speed
does not appear to be negatively affected.

(Based on a patch, and analysis of the problem, by Philippe Waroquiers.)

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

13 years agoUpdate Subversion ignore list
Bart Van Assche [Mon, 13 Feb 2012 08:50:32 +0000 (08:50 +0000)] 
Update Subversion ignore list

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

13 years agonightly build: Run nightly build also if only VEX has been modified. Check out matchi...
Bart Van Assche [Mon, 13 Feb 2012 08:47:51 +0000 (08:47 +0000)] 
nightly build: Run nightly build also if only VEX has been modified. Check out matching revisions of Valgrind and VEX instead of using latest VEX when checking out the (today - 1) source code.

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

13 years agoOnly mark data which has actually been filled in by recvmsg as defined.
Tom Hughes [Fri, 10 Feb 2012 16:45:01 +0000 (16:45 +0000)] 
Only mark data which has actually been filled in by recvmsg as defined.

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

13 years agoImprove messages for mmsg calls.
Tom Hughes [Fri, 10 Feb 2012 11:54:16 +0000 (11:54 +0000)] 
Improve messages for mmsg calls.

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

13 years agoCorrect system call name.
Tom Hughes [Fri, 10 Feb 2012 11:50:36 +0000 (11:50 +0000)] 
Correct system call name.

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

13 years agoIt turns out sendmmsg also updates the msg_len fields.
Tom Hughes [Fri, 10 Feb 2012 11:48:01 +0000 (11:48 +0000)] 
It turns out sendmmsg also updates the msg_len fields.

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

13 years agoAdd support for the sendmmsg and recvmmsg system calls. Fixes BZ#277779.
Tom Hughes [Fri, 10 Feb 2012 11:30:09 +0000 (11:30 +0000)] 
Add support for the sendmmsg and recvmmsg system calls. Fixes BZ#277779.

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

13 years agoAdd support for some SCSI ioctls. Patch from Jakub Jelinek on BZ#292627.
Tom Hughes [Fri, 10 Feb 2012 10:41:07 +0000 (10:41 +0000)] 
Add support for some SCSI ioctls. Patch from Jakub Jelinek on BZ#292627.

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

13 years agoAdd support for process_vm_readv and process_vm_writev system calls.
Tom Hughes [Fri, 10 Feb 2012 09:39:37 +0000 (09:39 +0000)] 
Add support for process_vm_readv and process_vm_writev system calls.
Patch from Lénaïc Huard to fix BZ#292995.

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

13 years agoAdd support for the F_GETOWN_EX and F_SETOWN_EX fcntl calls.
Tom Hughes [Thu, 9 Feb 2012 12:21:47 +0000 (12:21 +0000)] 
Add support for the F_GETOWN_EX and F_SETOWN_EX fcntl calls.
Patch from Jakub Jelinek to fix BZ#292626.

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

13 years agoImplement the getcpu vsyscall on amd64 by forwarding it to the real
Tom Hughes [Thu, 9 Feb 2012 11:54:16 +0000 (11:54 +0000)] 
Implement the getcpu vsyscall on amd64 by forwarding it to the real
system call. Patch from Lénaïc Huard to fix BZ#187043.

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

13 years agoWire up getcpu on amd64. Patch from Lénaïc Huard to close BZ#292993.
Tom Hughes [Thu, 9 Feb 2012 11:48:28 +0000 (11:48 +0000)] 
Wire up getcpu on amd64. Patch from Lénaïc Huard to close BZ#292993.

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

13 years agoUpdate linux system call lists.
Tom Hughes [Thu, 9 Feb 2012 11:38:10 +0000 (11:38 +0000)] 
Update linux system call lists.

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

13 years agomc_main.c statistics has hard-coded logic to compute
Philippe Waroquiers [Wed, 8 Feb 2012 22:23:55 +0000 (22:23 +0000)] 
mc_main.c statistics has hard-coded logic to compute
the memory used by sec vbit table. This logic depends
on the way sec Vbit entries are maintained.
Due to the introduction of pool alloc, this logic has
to be changed to (more) correctly compute the memory.

Verified on f12/x86 by comparing the memory reported
by the memcheck stats with what is given by --profile-heap=yes.

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

13 years agoAdd testcases for TR, TRE, TRTT, TROT, TRTO insns.
Florian Krohm [Sat, 4 Feb 2012 17:16:40 +0000 (17:16 +0000)] 
Add testcases for TR, TRE, TRTT, TROT, TRTO insns.
Fixes #273114. Patch by Divya Vyas (divyvyas@linux.vnet.ibm.com).

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

13 years agoAdd z10 EC build.
Florian Krohm [Sat, 4 Feb 2012 14:40:44 +0000 (14:40 +0000)] 
Add z10 EC build.

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

13 years agofix 290974 vgdb must align pages to VKI_SHMLBA (16KB) on ARM
Philippe Waroquiers [Thu, 2 Feb 2012 21:33:55 +0000 (21:33 +0000)] 
fix 290974  vgdb must align pages to VKI_SHMLBA (16KB) on ARM
In VG_(am_mmap_file_float_valgrind_flags),
when VKI_MAP_SHARED & flags, ensure the request length is big enough
to allow to roundup the returned advised to VKI_SHMLBA if needed.

Committed after regtest on f12/x86 and some limited validation on android arm
emulator.

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

13 years agoRework r12363
Bart Van Assche [Thu, 2 Feb 2012 10:58:01 +0000 (10:58 +0000)] 
Rework r12363

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

13 years agodrd/tests/sigalrm: Report thread creation failure
Bart Van Assche [Thu, 2 Feb 2012 10:35:18 +0000 (10:35 +0000)] 
drd/tests/sigalrm: Report thread creation failure

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

13 years agodrd: Avoid that an assertion failure is triggered if clone() fails.
Bart Van Assche [Thu, 2 Feb 2012 10:14:30 +0000 (10:14 +0000)] 
drd: Avoid that an assertion failure is triggered if clone() fails.

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

13 years agodebug info reader: Add support for rvalue references. Closes #278313#c5.
Bart Van Assche [Wed, 1 Feb 2012 14:59:14 +0000 (14:59 +0000)] 
debug info reader: Add support for rvalue references. Closes #278313#c5.

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

13 years ago<valgrind/valgrind.h>: Fix for Intel C/C++ compiler in MSVC compatibility mode.
Bart Van Assche [Tue, 31 Jan 2012 10:13:51 +0000 (10:13 +0000)] 
<valgrind/valgrind.h>: Fix for Intel C/C++ compiler in MSVC compatibility mode.

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

13 years agoMake -d (enable debug logging) work on Fedora 16 / x86.
Bart Van Assche [Mon, 30 Jan 2012 15:07:20 +0000 (15:07 +0000)] 
Make -d (enable debug logging) work on Fedora 16 / x86.

Apparently the 32-bit Fedora 16 compiler chooses register esp to pass "&block"
to the inline assembly code in local_sys_write_stderr(). First pushing data on
the stack and next reading the contents of %0 doesn't yield the desired result
if %0 == %esp.

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

13 years agoAdd testcase for bugzilla #287260. Testcase by M.Welinder
Florian Krohm [Sun, 29 Jan 2012 02:23:07 +0000 (02:23 +0000)] 
Add testcase for bugzilla #287260. Testcase by M.Welinder
(mwelinder@gmail.com). Announce bug fix.

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

13 years agonone/tests/x86/bug125959-x86 language conformance fix: do not trigger signed integer...
Bart Van Assche [Sat, 28 Jan 2012 14:20:30 +0000 (14:20 +0000)] 
none/tests/x86/bug125959-x86 language conformance fix: do not trigger signed integer overflow. Fixes #292628.

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

13 years ago(fixes bug 289939 wish: complete monitor cmd 'leak_check' with details
Philippe Waroquiers [Thu, 26 Jan 2012 23:13:52 +0000 (23:13 +0000)] 
(fixes bug 289939 wish: complete monitor cmd 'leak_check' with details
 about leaked or reachable blocks)

This patch implements two new memcheck gdbserver monitor commands:
  block_list <loss_record_nr>
        after a leak search, shows the list of blocks of <loss_record_nr>
  who_points_at <addr> [<len>]
        shows places pointing inside <len> (default 1) bytes at <addr>
        (with len 1, only shows "start pointers" pointing exactly to <addr>,
         with len > 1, will also show "interior pointers")

Compiled and reg-tested on f12/x86, deb5/amd64, f16/ppc64.

The 'block_list' command is implemented on top of the
lr_array/lc_chunks/lc_extras arrays used during the last leak search.
NB: no impact on the memory for the typical Valgrind usage where a leak
search is only done at the end of the run.
Printing the block_list of a loss record simply consists in scanning the
lc_chunks to find back the chunks corresponding to the loss record for which
block lists is requested.

The 'who_points_at' command is implemented by doing a scan similar to
(but simpler than) the leak search scan.
lc_scan_memory has been enhanced to have a mode to search for a specific
address, rather than to search for all allocated blocks.
VG_(apply_to_GP_regs) has been enhanced to also provide the ThreadId and
register name in the callback function.

The patch touches multiple files (but most changes are easy/trivial or factorise
existing code).

Most significant changes are in memcheck/mc_leakcheck.c :
    * changed the LC_Extra struct to remember the clique for indirect leaks
      (size of structure not changed).
    * made lr_array a static global
    * changed lc_scan_memory:
        to have a search mode for a specific address (for who_points_at)
        (for leak search) to pass a 'current clique' in addition to the clique
         leader
         so as to have a proper clique hierarchy for indirectly leaked blocks.
    * print_results: reset values at the beginning of the print_result of the
      next leak search, rather than at the end of print_results of the previous
       leak search.
      This allows to continue showing the same info for loss records till a new
      leak search is done.
    * new function print_clique which recursively prints a group of leaked
      blocks, starting from the clique leader.
    * new function MC_(print_block_list) : calls print_clique for each clique
      leader found for the given loss record.
    * static void scan_memory_root_set : code extracted from
      MC_(detect_memory_leaks) (no relevant change)
    * void MC_(who_points_at) : calls scan_memory_root_set, lc_scan_memory
        and VG_(apply_to_GP_regs)(search_address_in_GP_reg) to search
        pointers to the given address.

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

13 years agodrd: Remove drd/drd_list.h again because of its GPLv2 license.
Bart Van Assche [Wed, 25 Jan 2012 20:36:27 +0000 (20:36 +0000)] 
drd: Remove drd/drd_list.h again because of its GPLv2 license.

For more info about Valgrind source code licensing, see also:
[1] Top level README line 51.
[2] http://valgrind.org/docs/manual/manual-intro.html#manual-intro.overview, last paragraph.

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

13 years agoFix a copy/paste error
Bart Van Assche [Wed, 25 Jan 2012 11:05:12 +0000 (11:05 +0000)] 
Fix a copy/paste error

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

13 years agodrd: Add command-line option --ptrace-addr.
Bart Van Assche [Tue, 24 Jan 2012 18:39:29 +0000 (18:39 +0000)] 
drd: Add command-line option --ptrace-addr.

This command-line option has been used to track down the recently fixed race in
drd/drd_pthread_intercepts.c.

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

13 years agodrd: Use macros and inline functions for list manipulation
Bart Van Assche [Tue, 24 Jan 2012 18:28:55 +0000 (18:28 +0000)] 
drd: Use macros and inline functions for list manipulation

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

13 years agodrd: Avoid that the changes from r12351 trigger a race condition when copying DrdPosi...
Bart Van Assche [Tue, 24 Jan 2012 08:30:32 +0000 (08:30 +0000)] 
drd: Avoid that the changes from r12351 trigger a race condition when copying DrdPosixThreadArgs

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

13 years agodrd, semaphore implementation: Only wake the associated futex if at least one thread...
Bart Van Assche [Mon, 23 Jan 2012 17:01:58 +0000 (17:01 +0000)] 
drd, semaphore implementation: Only wake the associated futex if at least one thread is waiting

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

13 years agodrd: Source code refactoring - use DRD_(thread_get_vc)() wherever appropriate
Bart Van Assche [Sun, 22 Jan 2012 08:58:31 +0000 (08:58 +0000)] 
drd: Source code refactoring - use DRD_(thread_get_vc)() wherever appropriate

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

13 years agodrd: Source code refactoring - use DRD_(thread_get_vc)() wherever appropriate
Bart Van Assche [Sun, 22 Jan 2012 08:40:42 +0000 (08:40 +0000)] 
drd: Source code refactoring - use DRD_(thread_get_vc)() wherever appropriate

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

13 years agodrd: Rename DRD_STOP_TRACE_VAR() into DRD_STOP_TRACING_VAR()
Bart Van Assche [Sat, 21 Jan 2012 18:33:56 +0000 (18:33 +0000)] 
drd: Rename DRD_STOP_TRACE_VAR() into DRD_STOP_TRACING_VAR()

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

13 years agodrd/tests/fp_race_xml: Filter out thread number and vector clock information
Bart Van Assche [Fri, 20 Jan 2012 09:27:15 +0000 (09:27 +0000)] 
drd/tests/fp_race_xml: Filter out thread number and vector clock information

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

13 years agodrd: Fix a race condition in the pthread_create() intercept.
Bart Van Assche [Thu, 19 Jan 2012 19:52:15 +0000 (19:52 +0000)] 
drd: Fix a race condition in the pthread_create() intercept.

Avoid that the futex wake call in DRD_(sema_up)() can get invoked after the semaphore has
already been destroyed. This is most likely the real fix for the bug described in the
commit message of r12332.

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

13 years agodrd: Generalize a suppression pattern
Bart Van Assche [Wed, 18 Jan 2012 09:47:12 +0000 (09:47 +0000)] 
drd: Generalize a suppression pattern

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

13 years agodrd: Switch to new pool allocator
Bart Van Assche [Wed, 18 Jan 2012 09:46:57 +0000 (09:46 +0000)] 
drd: Switch to new pool allocator

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

13 years agoPool allocator: change the semantics of VG_(releasePA)() according to comment http...
Bart Van Assche [Wed, 18 Jan 2012 08:12:16 +0000 (08:12 +0000)] 
Pool allocator: change the semantics of VG_(releasePA)() according to comment http://bugs.kde.org/show_bug.cgi?id=282230#c50.
This change also makes the semantics of releasePA match the semantics of
other release functions, e.g. those in XPCOM (see also http://developer.mozilla.org/en/XPCOM_Interface_Reference/nsISupports#Release%28%29).

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

13 years agoAdd a perf test to measure the speed (and memory) of PDB handling.
Philippe Waroquiers [Tue, 17 Jan 2012 22:27:47 +0000 (22:27 +0000)] 
Add a perf test to measure the speed (and memory) of PDB handling.

* modified perf/heap.c so that it optionally creates a partially defined bytes every N bytes
* created perf/heap_pdb4.vgperf calling heap 4 (so one byte on 4 is PDB in what heap allocates).

before/after pool alloc, here are the performances on a ppc64. So, it looks like
pool alloc also significantly improves the speed of PDB handling.

perl perf/vg_perf --vg=../pool_alloc --vg=../before_pool_trunk_untouched --reps=5 perf/heap_pdb4.vgperf
-- heap_pdb4 --
heap_pdb4 pool_alloc:0.41s  no: 3.0s ( 7.3x, -----)  me:11.9s (29.0x, -----)
heap_pdb4 before_pool_trunk_untouched:0.41s  no: 3.1s ( 7.6x, -3.7%)  me:16.9s (41.1x,-41.7%)

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

13 years agoFixes 282230 group allocator for small fixed size, use it for MC_Chunk/SEc vbit
Philippe Waroquiers [Tue, 17 Jan 2012 21:16:30 +0000 (21:16 +0000)] 
Fixes 282230  group allocator for small fixed size, use it for MC_Chunk/SEc vbit

* new files include/pub_tool_groupalloc.h and coregrind/m_groupalloc.c
  implementing a group allocator (based on helgrind group alloc).
* include/Makefile.am coregrind/Makefile.am : added pub_tool_groupalloc.h
  and m_groupalloc.c
* helgrind/libhb_core.c : use pub_tool_groupalloc.h/m_groupalloc.c
  instead  of the local implementation.
* include/pub_tool_oset.h coregrind/m_oset.c : new function
  allowing to create an oset that will use a pool allocator.
  new function allowing to clone an oset (so as to share the pool alloc)
* memcheck/tests/unit_oset.c drd/tests/unit_bitmap.c : modified
  so that it compiles with the new m_oset.c
* memcheck/mc_main.c : use group alloc for MC_Chunk
  memcheck/mc_include.h : declare the MC_Chunk group alloc
* memcheck/mc_main.c : use group alloc for the nodes of the secVBitTable OSet
* include/pub_tool_hashtable.h coregrind/m_hashtable.c : pass the free node
  function in the VG_(HT_destruct).
  (needed as the hashtable user can allocate a node with its own alloc,
  the hash table destroy must be able to free the nodes with the user
  own free).
* coregrind/m_gdbserver/m_gdbserver.c : pass free function to VG_(HT_destruct)
* memcheck/mc_replace_strmem.c memcheck/mc_machine.c
  memcheck/mc_malloc_wrappers.c memcheck/mc_leakcheck.c
  memcheck/mc_errors.c memcheck/mc_translate.c : new include needed
  due to group alloc.

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

13 years agoImprove configure for SSE 4.2 detection. Fixes #271438
Florian Krohm [Tue, 17 Jan 2012 13:16:50 +0000 (13:16 +0000)] 
Improve configure for SSE 4.2 detection. Fixes #271438

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

13 years agoAnnounce fix for #270796. Also keep the bug list sorted.
Florian Krohm [Mon, 16 Jan 2012 17:26:48 +0000 (17:26 +0000)] 
Announce fix for #270796. Also keep the bug list sorted.

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

13 years agodebug info reader: Add support for DW_TAG_unspecified_type. Closes #278313.
Bart Van Assche [Mon, 16 Jan 2012 17:11:07 +0000 (17:11 +0000)] 
debug info reader: Add support for DW_TAG_unspecified_type. Closes #278313.

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

13 years agodrd: Remove prefix from local variable names
Bart Van Assche [Mon, 16 Jan 2012 13:08:05 +0000 (13:08 +0000)] 
drd: Remove prefix from local variable names

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

13 years agodebug info reader: rearrange the source code such that gcc issues a warning if an...
Bart Van Assche [Mon, 16 Jan 2012 09:22:25 +0000 (09:22 +0000)] 
debug info reader: rearrange the source code such that gcc issues a warning if an enumeration label is missing.

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

13 years agoAdd support for the s390's TROO insn. These are the valgrind bits.
Florian Krohm [Sun, 15 Jan 2012 21:02:44 +0000 (21:02 +0000)] 
Add support for the s390's TROO insn. These are the valgrind bits.
Detect ETF2 enhancement facility using STFLE. Add testcases.
Patch by Divya Vyas (divyvyas@linux.vnet.ibm.com) with
modifications. Partial fix of #273114

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

13 years agoUpdate Subversion ignore lists
Bart Van Assche [Sun, 15 Jan 2012 19:20:56 +0000 (19:20 +0000)] 
Update Subversion ignore lists

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

13 years agodrd: Make it easier to enable the debug statements in the ELF section suppression...
Bart Van Assche [Sun, 15 Jan 2012 19:17:37 +0000 (19:17 +0000)] 
drd: Make it easier to enable the debug statements in the ELF section suppression code

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

13 years agodrd: Set up red zone before the first instruction of a thread is run.
Bart Van Assche [Sun, 15 Jan 2012 19:13:35 +0000 (19:13 +0000)] 
drd: Set up red zone before the first instruction of a thread is run.

Avoids that DRD sporadically reports mysterious false positive conflicting accesses on
amd64 like e.g. the following:

$ ./vg-in-place --fair-sched=yes --tool=drd --read-var-info=yes --check-stack-var=yes --show-confl-seg=no drd/tests/annotate_smart_pointer 50 50
==18170== drd, a thread error detector
==18170== Copyright (C) 2006-2011, and GNU GPL'd, by Bart Van Assche.
==18170== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info
==18170== Command: ./annotate_smart_pointer 50 50
==18170==
==18170== Conflicting store by thread 1 at 0x7fefff8a0 size 8
==18170==    at 0x400FCE: AnnotateCondVarSignal (unified_annotations.h:32)
==18170== Allocation context: unknown.
==18170==
==18170== Conflicting load by thread 1 at 0x7fefff8a0 size 8
==18170==    at 0x400FDD: AnnotateCondVarSignal (unified_annotations.h:34)
==18170==    by 0x401071: U_AnnotateHappensBefore (unified_annotations.h:46)
==18170==    by 0x4018DD: smart_ptr<counter>::set(counter*, AtomicInt32*) (annotate_smart_pointer.cpp:239)
==18170==    by 0x401778: smart_ptr<counter>::operator=(counter*) (annotate_smart_pointer.cpp:208)
==18170==    by 0x401377: main (annotate_smart_pointer.cpp:326)
==18170== Allocation context: unknown.

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

13 years agodrd: Refactor functions for starting / stopping to access stack memory
Bart Van Assche [Sun, 15 Jan 2012 19:08:13 +0000 (19:08 +0000)] 
drd: Refactor functions for starting / stopping to access stack memory

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

13 years agodrd: Reformat three comment blocks
Bart Van Assche [Sun, 15 Jan 2012 19:02:20 +0000 (19:02 +0000)] 
drd: Reformat three comment blocks

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

13 years agoAdded a new parameter to the memcheck 'leak_check' GDB monitor command
Philippe Waroquiers [Sat, 14 Jan 2012 13:53:13 +0000 (13:53 +0000)] 
Added a new parameter to the memcheck 'leak_check' GDB monitor command
to let the user specify a max nr of loss records to output : on huge
applications, interactive display of a lot of records in gdb can
take a lot of time.

* mc_include.h :
  - added UInt max_loss_records_output; to LeakCheckParams structure
  - avoid passing LeakCheckParams by struct copy.
* modified test gdbserver_tests/mcleak to test the new parameter
* mc_main.c : parse or set max_loss_records_output in leak_check cmd
  handling and calls.
* mc-manual.xml : document new leak_check parameter
* mc_leakcheck.c :
  - extract printing rules logic in its own function
  - in print_results, if there is a limit in LeakCheckParam,
    compute from where the printing of loss records has to start

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

13 years agoValgrind gdbserver can open/close connections multiple times
Philippe Waroquiers [Fri, 13 Jan 2012 21:36:46 +0000 (21:36 +0000)] 
Valgrind gdbserver can open/close connections multiple times
=> avoid leak when re-computing the default vgdb prefix.
Similar change in vgdb.c

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

13 years agoconfigure.in: Make compiler version check more robust
Bart Van Assche [Wed, 11 Jan 2012 11:34:23 +0000 (11:34 +0000)] 
configure.in: Make compiler version check more robust

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

13 years ago* Use the arg name forClient to document the calls to VG_(am_get_advisory)
Philippe Waroquiers [Sun, 8 Jan 2012 21:01:02 +0000 (21:01 +0000)] 
* Use the arg name forClient to document the calls to VG_(am_get_advisory)
* in function  VG_(am_mmap_file_float_valgrind_flags), use False/*forClient*/
  instead of True (as VG_(am_mmap_file_float_valgrind_flags) is used
  for "valgrind" kind of mmap only).

Regtested on f16/ppc64, deb5/amd64, Ubuntu9.10/x86

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

13 years agoTerminate comment correctly.
Florian Krohm [Mon, 2 Jan 2012 16:12:30 +0000 (16:12 +0000)] 
Terminate comment correctly.

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

13 years agoFix accounting for MC_(realloc). It was inconsistent as compared to
Florian Krohm [Fri, 30 Dec 2011 03:09:45 +0000 (03:09 +0000)] 
Fix accounting for MC_(realloc). It was inconsistent as compared to
other wrappers in that it took place before the silly-args check.
Testcase and patch by Yann Droneaud (yann@droneaud.fr).
Fixes #281482

Also included is a related fix to MC_(new_block). Incrementing the
alloc counter and updating the allocated memory amount should
occur under the same condition (allocation succeeded).

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

13 years agoadd support for glibc 2.15
Dirk Mueller [Thu, 29 Dec 2011 08:24:55 +0000 (08:24 +0000)] 
add support for glibc 2.15

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

13 years agoAvoid buffer overrun in percentify call.
Philippe Waroquiers [Tue, 27 Dec 2011 18:43:32 +0000 (18:43 +0000)] 
Avoid buffer overrun in percentify call.

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