Commit Graph

10441 Commits

Author SHA1 Message Date
Tom Hughes
6ef2cbe59d Add support for the clock_adjtime system call.
Based on a patch from Stefan Sørensen on BZ#330469.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13785
2014-01-30 22:33:02 +00:00
Tom Hughes
f1c82feda5 Both eventfd and eventfd2 have post handlers that we were failing
to call on most platforms. Fixes BZ #330459.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13784
2014-01-30 21:47:30 +00:00
Petar Jovanovic
fde6d8320b mips64: modify configure.ac to check for cavium supported toolchain
Modify configure to check if we can pass -march=octeon or -march=octeon2
flags to the compiler. This part is required as it gives us information how
to compile (i.e. whether to compile) tests specific for Cavium Octeon boards.

Patch by Zahid Anwar, with minor modifications.

Related to Bugzilla issue 326444.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13783
2014-01-29 18:08:50 +00:00
Petar Jovanovic
09034f1ee2 mips64: detect Cavium Octeon II in mips_features
Detect Cavium Octeon II CPU. This is needed as a prerequisite for
successful execution of cavium-octeon2 specific tests.

Patch by Zahid Anwar.

Related to Bugzilla issue 326444.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13782
2014-01-29 15:58:09 +00:00
Julian Seward
c2d3e03fbe Handle and instrument an extra rounding-mode argument as added by
vex r2809 to the following primops:

  Iop_Add32Fx4, Iop_Sub32Fx4, Iop_Mul32Fx4, Iop_Div32Fx4, 
  Iop_Add64Fx2, Iop_Sub64Fx2, Iop_Mul64Fx2, Iop_Div64Fx2, 
  Iop_Add64Fx4, Iop_Sub64Fx4, Iop_Mul64Fx4, Iop_Div64Fx4,
  Iop_Add32Fx8, Iop_Sub32Fx8, Iop_Mul32Fx8, Iop_Div32Fx8,



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13781
2014-01-26 18:36:52 +00:00
Carl Love
c2714c0d18 This patch by adrian.sendroiu@freescale.com fixes the lrmw and stmw
instructions.

The patch also adds ppc32 and ppc64 test cases for the instructions.

The patch is a fix for bugzilla 329956 "valgrind crashes when lmw/stmw instructions are used on ppc64".

The VEX code commit is 2802




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13780
2014-01-24 16:44:08 +00:00
Petar Jovanovic
f19c4a9504 Update NEWS (platform changes section) with MIPS/Android
As of r13767, Valgrind supports MIPS32/Android.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13779
2014-01-17 17:41:16 +00:00
Julian Seward
7e9bc3c8a4 Fix typo.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13778
2014-01-15 14:30:24 +00:00
Florian Krohm
dc55db6a9c Ignore testcase executable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13777
2014-01-15 11:23:57 +00:00
Julian Seward
a4af4ac048 arm64: rename guest_SP to guest_XSP so as to avoid a name clash with
guest_SP from s390 world. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13776
2014-01-15 10:25:55 +00:00
Julian Seward
aa7f3955f4 Update implementation notes for the arm64-linux port.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13775
2014-01-13 11:50:17 +00:00
Julian Seward
68a2a4ce01 Initial implementation of CFI based stack unwinding for arm64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13774
2014-01-13 00:21:09 +00:00
Julian Seward
0a13c57c35 Minor notes on arm64 register usages.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13773
2014-01-13 00:18:51 +00:00
Julian Seward
3c8017fea0 VG_(bzero_inline): handle up to 12 words inline.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13772
2014-01-13 00:17:54 +00:00
Julian Seward
4c57e7d4d9 Add test cases for AArch64 integer instructions (not wired up).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13771
2014-01-12 13:12:11 +00:00
Julian Seward
3f6d211236 Add support for ARMv8 AArch64 (the 64 bit ARM instruction set).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13770
2014-01-12 12:54:00 +00:00
Philippe Waroquiers
231d67347f add --vgdb-prefix arg to callgrind_control
If valgrind is started with --vgdb-prefix arg, then callgrind_control
cannot find and control this valgrind.
So, add an (optional) argument to callgrind_control,
and have callgrind tool report the needed vgdb prefix argument
if the user supplied this arg.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13769
2014-01-11 13:56:48 +00:00
Tom Hughes
057f9b7069 The value of AT_BASE should be the offset between where the ELF interpreter
expected to be loaded (as expressed in the ELF headers) and where it was
actually loaded, and not (as valgrind was doing) the absolute value of the
load address for the interpreter.

