9155 Commits

Author SHA1 Message Date
Florian Krohm
55255ece42 Add expected results for 32-bit little endian platform.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12447
2012-03-17 17:27:17 +00:00
Philippe Waroquiers
69c10e9d3c Make a more precise reference to the g++ version.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12446
2012-03-16 15:03:08 +00:00
Philippe Waroquiers
39e18a06af (for x86 and amd64): Change the type of the shadow regs for floating point registers
Similar to r12444 (see Log below), but this is doing it for x86 and amd64.
The xmm registers are using uint32 or uint64 for their float
union components. For the i387 80 bits float registers, as there is
no uint80, a struct uint16 + uint64 is defined.


  Log:
    Change the type of the shadow regs for floating point registers
    to be uint64. Previously the value in such a shadow reg would
    be interpreted by gdb as a floating point value which would 
    produce non-sensible output for e.g   p/x $f1s1.
    This patch covers the power and arm architectures.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12445
2012-03-14 21:27:35 +00:00
Florian Krohm
99443be85e Change the type of the shadow regs for floating point registers
to be uint64. Previously the value in such a shadow reg would
be interpreted by gdb as a floating point value which would 
produce non-sensible output for e.g   p/x $f1s1.
This patch covers the power and arm architectures.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12444
2012-03-14 01:15:59 +00:00
Florian Krohm
c62ecdb55b Add s390x register decsription to vgdb. This enables examination
of V bits in vgdb.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12443
2012-03-13 02:13:50 +00:00
Philippe Waroquiers
c25dc78c78 Fix leak in debuginfo.c
di->soname was not freed, so was leaked when debug info is removed.
free(soname) added in free_Debuginfo, after having verified
and then ensured that all soname are allocated in dinfo.

regtested on deb6/amd64



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12442
2012-03-12 22:06:57 +00:00
Philippe Waroquiers
aa50a7e4df Allows to run regression tests in an outer/inner setup.
A '3 lines how to':
   perl tests/vg_regtest --outer-valgrind=../trunk_untouched/install/bin/valgrind --all
           (the outer results for a test xxx is in xxx.outer.log)
   To run with another tool (e.g. drd), add the argument --outer-tool=drd


Still to do/things to improve:

* Most (inner) tests are successful when running under an outer
  memcheck. Need to analyse the reasons of remaining failures.

* The memcheck annotations in m_mallocfree.c can be improved:
  - A superblock is marked 'undefined', it should rather be marked
    'no access'.
  - When a free block is splitted, the remaining free block is
    not made 'no access'. Instead, it is made 'undefined'.
      => this decreases the chance to find bugs.
      => this is not very efficient (e.g. the rest of a superblock
         is often marked undefined repetitively).
    Similarly, the free block created by VG_(arena_memalign)
    is marked 'undefined'. 'No access' would be preferrable.
  - mkInuseBlock marks the new block as undefined. This is probably
    not needed, as VALGRIND_MALLOCLIKE_BLOCK will do it already.
  - VG_(arena_malloc) should give the requested size to
    VALGRIND_MALLOCLIKE_BLOCK, not the malloc usable size,
    as this decreases the chance to find buffer overrun bugs.
    But giving the requested size is tricky (see comments in
    the code).

* need to do memcheck annotations in m_poolalloc.c
   so as to allow leak checking for pool allocated elements.

* vg_regtest.in
  - should analyse the results of the outer and should
    produce a separate result for the tests for which
    the outer detects an error or a memory leak or ...


Changes done:
   README_DEVELOPERS: document the new outer/inner features.
   manual-core.xml: document the new sim-hint no-inner-prefix
   tests/outer_inner.supp: new file, containing the suppressions for inner.
   vg_regtest.in: implement new args --outer-valgrind, --outer-tool, --outer-args.
   m_mallocfree.c: annotations for memcheck.
   m_libcprint.c: handle the new sim-hint no-inner-prefix
   m_main.c: do an (early) parse of --sim-hints




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12441
2012-03-11 22:24:03 +00:00
Philippe Waroquiers
12633f0117 Modify none/tests/execve.c so to avoid infinite loop with --trace-children=yes
With --trace-children=yes, none/test/execve exec ve forever.

This avoids an infinite loop when running outer on inner regression
tests (for which --trace-children=yes is mandatory for the outer).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12440
2012-03-11 20:47:41 +00:00
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