Commit Graph

9188 Commits

Author SHA1 Message Date
Julian Seward
712ee2547b Make the return type of VG_(disp_run_translations) be void, rather
than the HWord it was claimed to be.  Inconsistency spotted by
Philippe Waroquiers.



git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12486
2012-04-04 12:23:23 +00:00
Julian Seward
8b6f93641c Add translation chaining support for amd64, x86 and ARM
(Valgrind side).  See #296422.



git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12484
2012-04-02 21:56:03 +00:00
Julian Seward
91e97b859e Swizzle external.
git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12479
2012-04-02 14:52:23 +00:00
Julian Seward
5637591ef3 Make a copy of r2270/r12476 for work on translation chaining.
git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12477
2012-04-02 14:26:30 +00:00
Julian Seward
d2ca761361 Initial support for POWER Processor decimal floating point
instruction support -- VEX side changes.  See #295221.

This patch adds test cases.  Also adds some minor Memcheck
instrumentation tweaks necessitated by the IR changes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12476
2012-04-02 10:22:05 +00:00
Bart Van Assche
f244dcefb6 drd: Reenable reporting races on stack variables that are shared over threads for --check-stack-var=yes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12475
2012-04-01 15:06:57 +00:00
Bart Van Assche
8e19567a85 drd: Don't complain about stack variables that are shared over threads. Closes #297147
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12474
2012-04-01 14:40:16 +00:00
Julian Seward
9431a48f77 gcc-4.7.0 complains about some __attribute__((always_inline)) here,
so change them back to vanilla ones.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12473
2012-03-31 00:06:04 +00:00
Julian Seward
658fb95bfc Fix #ifdef vs { mismatch in r12471, that broke compilation on MacOS.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12472
2012-03-31 00:04:59 +00:00
Philippe Waroquiers
72933b25a0 Further fix 297078 : implement conversion between vki and gdb real time sig nr.
* gdbserver_tests/nlpasssigalrm
   modify test so as to test also a real time signal

* coregrind/m_gdbserver/signals.c
  - implement translation between gdb real time signal numbers
    and vki real time signal numbers
  - ensure non-convertible signals are giving an error



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12471
2012-03-30 20:25:26 +00:00
Philippe Waroquiers
323ba3d8f0 Fix bug 297078 gdbserver signal handling problems caused by diff vki nr/gdb nr and
non reset of "C-ontinued" signal

* To allow vki signame to be used in debuglog:
  - pub_core_signals.h : added prototype for Char *VG_(signame)
  - m_signals.c : changed static const Char *signame(Int sigNo)
                      to const Char *VG_(signame)(Int sigNo)

* valgrind-low.c : when the signal to report to gdb has
  been reported, clear it so that it is not reported anymore
  afterwards.

* m_gdbserver.c: when checking in pass_signals if signal
  can be passed without gdb interaction, do a conversion
  from vki nr to gdb nr when indexing
  (as pass_signals[] is indexed by gdb_nr).

* various gdbserver files:
  - used vki_ prefix for some args and variables to clarify
  - better debuglog tracing

* modified nlpasssigalrm.vgtest to test SIGCHLD signal
  handling followed by a break (to see SIGTRAP is properly
  given to gdb).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12470
2012-03-29 21:56:47 +00:00
Julian Seward
3fe0a0a216 Add some more suppressions for OSX 10.7.2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12469
2012-03-28 14:35:00 +00:00
Julian Seward
8f59064ed9 Update the memcpy intercept for Helgrind in accordance with that
for Memcheck.  Fixes #293855.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12468
2012-03-27 16:49:55 +00:00
Julian Seward
b49612b466 /* Do expensive interpretation for Iop_Add32 and Iop_Add64 on
Darwin.  10.7 is mostly built with LLVM, which uses these for
   bitfield inserts, and we get a lot of false errors if the cheap
   interpretation is used, alas.  Could solve this much better if
   we knew which of such adds came from x86/amd64 LEA instructions,
   since these are the only ones really needing the expensive
   interpretation, but that would require some way to tag them in
   the _toIR.c front ends, which is a lot of faffing around.  So
   for now just use the slow and blunt-instrument solution. */