Note that when prelink is not in use the two are normally the same, as the
intpreter (like all shared libraries) is normally linked with a zero load
address. When prelinked that is no longer true.

With that fixed, the hack to patch out AT_BASE to avoid confusing gdb on
systems where prelink is in use is no longer needed.

Fixes BZ#329612


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13768
2014-01-07 22:27:57 +00:00
Dejan Jevtic
423d0643b9 mips32: Adding mips32/Android support to Valgrind.
Necessary changes to Valgrind to support mips32 on Android.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13767
2013-12-27 09:06:55 +00:00
Florian Krohm
8e06b09720 Announce fix for BZ #327284.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13766
2013-12-21 17:59:50 +00:00
Philippe Waroquiers
af36bdd9af Fix drd assert failure for monitor cmd execution when all threads blocked in syscall
When all threads are blocked in a syscall, DRD_(thread_get_running_tid)()
returns (or can return?) a "valid" DrdThreadId (probably the last one
that was running ?).
However, in such a situation, VG_(get_running_tid)() returns 0 (as effectively
there is no thread running).

This discrepancy (drd_tid "valid" and "vg_tid" invalid) can (probably) only
happen with gdb monitor commands, as a thread can (normally) execute a
client request only when it is running.

However, vgdb can "force" the invocation of the gdb monitor client request,
even if no thread is running.
In such a case, the assert should not verify that drd_tid and vg_tid are
consistent.

To reproduce the problem:
  ./vg-in-place --tool=drd sleep 60
and in another window:
  ./coregrind/vgdb help
which then gives
  ...
  drd: drd_clientreq.c:84 (handle_client_request): Assertion 'DRD_(VgThreadIdToDrdThreadId)(vg_tid) == drd_tid' failed.
  ==4208==    at 0x3801DE1D: report_and_quit (m_libcassert.c:260)
  ==4208==    by 0x3801E034: vgPlain_assert_fail (m_libcassert.c:340)
  ==4208==    by 0x380026CC: handle_client_request (drd_clientreq.c:84)
  ==4208==    by 0x3806EE8F: handle_gdb_monitor_command (server.c:490)
  ==4208==    by 0x3806F07A: handle_query (server.c:580)
  ==4208==    by 0x3806FDB2: server_main (server.c:915)
  ==4208==    by 0x3806B01C: call_gdbserver (m_gdbserver.c:706)
  ==4208==    by 0x3806B8F2: vgPlain_invoke_gdbserver (m_gdbserver.c:892)
  ...




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13765
2013-12-21 16:57:26 +00:00
Philippe Waroquiers
b54708a12d have massif printing its stats for v.info stats
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13764
2013-12-19 19:10:20 +00:00
Josef Weidendorfer
f56906eb07 Callgrind: support printing stats via vgdb
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13763
2013-12-17 15:12:06 +00:00
Philippe Waroquiers
c33117f7d6 Fix 325714 Empty vgcore but RLIMIT_CORE is big enough (too big)
Use ULong rather than UInt for coredump file size.

Tested manually by
  ulimit -c 4294967296
  ./vg-in-place ./gdbserver_tests/gone abort
valgrind creates vgcore.xxxxx unusable by GDB.

With the fix, GDB can read the core dump.

Patch from  Romain Geissler



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13762
2013-12-16 22:52:20 +00:00
Dejan Jevtic
4247ea70e0 mips32/64: Add extra suppression for mips32/64.
After the thread is detached not all thread memory is freed. This memory (dtv-dynamic thread vector)
can be used by the main thread. There are two types of run-time handling of TLS.
Difference is in the position of memory. It can be either before the thread pointer or
after the thread pointer.
Taken form the document http://www.akkadia.org/drepper/tls.pdf:
"Variant I for the thread-local storage data structures were developed
as part of the IA-64 ABI. Being brand-new, compatibility was no issue. The thread
register for thread t is denoted by tpt. It points to a Thread Control Block (TCB) which
contains at offset zero a pointer to the dynamic thread vector dtvt for the thread.

Variant II has a similar structure. The only difference is that the thread pointer
points to a Thread Control Block of unspecified size and content. Somewhere the TCB
contains a pointer to the dynamic thread vector but it is not specified where. This is
under control of the run-time environment and the pointer must not be assumed to be
directly accessible; compilers are not allowed to emit code which directly access the
dtvt."

