866 Commits

Author SHA1 Message Date
Philippe Waroquiers
3e5f78f04d pub_tool_oset.h and m_oset.c cleanup
* Remove dead code in m_oset.c VG_(OSetGen_ResetIterAt)
  The code at the end of VG_(OSetGen_ResetIterAt) was unreachable
  (detected by BEAM checker).
  Looking at SVN, the initial commit of VG_(OSetGen_ResetIterAt)
  already contained this deadcode.

* pub_tool_oset.h was wrongly indicating that signed words could
  be used for fast cmp oset.

* modified memcheck/tests/unit_oset.c to test VG_(OSetGen_ResetIterAt)

* modified memcheck/tests/unit_oset.c to not use signed words
  (it was previously using signed words, but only with positive values)





git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13622
2013-10-06 16:35:35 +00:00
Dejan Jevtic
8eda9d604e mips32: Add two syscall wrappers:
4345 __NR_process_vm_readv
4346 __NR_process_vm_writev
Code style, no functional changes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13577
2013-09-24 14:21:50 +00:00
Florian Krohm
a6c7a2893c Fix coregrind header files such that they can be included without
having to worry what other header files may have to be included
beforehand.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13549
2013-09-15 13:54:34 +00:00
Florian Krohm
5c4ba95a27 Fix inclusion of header files in coregrind. No pub_tool_*.h should be
included here.
Added pub_core_poolalloc.h and renamed pub_tool_inner.h to pub_core_inner.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13548
2013-09-15 10:42:26 +00:00
Florian Krohm
de4c6ffc54 Fix include guard.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13547
2013-09-15 09:56:18 +00:00
Florian Krohm
e4c80fed1e Move a function and its prototype VG_(malloc_effective_client_redzone_size)
to a conceptually better place.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13546
2013-09-15 09:18:03 +00:00
Philippe Waroquiers
6e3bb2af58 Fix 324514 gdbserver monitor cmd output behaviour consistency + allow user
to put a "marker" msg in process log output

* v.info n_errs_found accepts optional msg, added in the output of
   the monitor command.

* use VG_(printf) rather than VG_(gdb_printf) when output of command
  should be redirected according to v.set gdb_output|log_output|mixed_output

* also avoid calling gdb_printf in output sink processing
  to output zero bytes, as gdb_printf expects to have a null terminated
  string, which is not ensured when 0 bytes have to be output.

