9147 Commits

Author SHA1 Message Date
Philippe Waroquiers
825fdcf3cb Ensure VALGRIND_MALLOCLIKE_BLOCK protects the red zones.
* Redzones for custom alloc were not protected by VALGRIND_MALLOCLIKE_BLOCK.
  mc_main.c client request handling completed with protection
  of the redzones.
* custom_alloc.c test modified to test this case.
* mc_errors.c modified so as to first search for a malloc-ed block
  bracketting the error : for a custom allocator, a recently freed
  block can have just been re-allocated.
  In such a case, describing the address (e.g. in case of error)
  points to the block freed rather than to the block just allocated.
  If there is *also* a recently freed block bracketting the address,
  the block description is changed to indicate that.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12439
2012-03-11 17:59:00 +00:00
Philippe Waroquiers
6fe6c23808 Finally understood why an outer on inner on a 32 bit application
is failing on a 64 bit host.

The bug might or might not be related to some
errors "failed in UME with error 22"
(such as bug https://bugs.kde.org/show_bug.cgi?id=138424).

The bug is: when aspacem_maxAddr is very close to the upper limit,
and aspacem_minAddr is somewhat not close to 0, then
the computation of  
   aspacem_vStart = VG_PGROUNDUP((aspacem_minAddr + aspacem_maxAddr + 1) / 2);
can overflow.
The vStart value will then silently wrap around.
(please, give me my Ada language back :).

When overflowing, vStart will then be below the client cStart.
At least when running outer on inner on a 32 bit application on
a 64 bit system, this was causing strange problems.

I suppose that on a 64 bit system, a 32 bit application can use more
of the 4 Gb, and then the max address is higher and can more easily
overflow than on a 32 bit system.

Tested on f12/x86, debian6/amd64 (bi-arch).
+ run a few outer on inner x86 regression tests : these were all failing
and are now succesfully running.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12438
2012-03-08 23:42:05 +00:00
Bart Van Assche
938bb79e0c Suppress race reports on ticket lock state variables
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12437
2012-03-08 19:17:56 +00:00
Bart Van Assche
ab206e6e4c Suppress race reports on VG_(threads)[tid].os_state.exitcode
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12436
2012-03-08 19:07:08 +00:00
Bart Van Assche
ced3c8876d Use ANNOTATE_BENIGN_RACE_SIZED() to suppress race reports on owner_lwpid
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12435
2012-03-08 19:02:39 +00:00
Bart Van Assche
aad3c98711 helgrind: Implement ANNOTATE_BENIGN_RACE_SIZED()
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12434
2012-03-08 18:58:41 +00:00
Bart Van Assche
9da23bfe62 Update Subversion ignore list
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12433
2012-03-08 17:11:03 +00:00
Bart Van Assche
4e36be3285 When analyzing Valgrind with drd, suppress uninteresting race reports on VG_(threads)[].status
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12432
2012-03-08 14:59:25 +00:00
Bart Van Assche
0d812117a5 Update Subversion ignore list
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12431
2012-03-08 14:57:55 +00:00
Julian Seward
cd43bae6a4 Change the behaviour of --partial-loads-ok=yes to avoid false
negatives, by marking the V bits that come from out of range parts of
the access as undefined; and hence any use of them leads to an value
error.  Prior to this they were marked as defined and could be used
without error.

Behaviour of --partial-loads-ok=no (the default case) is unchanged.

Also add some testing thereof.

Fixes #294523.  Modified version of a patch and testcase by Patrick
J. LoPresti (lopresti@gmail.com).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12430
2012-03-08 14:51:01 +00:00
Bart Van Assche
f2bc8e8162 Make it possible to #include <valgrind/drd.h> after <valgrind/helgrind.h>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12429
2012-03-08 14:44:57 +00:00
Bart Van Assche
f8d739e8d9 Suppress uninteresting race reports on sema->owner_lwpid
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12428
2012-03-08 10:14:12 +00:00
Bart Van Assche
9c9cd59a46 none/tests: Update Subversion ignore list
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12427
2012-03-08 10:11:22 +00:00
Julian Seward
742df20540 Turn no-op versions of INNER_REQUEST into statements, not values,
since gcc complains about "statement with no effect" or some such for
the simple "0" version.  Also, make the formal parameter names a bit
more unique.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12426
2012-03-07 17:11:44 +00:00
Julian Seward
95808ccd1a Ah, the joys of applying patches by hand. Redo r12424 but get the
patch in the right place this time.  re #295428.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12425
2012-03-07 16:38:12 +00:00
Julian Seward
08aacc2598 x86-darwin: _start: keep the stack 16-aligned. Fixes #295428.
(Jack Howarth, howarth@nitro.med.uc.edu)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12424
2012-03-07 15:56:29 +00:00
Julian Seward
2db1d0a8a2 Reinstate intercepts for plain "memcpy" and "memmove" on OSX <= 10.6
(not on Lion).  Fixes #285662.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12423
2012-03-07 15:26:50 +00:00
Julian Seward
7578739156 MacOS only: VG_(get_changed_segments) callback
remove_mapping_callback: if the kernel tells us of a gap that
partially, but does not exactly, overlap a V segment, only record
directives to remove that part of the segment that actually falls
within the gap.  Removing the entire V segment is incorrect and can
cause Memcheck to believe that memory not within the hole is
inaccessible, leading to floods of invalid errors.  Fixes
https://bugzilla.mozilla.org/show_bug.cgi?id=715750



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12422
2012-03-07 13:28:05 +00:00
Tom Hughes
1e1da9ff38 Add support for the HCIINQUIRY ioctl.
Patch from Andrew Brampton to fix BZ#283961.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12421
2012-03-07 11:22:42 +00:00
Tom Hughes
137aace5a3 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
2012-03-07 10:21:33 +00:00
Philippe Waroquiers
308074c716 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
2012-03-06 20:35:20 +00:00
Florian Krohm
cdea28bfba Update bug reporting URL.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12418
2012-03-06 15:54:28 +00:00
Florian Krohm
f41f7ad456 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
2012-03-05 23:12:47 +00:00
Philippe Waroquiers
c0883bddd7 * 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
2012-03-05 22:09:20 +00:00
Florian Krohm
d58aa28f82 Avoid possibly unaligned memory access.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12415
2012-03-03 18:46:05 +00:00
Philippe Waroquiers
74d44d1764 * 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
2012-03-03 12:01:48 +00:00
Bart Van Assche
d5ba78f638 none/tests/mq.c: Fix a copy-paste bug
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12413
2012-03-02 09:57:14 +00:00
Philippe Waroquiers
7ec5224de5 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
2012-03-01 22:00:36 +00:00
Tom Hughes
35cc294c29 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
2012-03-01 13:42:18 +00:00
Philippe Waroquiers
0eb5c19d3f 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
2012-02-28 22:37:44 +00:00
Philippe Waroquiers
ea0d3b9bf4 Fix leak found by running memcheck/tests/varinfo[1-6].vgtest
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12409
2012-02-28 20:10:05 +00:00
Julian Seward
adf73152fb Increase the size of buffers used for showing names when
--trace-flags= is set.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12408
2012-02-28 18:02:41 +00:00
Philippe Waroquiers
704e5c19d1 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
2012-02-27 21:52:45 +00:00
Julian Seward
1533236a47 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
2012-02-27 11:02:20 +00:00
Philippe Waroquiers
1d7a774336 Fix some memory leaks found by running memcheck on annotated memcheck.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12405
2012-02-26 21:26:00 +00:00
Florian Krohm
0f282be925 Tighten up initial guest/shodow state on s390x.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12404
2012-02-26 17:51:28 +00:00
Florian Krohm
c34cae2568 Announce.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12403
2012-02-26 17:01:22 +00:00
Philippe Waroquiers
fab0c4b100 Fix buffer overflow bug when building the target file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12402
2012-02-24 11:25:58 +00:00
Philippe Waroquiers
8bdfefff73 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
2012-02-24 08:33:56 +00:00
Tom Hughes
b02856120f 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
2012-02-23 12:54:50 +00:00
Julian Seward
a3e81d0d83 Implement malloc_size for the vg_default_zone on Darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12399
2012-02-23 07:36:03 +00:00
Philippe Waroquiers
6a15dd16e4 Document the new --fair-sched option.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12398
2012-02-22 20:23:29 +00:00
Philippe Waroquiers
564e685793 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
2012-02-22 19:47:27 +00:00
Tom Hughes
e9f922b442 Hide our use of pkglibdir to stop automake 1.11.2 and later complaining.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12396
2012-02-21 15:53:35 +00:00
Julian Seward
7d0b1685f1 Add test cases for MPSADBW. See #294048.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12395
2012-02-21 11:03:38 +00:00
Julian Seward
6b43662deb 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
2012-02-21 08:38:04 +00:00
Julian Seward
5786c979e6 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
2012-02-20 15:33:24 +00:00
Florian Krohm
0160d2dfc6 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
2012-02-20 15:03:02 +00:00
Julian Seward
2d7e3fd85c Update status and build instructions for ICS (Android 4.0.3).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12391
2012-02-17 15:13:55 +00:00
Julian Seward
48d927757d Add test cases for PHMINPOSUW (SSE 4.1). See #287301.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12390
2012-02-16 22:02:47 +00:00