Because of this we have two types of error when the program ends:
possibly lost, and definitely lost.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13761
2013-12-16 13:57:18 +00:00
Philippe Waroquiers
492a8ae2a2 Implement gdbsrv "v.info stats" command giving statistics for valgrind core + tools
* addition of VG_(needs_print_stats) in pub_tool_tooliface.h
* use the above in memcheck and helgrind
* output valgrind stats and calls print_stats in server.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13760
2013-12-15 20:24:43 +00:00
Philippe Waroquiers
7d40b140ac Following svn r13758 (bug 328711), some further similar fixes,
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13759
2013-12-12 23:19:13 +00:00
Mark Wielaard
546e8d2c5c Bug 328711 valgrind.1 manpage "memcheck options" section is badly generated
Add missing para tags inside listitems. (Miroslav Franc, mfranc@redhat.com)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13758
2013-12-12 21:20:48 +00:00
Julian Seward
19f49b677b Select expensive add/sub/cmp interpretations for blocks containing
Iop_GetMSBs8x16, since the presence of those usually implies PMOVMSKB
instructions in the block, which can mean "inlined string operations".
Reduces the noise level a lot in some icc12 -O2 generated sequences.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13757
2013-12-11 16:49:46 +00:00
Bart Van Assche
0eeaab895d drd/tests/std_atomic: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13756
2013-12-10 17:56:20 +00:00
Florian Krohm
1e7a6b1959 Announce fix for BZ #328455.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13755
2013-12-10 16:53:59 +00:00
Mark Wielaard
bbf509b446 Add testcase for bug 328100 XABORT not implemented (VEX r2800).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13754
2013-12-10 09:31:18 +00:00
Mark Wielaard
68e8866c17 NEWS entry for resolved bug 328100 XABORT not implemented (VEX r2800).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13753
2013-12-10 09:14:52 +00:00
Bart Van Assche
87ebe0d5a4 drd: Follow-up for r13749
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13752
2013-12-07 09:16:02 +00:00
Julian Seward
c556f034d4 Bump the version number on the trunk.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13751
2013-12-06 15:54:02 +00:00
Dejan Jevtic
231272ec40 mips32: update ignore list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13750
2013-12-06 14:28:29 +00:00
Dejan Jevtic
312c647a6e mips32/mips64: Suppress race condition error.
On MIPS architecture helgrind is showing race condition error in printf if
the printf is first time called from the child thread. If we call printf 
from the main for the first time we will suppress this error on mips.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13749
2013-12-06 14:21:44 +00:00
Philippe Waroquiers
b330c9fa31 Minor tweak in the VG_(poll) syscall and callers: have a way to show
the error in case the poll syscall unexpectedly fails.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13748
2013-12-05 22:10:55 +00:00
Philippe Waroquiers
45c11d4804 Minor tweak in the vgdb instructions output by valgrind:
to make copy/paste and then editing the command easier,
put the --pid=3393 at the end of the instruction output by valgrind.

So, in gdb command history, one can just recuperate the previous target
command in the history and more easily change the pid.
I.e. have:

target remote | /home/philippe/valgrind/refactor_vgdb/Inst/lib/valgrind/../../bin/vgdb --vgdb-prefix=truc --pid=3393

instead of

target remote | /home/philippe/valgrind/refactor_vgdb/Inst/lib/valgrind/../../bin/vgdb --pid=3393 --vgdb-prefix=truc 



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13747
2013-12-05 20:29:53 +00:00
Dejan Jevtic
c8fdf5eb67 mips32: Fix typo.
Fix some typo error and some errors in tests that was discovered while running Valgrind on MIPS/Android.
In some cases initial FCSR value wasn't being set properly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13746
2013-12-05 14:05:25 +00:00
Bart Van Assche
5c25fb0a1c Helgrind: Suppress false positive reports on _dl_allocate_tls_init()
Reported-by: Dejan Jevtic <dejan.jevtic@rt-rk.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13745
2013-12-02 15:13:05 +00:00
Philippe Waroquiers
deafe374ca Decrease helgrind memory use for applications allocating many blocks
Use a pool allocator for the MallocMeta struct that helgrind maintains
for each client allocated block.

For perf/heap on x86, this decreases the max amount of mmap-ed memory
for the core area from 56Mb to 36Mb.
On amd64, decreases from 104Mb to 62Mb.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13744
2013-12-01 19:28:48 +00:00
Philippe Waroquiers
b8ed3a5b65 Fix 326462 Refactor vgdb to isolate invoker stuff into separate module
vgdb.c contained (conditionally compiled) "invoker" code to have ptrace syscalls
used to allow gdb/vgdb to connect to a valgrind process blocked in a syscall.
This "invoker" code is ptrace based.
Not all platforms are using ptrace.
=> refactor vgdb so as allow invoker code to be added more cleanly
for non ptrace based platforms (e.g. Darwin, Solaris).

