10428 Commits

Author SHA1 Message Date
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
Bart Van Assche
182bf544af xen: XEN_DOMCTL_shadow_op hypercall
And some of the sub-subops.  It is a little hacky given the legacy way of
having several methods of enabling/disbling LOG_DIRTY mode.

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@13735
2013-12-01 10:57:43 +00:00
Bart Van Assche
b9a87170d6 xen: XEN_DOMCTL_sethvmcontext hypercall
Xen reads 'num' and 'array' from the structure, and reads the entire buffer.
Nothing gets written back.

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@13734
2013-12-01 10:57:14 +00:00
Bart Van Assche
7447bdac9b xen: XEN_DOMCTL_getpageframeinfo3 hypercall
Xen reads 'num' and the 'array' pointer from ARG1, and proceeds to read and
modify-in-place the entire userspace array.

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@13733
2013-12-01 10:56:28 +00:00
Bart Van Assche
c798ab2b61 xen: XEN_DOMCTL_gethvmcontext hypercall
The semantics of XEN_DOMCTL_gethvmcontext are little interesting.

If the 'buffer' field of the structure is NULL, the hypercall is a request for
the required buffer size, which written into the 'size' paramater.

If 'buffer' is non NULL, Xen will write to the buffer, and update 'size' with
the amount of data written.

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@13732
2013-12-01 10:55:54 +00:00
Bart Van Assche
fc2f8ac0e0 xen: XENMEM_remove_from_physmap hypercall
Xen reads the entire structure and writes nothing.

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@13731
2013-12-01 10:55:13 +00:00
Bart Van Assche
2bd24b6ef5 xen: XENMEM_add_to_physmap hypercall
Xen reads the entire structure, and if the space is _gmfn, will write the
structure back

From: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13730
2013-12-01 10:54:42 +00:00
Bart Van Assche
7f1b1eb0fb xen: XENMEM_machphys_mfn_list hypercall
The XENMEM_machphys_mfn_list implementation reads 'max_extents' and
'extents_start'.  It writes to the array at 'extents_start', and writes the
number of extents written into the 'nr_extents' field.

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@13729
2013-12-01 10:54:06 +00:00
Bart Van Assche
8d61cb581e xen: XENMEM_maximum_gpfn hypercall
Xen reads a 16 bit domid from the pointer provided in ARG2, but does not write
anything back.

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@13728
2013-12-01 10:53:34 +00:00
Bart Van Assche
3e4e3ebac0 xen: XENMEM_maximum_ram_page hypercall
Xen does not read or write any memory for this 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@13727
2013-12-01 10:53:05 +00:00
Bart Van Assche
b848d83815 xen: Infratructure for XEN_TMEM_* hypercalls
and an implementation of XEN_TMEM_control save_begin.

Xen will read various fields at various time, but write nothing back for a
save_begin subop.

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@13726
2013-12-01 10:52:22 +00:00
Bart Van Assche
bbbdd846be xen: Fix XEN_SYSCTL_getdomaininfolist for version 0xa
From: Andrew Cooper <andrew.cooper3@citrix.com>

Also add a default case so future bumps of the sysctl interface version dont
result in spurious passes of the IOCTL handler.

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@13725
2013-12-01 10:51:19 +00:00
Julian Seward
e2bff1c182 Merge the following revisions from 3_9_BRANCH to trunk:
r13682  Initial cut at 3.9.0 release notes.
r13683  Remove duplicate NEWS entries for 3.9.0.
r13689  Minor docs/NEWS fixes
r13690  Documentation updates for 3.9.0.
r13691  More documentation updates, re leak-checker changes
r13692  NEWS: Note increased max mem size.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13724
2013-11-29 23:08:28 +00:00
Julian Seward
ee95729330 Merge r13704 from 3_9_BRANCH (Fix compile problem in
memcheck/tests/reach_thread_register.c)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13723
2013-11-29 16:57:29 +00:00