Pertains to, although does not completely solve, #242137.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12467
2012-03-27 10:19:39 +00:00
Julian Seward
b5fc5d0a06 Add a nasty kludge in the handling of mmap on Darwin. Does not apply
to any other platforms.  Prevent mmap(ANON) from returning zero (zero
with success, that is) since (a) some programs are observed to be
spooked by getting zero from a successful call to mmap, and (b) it's
pretty stupid from the point of view of program safety and possibly
security, since it causes page zero to become accessible.  So don't.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12466
2012-03-27 10:06:31 +00:00
Julian Seward
6e2edeb9bb rlimit64_nofile won't build on Darwin, so don't try.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12465
2012-03-27 10:03:56 +00:00
Julian Seward
a1e6c6723c Make this compile on Darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12464
2012-03-27 09:39:22 +00:00
Julian Seward
d49ffc6930 Fix up debug printing -- no functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12463
2012-03-27 09:39:04 +00:00
Julian Seward
5adc4486d5 Keep the stack properly 16 aligned when delivering signals on x86-darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12462
2012-03-27 09:38:23 +00:00
Julian Seward
98653c1338 Keep the stack properly 16-aligned when delivering signals on
amd64-darwin.  Fixes the failure shown in 
https://bugs.kde.org/show_bug.cgi?id=254646#c13



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12461
2012-03-27 09:24:54 +00:00
Julian Seward
4be341c2e6 Fill in missing signal handling macros for amd64-darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12460
2012-03-27 08:44:17 +00:00
Bart Van Assche
ba416f24c6 Darwin: Fix a copy/paste error that was introduced in r12458
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12459
2012-03-26 18:13:29 +00:00
Bart Van Assche
563f0acd21 Check whether the big lock is held before invoking pre_thread_ll_create.
If the pre_thread_ll_create tracking function would be invoked without the
big lock being held, that would trigger a race condition in the tools that
implement this tracking function.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12458
2012-03-25 17:51:59 +00:00
Philippe Waroquiers
57ec7947c7 Remove strange e which appeared in r12456, replace by a real e.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12457
2012-03-25 14:55:17 +00:00
Philippe Waroquiers
565baa930a Have check_makẹfile_consistency run at the end of make regtest
This ensures that a missing file in the Makefile is detected,
without blocking the tests.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12456
2012-03-25 10:54:59 +00:00
Philippe Waroquiers
b20b3938c6 add test-plo-no.stderr.exp-s390x-mvc in EXTRA_DIST.
Note: such missing files in EXTRA_DIST are found
by check_makefile_consistency.
However, to avoid blocking the tests, the return code
of check_makefile_consistency is ignored, but the errors
it detects are pages before the end of the make regtest output.

=> it might be a good idea to move the check_makefile_consistency
as the last step of regtest: target, and not ignore its return code.
This means:
   trials tests will not block make regtest
   such errors will be noticed.

For the moment, just fixed the missing file in EXTRA_DIST



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12455
2012-03-21 20:32:00 +00:00
Julian Seward
f0e4d8eb14 Support sys_fallocate on arm-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12454
2012-03-21 19:37:41 +00:00
Philippe Waroquiers
cbb290c3a3 fix 295799 Missing \n with get_vbits in gdbserver when line is % 80 and there are some unaddressable bytes
patch from Marc Bessières

Thanks



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12453
2012-03-20 19:04:39 +00:00
Philippe Waroquiers
3b8c593619 Modify test so that scheduling events are generated.
Even without fair scheduling, this ensures the progress
of each thread.
This avoids the test looping forever in an outer/inner
setup.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12452
2012-03-19 20:19:23 +00:00
Florian Krohm
cebbd02e94 Update s390 opcode list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12451
2012-03-19 13:22:21 +00:00
Florian Krohm
afdb2d63bc Add script that assists with updating s390-opcodes.csv.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12450
2012-03-18 01:52:07 +00:00
Florian Krohm
f0973e2cc9 Add spreadsheet that lists all s390 opcodes in the following format:
1. column:  mnemonic
2. column:  description
3. column:  implementation status
4. column:  comments, if any

Prepared by Divya Vyas (divyvyas@linux.vnet.ibm.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12449
2012-03-18 01:51:12 +00:00
Florian Krohm
3898cbda6b Add expected output for s390x with compilers using mvc.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12448
2012-03-17 17:37:50 +00:00
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