* add file vgdb.h for:
   - definition of the vgdb-invoker interface
   - common declarations between vgdb.c and vgdb-invoker implementations
* move ptrace related code from vgdb.c to new file vgdb-invoker-ptrace.c
* new file vgdb-invoker-none.c containing an empty invoker implementation
  used on platforms that do not (yet) have a invoker implementation
  (e.g. android and darwin).
* modified Makefile.am to use one of the vgdb-invoker-*.c file depending
  on the platform.
* small changes related to changing ptraceinvoker to invoker in various files:
  gdbserver_tests/make_local_links, gdbserver_tests/nlcontrolc.vgtest,
  gdbserver_tests/mcinvokeRU.vgtest, gdbserver_tests/nlsigvgdb.vgtest  
  gdbserver_tests/mcinvokeWS.vgtest, coregrind/m_gdbserver/README_DEVELOPERS

Patch from Ivo Raisr, slightly modified



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13743
2013-12-01 14:56:28 +00:00
Philippe Waroquiers
e9b6e1c9be Move bug fix announcement to the FIXED BUGS section
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13742
2013-12-01 14:51:21 +00:00
Bart Van Assche
4f909dddf7 NEWS: Mark #328205 as fixed
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13741
2013-12-01 12:59:32 +00:00
Philippe Waroquiers
8ec5ebb995 Announce bug fixed for several bugs in NEWS
fixed in r13709 326983  Clear direction flag after tests on amd64.
fixed in r13712 327238  Callgrind Assertion 'passed <= last_bb->cjmp_count' failed
fixed in r13715 327837  dwz compressed alternate .debug_info and .debug_str not read correctly
fixed in r13718 327916  DW_TAG_typedef may have no name



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13740
2013-12-01 12:52:00 +00:00
Philippe Waroquiers
9f3d49a562 Create 3.10.0 section in NEWS, add (first draft of) README_DEVELOPERS_processes
* add the new sections for next 3.10.0 release in NEWS.
* add file README_DEVELOPERS_processes.

As discussed on valdev and documented in README_DEVELOPERS_processes,
the idea is to document fixed bugs or new features in NEWS together
with the commit fixing/implementing these.

Looking at SVN, the below bugs should be added in 3.10.0 fixed bugs.
I will add them in NEWS shortly.

Thanks

Philippe


r13709 | tom | 2013-11-01 11:46:28 +0100 (Fri, 01 Nov 2013) | 2 lines

Clear direction flag after tests on amd64. BZ#326983.

r13712 | weidendo | 2013-11-12 16:32:58 +0100 (Tue, 12 Nov 2013) | 17 lines

Fix bug 327238.

 assertion failure in Callgrind: bbcc.c:585 (vgCallgrind_setup_bbcc):
 Assertion 'passed <= last_bb->cjmp_count' failed

r13715 | mjw | 2013-11-20 12:54:38 +0100 (Wed, 20 Nov 2013) | 5 lines

dwz compressed alternate .debug_info and .debug_str not read correctly.

Bug #327837. The buildid from the .gnu_debugaltlink section was parsed
incorrectly (from the wrong offset). Causing the debug alt file not to
be found.

r13718 | mjw | 2013-11-24 18:19:35 +0100 (Sun, 24 Nov 2013) | 5 lines

Bug 327916 - DW_TAG_typedef may have no name

We already accepted DW_TAG_typedef without a name for Ada. But g++ for
OpenMP can also emit such nameless DW_TAG_typedefs. Just accept them.
Also fix up anonymous enum and typedef printing in tytypes.c.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13739
2013-12-01 12:42:30 +00:00
Bart Van Assche
b6afe8ce21 xen: Implement XEN_DOMCTL_set_max_evtchn
This is new in Xen 4.4.

From: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13738
2013-12-01 10:59:07 +00:00
Bart Van Assche
9b1fe961a5 xen: XEN_SYSCTL_debugkeys hypercall
From: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13737
2013-12-01 10:58:38 +00:00
Bart Van Assche
44e8025b78 xen: XEN_SYSCTL_readconsole hypercall
From: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13736
2013-12-01 10:58:11 +00:00