aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2015-10-22Fix 353891 Assert 'bad_scanned_addr < VG_ROUNDDN(start+len, sizeof(Addr))' ↵philippe
failed All memory dereferences during leak search are checked either with aspacemgr or using the VA-bits. So, in theory, no memory fault should occur. However, the leak search is done so as to resist to e.g. - desynchronisation between the real pages mapped and the aspacemgr state. - client pages mprotected against reading - any other reason why dereferencing a client address would fail. So, the function lc_scan_memory installs a fault catcher that is called if a memory fault signal is raised during memory scan. However, memory dereference is also done in the function heuristic_reachedness. So, this function must also resist to memory fault. This patch also installs a fault catcher for the function heuristic_reachedness. More in details, the following changes are done: * pub_tool_signal.h and m_signals.c : VG_(set_fault_catcher) now returns the previously set fault catcher. This is needed so that heuristic_reachedness/lc_scan_memory can save and restore the previous fault catcher. * mc_leakcheck.c: Addition of leak_search_fault_catcher that contains the common code for the (currently 2) fault catchers used during leak search. * Modification of heuristic_reachedness and lc_scan_memory: Add 2 (small) specific fault catcher that are calling the common leak_search_fault_catcher. * The way sigprocmask is handled has been changed: Before this patch, lc_scan_memory was saving/restoring the procsigmask for each scanned block (and was restoring it when the fault catcher was longjmp-ing back to lc_scan_memory in case of SEGV or BUS. This was causing 2 system calls for each block scanned. Now, lc_scan_memory and heuristic_reachedness are not saving/restoring the procmask: the work to reset the sigprocmask is only done in leak_search_fault_catcher. This is more efficient as no syscall anymore is done during leak search, except for (normally) unfrequent SIGSEGV/BUS. It is also simpler as signal handling is now done at a single place. It is ok to reset the procmask (in fact, just remove the caught signal from the process sigmask) as during leak search, no other activity than the leak search is on-going, and so no other SEGV/BUS can be received while the handler runs. This gives moderate speed improvements for applications allocating a lot of blocks (about 10% improvement when leak searching in 1 million small blocks). Test case (slightly modified) by Matthias Schwarzott. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15716 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-10-19Fix inconsistent use of vki_ prefixes for struct vki_ifreq.sewardj
No functional change. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15713 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-10-16Solaris syscall: Add support for lwp_cond_wait(170).iraisr
Provide scalar test as well. Fixes BZ #353920. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15708 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-10-15Solaris syscall: Enable fchdir(120) - generic.iraisr
Provide scalar tests as well. Fixes BZ #353917. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15707 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-10-12On a zEC12 or z13, a glibc with lock elision enabled infers from HWCAPflorian
that the prerequisites for lock elision are met. Then it may use TBEGIN and other transactional-execution instructions which are not implemented by Valgrind. Likewise, the upcoming glibc 2.23 will exploit vector instructions if they are advertised by HWCAP; and those are currently not implemented by Valgrind either. In general, the increased use of ifunc may lead to more such cases in the future. This patch suppresses the advertising of those hardware features via HWCAP which are either not known to Valgrind or currently unsupported. Patch by Andreas Arnez (arnez@linux.vnet.ibm.com). Fixes BZ #353680. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15702 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-10-12Solaris syscall: Add support for pset family (207).iraisr
Provide scalar tests as well. Fixes BZ #353398. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15700 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-09-30Make sure no executable stack gets created. florian
Explanation by Matthias Schwarzott: The linker will request an executable stack as soon as at least one object file, that is linked in, wants an executable stack. And the absence of the .section .note.GNU-stack."",@progbits is enough to tell the linker that an executable stack is needed. So even an empty asm-file must at least contain this statement to not force executable stacks on the whole executable. * Define a helper macro MARK_STACK_NO_EXEC that disables the executable stack. * Instantiate this macro unconditionally at the end of each asm file. Patch by Matthias Schwarzott <zzam@gentoo.org>. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15692 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-09-29Solaris ioctl: more of those sockio ioctl wrappers.iraisr
SIOCGLIFBRDADDR, SIOCGLIFCONF, SIOCGLIFFLAGS, SIOCGLIFNETMASK. n-i-bz git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15689 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-09-29Solaris ioctl: more wrappers for sockio ioctls.iraisr
SIOCGIFCONF, SIOCGIFFLAGS, SIOCGIFNETMASK, and SIOCGIFNUM. n-i-bz git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15686 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-09-25Solaris syscall: Add support for system_stats (154).iraisr
Provide scalar test as well. n-i-bz git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15684 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-09-25Support correctly AT_SUN_SYSSTAT_ADDR and AT_SUN_SYSSTAT_ZONE_ADDRiraisr
in the auxiliary vector. This is possible as Solaris 12 kernel now creates auxv even for statically linked binaries. n-i-bz git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15682 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-09-23Merge, from branches/VALGRIND_3_11_BRANCH, NEWS and docs/xml/vg-entities.xml.sewardj
Bump version to 3.12.0.SVN. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15679 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-09-06Bug 342008 - valgrind.h needs type cast for _zzq_default to compile with ↵sewardj
clang/llvm in 64-bit mode. (arm64, that is) Patch from chh@google.com. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15633 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-09-03Fix UNKNOWN fcntl 97 on OS X 10.11rhyskidd
bz#351632 On OS X 10.11 (DP8) Before: == 595 tests, 575 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == After: == 595 tests, 219 stderr failures, 9 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15619 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-09-01Add missing copyright notices for Xen related files.sewardj
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15614 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-31Add support for ldsoexec on Solaris.iraisr
Solaris runtime linker allows to run dynamically linked programs indirectly, as: ld.so.1 <dynamic_executable> This is now possible under Valgrind as well. Fixes BZ#351858. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15607 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-23Preliminary support for OS X 10.11 (El Capitan) documentation. bz#348909.rhyskidd
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15584 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-21Update copyright dates, to include 2015. No functional change.sewardj
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15577 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-20Fix incorrect header guard. Reported by giacomopoz@gmail.comflorian
Fixes BZ #351531 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15573 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-14345338 - TIOCGSERIAL and TIOCSSERIAL ioctl support on Linuxsewardj
Patch from Martin Ling (martin-kdebugs@earth.li) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15542 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-14Bug 349034 - Add Lustre ioctls LL_IOC_GROUP_LOCK and LL_IOC_GROUP_UNLOCKsewardj
Patch from Frank Zago (fzago@cray.com) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15541 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-13Bug 339563 - The DVB demux DMX_STOP ioctl doesn't have a wrapper.sewardj
Patch from mchehab@infradead.org (Mauro Carvalho Chehab). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15537 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-12valgrind.h: Suppress client request code generation on x32bart
Ensure that no code is generated for client requests on x32. From: Matthias Schwarzott <zzam@gentoo.org> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15526 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-11Add support for repository cache protocol version 26.iraisr
Patch contributed by Tomas Jedlicka <jedlickat@gmail.com>. n-i-bz git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15518 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-09Fix a few function declarations.florian
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15514 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-05The number of elements in a RangeMap cannot be negative.florian
Let the return type of VG_(sizeRangeMap) reflect that. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15492 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-05The number of elements in an OSet cannot be negative.florian
Let the return type of VG_(OSetGen_Size) reflect that. Also fix a few casts. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15491 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-05The number of elements in a hash table cannot be negative.florian
Let the return type of VG_(HT_count_nodes) reflect that. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15490 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-08-05Add missing header files.florian
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15489 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-07-25ioctl handling needs to do POST handling on generic ioctls and needs to ↵rhyskidd
handle BPF ioctls bz#312989 Patch by Guy Harris <guy@alum.mit.edu> On OS X 10.10 Before: == 593 tests, 214 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == After: == 593 tests, 214 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15451 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-07-24Remove command line options --db-attach and --db-command which wereflorian
deprecated in 3.10.0 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15445 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-07-24Fix valgrind 3.9.0 build fails on Mac OS X 10.6.8rhyskidd
bz#327745 Patch by Mark H <mh8928@yahoo.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15444 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-07-21Bug 345248 - add support for Solaris OS in valgrindsewardj
Authors of this port: Petr Pavlu setup@dagobah.cz Ivo Raisr ivosh@ivosh.net Theo Schlossnagle theo@omniti.com git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15426 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-07-08Fix "346411 MIPS: SysRes::_valEx handling is incorrect"sewardj
Specialise type SysRes for mips{32,64}-linux to enable meaningful equality comparisons. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15404 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-07-08Preliminary support for OS X 10.11 (El Capitan). Refer BZ#348909 for ongoing ↵rhyskidd
work. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15403 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: Drop bogus port field from vki_xen_ioctl_evtchn_bind_virqbart
This ioctl argument struct has never had such a member. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15386 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: Implement physdev_op and map_pirqbart
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15385 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: Implement the xsm_op hypercallbart
More recent Xen toolstacks use this for the SID_TO_CONTEXT operation only, even when XSM is not in use. XSM is actually an abstraction layer, of which the only current implementation is FLASK. So this blindly assumes that the backend is FLASK. Should another XSM backend be invented then we will have to sort of detecting the correct one. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15384 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: syswrap XEN_SCHEDOP_remote_shutdownbart
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15383 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28Follow-up for r15381bart
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15382 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: Basic syswrap infrastructure for XEN_sched_op hypercallsbart
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@15381 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: syswrap XENMEM_machphys_compat_mfn_listbart
XENMEM_machphys_compat_mfn_list is functionally identical to XENMEM_machphys_mfn_list but returns a different list from Xen. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15379 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: syswrap XEH_HVMOP_set_pci_intx_levelbart
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15377 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: syswrap XEN_HVMOP_track_dirty_vrambart
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15376 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: implement VKI_XEN_DOMCTL_irq_permissionbart
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15375 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: support for XEN_DOMCTL_iomem_permissionbart
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15374 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: Handle XEN_DOMCTL_{test_assign,assign,deassign}_devicebart
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Andrew Cooper <andrew.cooper3@citrix.com git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15373 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: syswrap XEN_DOMCTL_pin_mem_cacheattrbart
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15371 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: syswrap XEN_DOMCTL_[gs]et_vcpu_msrsbart
The XEN_DOMCTL_[gs]et_vcpu_msrs work simiarly to the other get/set pairs, taking a vcpu, buffer and size. A query with a buffer of NULL is a request for the maximum size. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15370 a5019735-40e9-0310-863c-91ae7b9d1cf9
2015-06-28xen: syswrap XEN_DOMCTL_[gs]et_ext_vcpustatebart
The VKI_XEN_DOMCTL_[gs]et_ext_vcpucontext hypercalls have had interface changes, but are largly just extentions of the existing structure. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15369 a5019735-40e9-0310-863c-91ae7b9d1cf9