* some minor reformatting (replace char* xxx by char *xxx).




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13532
2013-09-04 21:42:43 +00:00
Philippe Waroquiers
a44190db93 Fix misleading comment, as VG_(releasePA) is deleting the PA when zero ref count
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13519
2013-08-30 15:48:16 +00:00
Florian Krohm
c5fd4773ed Add missing headers and such so that 'make dist' works again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13518
2013-08-29 17:59:27 +00:00
Bart Van Assche
045b8ab23e valgrind.h: Add MinGW64 support
From: Makoto Kato <m_kato@ga2.so-net.ne.jp>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13513
2013-08-25 06:10:24 +00:00
Bart Van Assche
de32048275 coregrind/m_debuginfo: Add VG_(DebugInfo_get_bss_avma)() and VG_(DebugInfo_get_bss_size)()
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13510
2013-08-24 17:52:26 +00:00
Julian Seward
4e3134f897 Fix fallout from r13486: "virtual" is a C++ reserved word and so this
header causes breakage in the C++ tests in the tree.  Rename it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13487
2013-08-08 09:05:37 +00:00
Julian Seward
f7cd4044d5 Add support for a bunch of DRM Ioctls. Fixes #207815.
(Robert Bragg, bob@o-hand.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13486
2013-08-08 08:09:29 +00:00
Dejan Jevtic
78ae0356c4 mips32: Add support for mips32 DSP instruction set.
Add support for mips32 DSP and DSP revision 2 ASE.
More details about the mips32 DSP(r2) ASE:
http://www.mips.com/media/files/MD00566-2B-MIPSDSP-QRC-01.00.pdf
Applied patch provided by Maja Gagic <maja.gagic@rt-rk.com>



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13470
2013-07-25 08:22:08 +00:00
Philippe Waroquiers
4c9052b4d6 fix incorrect lineno in supp error msgs+ -v give filename+lineno of used supp.
If a suppression file contains an error, the lineno reported could be wrong.
Also, give filename and lineno of the used suppressions in -v debugging output.

The fix consists in ensuring that tool specific read_extra function gets
the Int* lineno pointer, together with other VG_(get_line) parameters.






git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13469
2013-07-22 22:00:13 +00:00
Tom Hughes
d9264a8311 The FIOCLEX and FIONCLEX ioctls are architecture specific.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13464
2013-07-18 11:22:10 +00:00
Tom Hughes
6247518a02 Socket option constants are architecture specific.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13463
2013-07-18 11:15:41 +00:00
Tom Hughes
c9ba888d97 Handle FIOCLEX and FIONCLEX ioctls. Patch from Ben Noordhuis. BZ#305170.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13462
2013-07-17 14:57:18 +00:00
Tom Hughes
97342e80a6 Handle setsockopt(SOL_SOCKET, SO_ATTACH_FILTER) better. Based
on patch from Guy Harris on BZ#318203.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13461
2013-07-17 14:36:57 +00:00
Julian Seward
4fe9a30352 Merge r13421:HEAD from branches/DISRV. This merges the debuginfo-server
stuff into the trunk.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13440
2013-07-02 08:07:15 +00:00
Bart Van Assche
8650980ea8 [PATCH 3/4] xen: VKI_XEN_SYSCTL_sched_id hypercall (#321065)
From: Andrew Cooper <andrew.cooper3@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13437
2013-06-30 07:59:09 +00:00
Bart Van Assche
bbe2f19d40 [PATCH 2/4] xen: update for interface changes in Xen 4.3 release (#321065)
From: Ian Campbell <ian.campbell@citrix.com>



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13436
2013-06-30 07:58:19 +00:00
Julian Seward
d14f385579 Connect up the Mach-O reader to the new DiImage abstractions.
git-svn-id: svn://svn.valgrind.org/valgrind/branches/DISRV@13430
2013-06-25 12:42:52 +00:00
Julian Seward
68c9403938 Initial code for remote debuginfo server. Handles all ELF/Dwarf{2,3,4}
on Linux.  No Dwarf1, no Stabs, and MacOSX probably won't build.


git-svn-id: svn://svn.valgrind.org/valgrind/branches/DISRV@13423
2013-06-07 16:15:48 +00:00
Mark Wielaard
86f74d6026 Support Linux kernel AF_BLUETOOTH for bind().
Bug #320116. sockaddr_rc might contain some padding which might not be
initialized. Explicitly check the sockaddr_rc fields are set. That also
produces better diagnostics about which field is unitialized.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13404
2013-05-22 10:21:10 +00:00
Mark Wielaard
d4513c94f0 Support PTRACE_GET/SET_THREAD_AREA on x86.
BZ#320063.  (Josh Stone, jistone@redhat.com)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13403
2013-05-22 10:21:08 +00:00
Petar Jovanovic
c116ce3d06 mips: enable syscalls prlimit64, process_vm_readv, process_vm_writev
Enable wrappers for syscalls prlimit64, process_vm_readv, process_vm_writev,
needed by the following tests:

- none/tests/rlimit64_nofile and
- none/tests/process_vm_readv_writev.

The change also adds definitions for several system calls for MIPS64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13400
2013-05-14 14:13:15 +00:00
Petar Jovanovic
0013eece1f mips: code-style, remove some trailing spaces from MIPS header files
Non-function change, removing some trailing spaces from MIPS header files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13390
2013-05-12 01:16:40 +00:00
Petar Jovanovic
e67d6f871e mips: default VKI_SHMLBA to the MIPS Linux kernel value SHMLBA
This change removes option to define shared-memory-alignment for MIPS,
instead default value (0x40000) from MIPS Linux kernel will be used.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13389
2013-05-12 00:52:38 +00:00
Petar Jovanovic
21b4d03a6d mips: add different value for SOCK_STREAM
MIPS uses different values for socket types.
This is protected by ARCH_HAS_SOCKET_TYPES in Linux kernel and we introduce
it here too. This is important for log-socket feature, and it resolves the
issue reported in https://bugs.kde.org/show_bug.cgi?id=313267#c21.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13359
2013-04-04 10:55:09 +00:00
Tom Hughes
269fc43ee7 Implement the name_to_handle_at system call for x86 and amd64.
Based on patch from Asmadeus to fix BZ#308930.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13304
2013-03-03 12:57:20 +00:00
Christian Borntraeger
293a0cefd6 wire up 2 vhost ioctls. The kernel does not use any parameter
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13298
2013-03-01 13:17:49 +00:00
Christian Borntraeger
85a4737869 initial tun/tap ioctls.
TUNSETIFF/TUNGETIFF/TUNSETOFFLOAD. See 315952.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13297
2013-03-01 12:56:07 +00:00
Petar Jovanovic
5dd4c02e39 mips: adding MIPS64LE support to Valgrind
Necessary changes to Valgrind to support MIPS64LE on Linux.
Minor cleanup/style changes embedded in the patch as well.
The change corresponds to r2687 in VEX.
Patch written by Dejan Jevtic and Petar Jovanovic.

More information about this issue:
https://bugs.kde.org/show_bug.cgi?id=313267


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13292
2013-02-27 23:17:33 +00:00
Bart Van Assche
a367a2d4fe Add support for the Linux ioctl IB_USER_MAD_ENABLE_PKEY
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13287
2013-02-14 17:10:01 +00:00
Philippe Waroquiers
6fb1158a78 Implement --merge-recursive-frames + provide VALGRIND_MONITOR_COMMAND client req.
In a big applications, some recursive algorithms have created
hundreds of thousands of stacktraces, taking a lot of memory.

Option --merge-recursive-frames=<number> tells Valgrind to
detect and merge (collapse) recursive calls when recording stack traces.
The value is changeable using the monitor command
'v.set merge-recursive-frames'.

Also, this provides a new client request: VALGRIND_MONITOR_COMMAND
allowing to execute a gdbsrv monitor command from the client
program.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13246
2013-01-20 17:11:58 +00:00
Philippe Waroquiers
0ac5603a9d Implement a more efficient allocation of small blocks which are never freed.
This generalises the "perm_malloc" function which was in ms_main.c
The new VG_(perm_malloc) is used in ms_main.c
and for execontext : when there are a lot of execontext, this
can save significant memory.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13238
2013-01-18 06:19:49 +00:00
Philippe Waroquiers
1fcd318239 Small comment fix: .h specifies "all frames", implementation uses 8.
Two fixes could be done:
Either we fix the comments
or we increase N_FRAMES to be rather VG_DEEPEST_BACKTRACE.

We fix the comment for the following reason:
This is (at least for the moment) not performance critical.
as this is only called when an error is reported.
However, searching for local vars is extremely costly.
It is unlikely that an error is reported for a stack variable
which is more than 8 frames deeper than theframe in which
it is detected.

So, fix the comment, waiting for a complaint that a deeper
variable is not properly described.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13235
2013-01-16 22:07:02 +00:00
Tom Hughes
e960453f98 Test file mode correctly in vmsplice wrapper.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13229
2013-01-14 22:14:21 +00:00
Philippe Waroquiers
739ae0bcb6 Implement --keep-stacktraces=alloc|free|alloc-and-free|alloc-then-free|none
The option --keep-stacktraces controls which stack trace(s) to keep for
malloc'd and/or free'd blocks. This can be used to obtain more information
for 'use after free' errors or to decrease Valgrind memory and/or cpu usage
by recording less information for heap blocks.

This fixes 312913 Dangling pointers error should also report the alloc
stack trace.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13223
2013-01-12 19:53:08 +00:00
Philippe Waroquiers
1618b44d28 Fix 284540 and 307465
284540 Memcheck shouldn't count suppressions matching still-reachable allocations
307465 --show-possibly-lost=no should bring down the error count / exit code

Using the options --show-leak-kinds=kind1,kind2,.. and
--errors-for-leak-kinds=kind1,kind2,.., each leak kind (definite, indirect,
possible, reachable) can now be individually reported and/or counted as
an error.
In a leak suppression entry, an optional line 'match-leak-kinds:'
controls which leak kinds are suppressed by this entry.
This is a.o. useful to avoid definite leaks being "catched"
by a suppression entry aimed at suppressing possibly lost blocks.
Default behaviour is the same as 3.8.1

Old args (--show-reachable and --show-possibly-lost) are still accepted.

Addition of a new test (memcheck/tests/lks) testing the new args
and the new suppression line.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13170
2012-12-08 17:54:16 +00:00
Florian Krohm
e7f4d4f57f Fix some casts that removed const-ness as pointed out by
GCC's -Wcast-qual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13138
2012-11-24 19:41:54 +00:00
Florian Krohm
af66466ce4 Changes to allow compilation with -Wwrite-strings. That compiler option
is not used for testcases, just for valgrind proper.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13137
2012-11-23 16:17:43 +00:00
Florian Krohm
117196ac6d Char/HChar fixups for m_debuginfo and m_gdbserver.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13122
2012-11-15 04:27:04 +00:00
Florian Krohm
d0aa69c331 Fix more Char/HChar mixups. Closing in...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13119
2012-11-10 22:29:54 +00:00
Christian Borntraeger
bf1836a5d9 add BLKPBSZGET ioctl
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13117
2012-11-09 16:01:38 +00:00
Christian Borntraeger
4155f1b382 add s390 specific fix for getregset
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13112
2012-11-08 20:10:10 +00:00
Florian Krohm
25b18b0aa1 Char/HChar and constness fixes. Mostly cost center
on allocators which is always a const HChar *


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13089
2012-10-27 23:07:42 +00:00
Florian Krohm
5337376bf2 More Char/HChar fixes and constification.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13088
2012-10-27 18:39:11 +00:00
Bart Van Assche
3fd464fbf3 Remove build dependency on Xen header files - closes #308495
From: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13081
2012-10-23 18:03:28 +00:00