1161 Commits

Author SHA1 Message Date
Bart Van Assche
14362fe2e2 include/valgrind.h: Fix spelling in a source code comment
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16156
2016-11-26 02:42:11 +00:00
Julian Seward
cad347059e Bug 348616 - Wine/valgrind: Warning: noted but unhandled ioctl 0x5390
with no size/direction hints. (DVD_READ_STRUCT)

Patch from Austin English (austinenglish@gmail.com).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16153
2016-11-23 13:26:23 +00:00
Julian Seward
15f0421b15 Bug 352767 - Wine/valgrind: Warning: noted but unhandled ioctl 0x5307
with no size/direction hints. (CDROMSTOP).

Patch from Austin English (austinenglish@gmail.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16152
2016-11-23 13:15:22 +00:00
Ivo Raisr
8f6ff4a27b Solaris: Add syscall wrapper for sigsendsys(108)
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16145
2016-11-20 05:19:02 +00:00
Ivo Raisr
8e08fc91ec Solaris: Add syscall wrapper for sigsuspend(95)
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16144
2016-11-20 00:20:34 +00:00
Philippe Waroquiers
39c197ef4d Improve the outer/inner setup: have the outer reporting the inner guest stacktrace
Note: the outer now unconditionally report the inner guest stacktrace.
If that would be a problem, we might add a sim-hint no-inner-guest-stacktrace
to optionally disable such outer behaviour.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16139
2016-11-19 13:24:13 +00:00
Philippe Waroquiers
471900460d Add typedef Alloc_Fn_t/Free_Fn_t in pub_tool_basics.h, use them everywhere
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16138
2016-11-18 21:54:09 +00:00
Philippe Waroquiers
f9386afa89 Addition of the pub_tool_xtree.h and pub_tool_xtmemory.h modules, and of the --xtree-memory* options
This commit is the bulk of the new code.
There is however no functional impact yet : the new modules are not used by anybody.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16123
2016-11-11 14:07:03 +00:00
Philippe Waroquiers
b86956b6b9 Add VG_(strIsMemberXA) in pub_tool_xarray.h
This allows to search more efficiently a string in an xarray of string.
(support work for xtree)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16122
2016-11-11 13:55:07 +00:00
Philippe Waroquiers
599a062f61 Support pool of unique string in pub_tool_deduppoolalloc.h
This is support code for the xtree implementation.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16120
2016-11-11 13:30:08 +00:00
Ivo Raisr
7708e249b8 Support '%' in symbol Z-encoding.
Fixes BZ #371869.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16112
2016-11-02 21:50:19 +00:00
Philippe Waroquiers
3553ac9aad Add some more comments in pub_tool_debuginfo.h about memory persistence/ownership
and have m_debuginfo.c referencing these comments.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16106
2016-10-25 20:46:00 +00:00
Ivo Raisr
a32762d529 Solaris: Add wrapper for fcntl(F_DUPFD_CLOEXEC)
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16105
2016-10-25 04:55:35 +00:00
Petar Jovanovic
5645228957 mips: fix coredump creation in Valgrind
Coredumps created for MIPS are not valid today. Update the list of
registers that have to be saved, and use the structure defined in
kernel.

Patch by Aleksandar Rikalo.
It fixes BZ#351692.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16080
2016-10-19 17:49:06 +00:00
Julian Seward
71b25c5da3 Add support for Linux perf-events ioctls. Fixes #368419.
Patch from Keno Fischer (keno@juliacomputing.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16077
2016-10-19 16:08:25 +00:00
Julian Seward
766292973d Add to Memcheck a flag --ignore-range-below-sp=<offset>-<offset>, for
ignoring accesses on the stack below SP.  Serves as a more modern
replacement for --workaround-gcc296-bugs, which is now deprecated.
Fixes #360571.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16073
2016-10-18 17:16:11 +00:00
Philippe Waroquiers
38fab04de9 Clarify name and description/manual for meta mempool
* rename macro VALGRIND_CREATE_META_MEMPOOL
     to VALGRIND_CREATE_MEMPOOL_EXT
* abort execution if a pool is marked as auto_free but is not a meta pool
  + removed test leak-autofreepool-3.vgtest, which now aborts.
* reword/clarify valgrind.h explanations for meta pool
* similarly reword/clarify the manual



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16042
2016-10-15 12:59:04 +00:00
Philippe Waroquiers
7ac00163a3 fix 369468 Remove quadratic metapool alg. using VG_(HT_remove_at_Iter)(VgHashTable *table)
Based on a patch from Ruurd Beerstra
but reworked VG_(HT_remove_at_Iter) so that
the function is implemented without touching the rest of m_hashtable.c
to ensure no performance impact on other hash table usages.

Testing with
for f in 1 2 3 4 5 6 7 8 9; do echo $f;  time ./vg-in-place -q ./memcheck/tests/leak-autofreepool 2 $(expr $f \* 100000); done|&grep user

With the patch :
user	0m0.524s
user	0m0.660s
user	0m0.784s
user	0m0.916s
user	0m1.064s
user	0m1.192s
user	0m1.316s
user	0m1.496s
user	0m1.632s

Without the patch, the same gives:
user	0m4.464s
user	0m16.776s
user	0m24.472s
user	1m5.544s
user	1m21.168s
user	1m40.500s
user	1m54.884s
user	4m58.308s
user	5m34.060s



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16041
2016-10-15 09:30:39 +00:00
Petar Jovanovic
fb8ddbf24a mips64: support for prctl(GET/SET_FP_MODE) syscalls
Add MIPS specific wrapper for prctl(GET/SET_FP_MODE) syscalls to
support FP32/FP64 mode switch.

Patch by Aleksandar Rikalo.

Related VEX change r3253.

Related bug - BZ #366079.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16003
2016-10-04 15:19:10 +00:00
Mark Wielaard
be052139d6 Don't require the current working directory to exist. Bug #369209.
At startup valgrind fetches the current working directory and stashes
it away to be used later (in debug messages, read config files or create
log files). But if the current working directory didn't exist (or there
was some other error getting its path) then valgrind would go in an
endless loop. This was caused by assuming that any error meant a larger
buffer needed to be created to store the cwd path (ERANGE). However
there could be other reasons calling getcwd failed.

Fix this by only looping and resizing the buffer when the error is
ERANGE. Any other error just means we cannot fetch and store the current
working directory. Fix all callers to check get_startup_wd() returns
NULL. Only abort startup if a relative path needs to be used for
user supplied relative log files. Debug messages will just show
"<NO CWD>". And skip reading any config files from the startup_wd
if it doesn't exist.

Also add a new testcase that tests executing valgrind in a deep,
inaccessible and/or non-existing directory (none/tests/nocwd.vgtest).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15989
2016-10-01 11:54:38 +00:00
Ivo Raisr
f2b34df721 Added meta mempool support into memcheck for describing a custom allocator which:
- Auto-frees all chunks assuming that destroying a pool destroys all
  objects in the pool
- Uses itself to allocate other memory blocks
Unit tests included.
Fixes BZ#367995
Patch by: Ruurd Beerstra <ruurd.beerstra@infor.com>



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15984
2016-09-24 21:15:44 +00:00
Ivo Raisr
98273bc5f4 Solaris: Add ioctl wrapper for MNTIOC_GETEXTMNTENT.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15981
2016-09-23 23:00:21 +00:00
Rhys Kidd
ab2edd2901 Preliminary support for macOS Sierra (10.12). Does not fully resolve bz#365327.
No regressions on OS X 10.11.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15976
2016-09-22 02:55:24 +00:00
Rhys Kidd
60defe8a5f MAXSYSCALL for OS X 10.11.6 (xnu 3248.60.10) was indeed 500. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15947
2016-09-11 05:28:59 +00:00
Ivo Raisr
6260274e4e Follow recent Solaris development with respect to
SUNWDTRACE program header. Newer Solaris no longer utilizes
this program header as a scratchspace for DTrace fasttrap
provider, before libc is loaded.
For the time being, it serves as a space for initial thread
pointer.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15936
2016-08-12 22:28:50 +00:00
Petar Jovanovic
030cea68c8 mips32: add support for FPXX mode
With this patch, MIPS32 Valgrind compiled with -mfpxx can handle all types
(regarding FP_ABI flag) of MIPS32 ELFs.

- Functions arch_elf_pt_proc() and arch_check_elf() are added to elf reader
  according to linux/fs/binfmt_elf.c from Linux 4.1;
- Processing .MIPS.abiflags section and initializing appropriate FPU mode
  for MIPS32 are added;
- Emulation of prctl(GET/SET_FP_MODE) sys-calls are implemented for MIPS32.

Patch by Aleksandar Rikalo <Aleksandar.Rikalo@imgtec.com>

Related VEX change: r3243.

This implements BZ#366079.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15934
2016-08-10 14:38:10 +00:00
Julian Seward
7c3b4bf540 Make "ashmem" and "binder" ioctls be handled properly on 64-bit ARM Android,
rather than falling through to the generic handler and being mishandled.
Fixes #360574.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15923
2016-08-04 21:11:28 +00:00
Ivo Raisr
fbaa6ad350 Solaris: Further refinement of r15882 for Solaris versions
which do not have <sys/sysnvl.h> header file.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15885
2016-05-29 12:10:58 +00:00
Ivo Raisr
d894770ee3 Solaris: Add ioctl wrappers for DINFOUSRLD and DINFOIDENT.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15884
2016-05-29 09:29:28 +00:00
Ivo Raisr
aad88ea2d0 Solaris: Add syscall modctl with several commands implemented.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15882
2016-05-28 22:05:43 +00:00
Ivo Raisr
8ace9b4f06 Solaris ioctl: Add wrapper for I_FLUSH.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15878
2016-05-16 11:38:29 +00:00
Ivo Raisr
662eab632a Solaris ioctl: Add wrapper for I_FIND.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15877
2016-05-16 06:12:27 +00:00
Ivo Raisr
91f7614767 Solaris: Add syscall wrapper for sysfs(84)
Fixes BZ#361926


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15862
2016-04-19 15:57:13 +00:00
Ivo Raisr
a91bd93900 Fix build on newer illumos distributions where struct fpchip_state
was renamed to _fpchip_state.
n-i-z


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15856
2016-04-17 10:05:29 +00:00
Ivo Raisr
5b3c2f59c5 Run __gnu_cxx::__freeres() cleanup function available
from libstdc++ when available, similar to existing __libc_freeres().
New option --run-cxx-freeres=<yes|no> can be used to change whether
this cleanup function is called or not.

Note that __gnu_cxx::__freeres() is currently available
only in gcc 6. It is not yet decided what to do about
libstdc++ from gcc 5.
Tracked under https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69945
for libstdc++.

Fixes BZ#345307 (partially).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15840
2016-03-30 17:53:03 +00:00
Ivo Raisr
d3eb7a8894 Add support for repository cache protocol version 31
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15831
2016-03-16 15:08:42 +00:00
Mark Wielaard
eba2cff480 Use correct syscall numbers on arm64. Fix rename, dup2 and getpgrp.
We were using some wrong syscall numbers in vki-scnums-arm64-linux.h
arm64 doesn't implement a couple of old deprecated system calls like
rename, dup2, getpgrp and fork. Adjust m_libcfile.c rename and dup2
functions to use renameat (also on tilegx) and dup3 (with fcntl fallback
for bad oldfd). And in m_libcproc.c implement getpgrp as getpgid(0).
Also don't compile the fork syswrap on arm64 (it only supports clone).

In practice this only affected callgrind which was unable to rename
dump files in some cases and ELF core dumps might have contained some
bogus prstatus fields.

Related to bug #359503 - Add missing syscalls for aarch64 (arm64)
Reported by Marcin Juszkiewicz who also posted a nice overview
of system calls on different linux architectures:
https://marcin.juszkiewicz.com.pl/2016/03/05/from-a-diary-of-aarch64-porter-system-calls/

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15824
2016-03-09 16:18:34 +00:00
Ivo Raisr
e059272ce0 Solaris door: Add support for REP_PROTOCOL_ENTITY_FMRI
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15819
2016-02-29 20:20:36 +00:00
Petar Jovanovic
d7a9a37a07 mips: determine page size at runtime
Instead of passing an option to the configure script, use runtime detection
of the page size. Remove the "--with-pagesize" parameter from the configure
script.
Also accept 8k and 32k as valid page sizes.

Patch by Maran Pakkirisamy

It fixes BZ#342356.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15813
2016-02-26 15:30:53 +00:00
Ivo Raisr
782d01dd78 Enable remote debugging for position independent executables
on Solaris. With gcc 5.3, PIEs can be produced on Solaris 12.

gdb on Solaris requires AT_ENTRY to correctly work with those.
See very long comment before function svr4_exec_displacement().
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15810
2016-02-23 21:48:13 +00:00
Mark Wielaard
3c4de2eb09 Bug 359703 s390: wire up separate socketcalls system calls
The linux 4.3 s390 kernel has separate system calls that were originally
hidden behind the socketcall multiplexer system call. Newer glibc versions
will use these direct system calls instead of socketcall when available.
Causing several regtest failures.

This fix simply wires up the split out system calls directly to the
existing syswrap handlers for s390.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15802
2016-02-23 15:19:49 +00:00
Ivo Raisr
f71b442444 Solaris syscall: commands A_GETSTAT and A_SETSTAT
for auditon(2) subcode of the auditsys() syscall
were removed in Solaris 12.
However they stay for Solaris 11 and illumos.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15791
2016-02-17 18:11:32 +00:00
Ivo Raisr
24e1e9f493 Solaris syscall: Add support for getrandom(143).
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15782
2016-02-05 22:57:42 +00:00
Mark Wielaard
68a1308014 Bug #358030 Support direct socket calls on x86 32bit (new in linux 4.3)
Patch by ronald.wahl@raritan.com.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15764
2016-01-20 22:24:43 +00:00
Florian Krohm
6389086806 Followup to r15762. Add missing type in cast expression.
Do not use C++ comments. They are not allowed in this file.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15763
2016-01-17 20:34:53 +00:00
Florian Krohm
d6156d8f84 Avoid an MSVC compiler warning about an unused function parameter.
Fixes BZ #356817


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15762
2016-01-17 16:20:14 +00:00
Ivo Raisr
e3df68d823 Add support for repository cache protocol version 27.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15742
2015-12-04 17:37:41 +00:00
Petar Jovanovic
6b95752621 mips: add missing "memory" to the clobber list
Add "memory" to the clobber arguments of VALGRIND_DO_CLIENT_REQUEST_EXPR.

This fixes memcheck/tests/vbit-test/vbit-test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15740
2015-11-27 14:51:33 +00:00
Ivo Raisr
8baa800e63 Implement properly setjmp/longjmp on Solaris x86/amd64.
The default implementation provided by __builtin functions
does very weird things.
Uncovered by Philippe's commit r15716.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15734
2015-11-21 21:35:34 +00:00
Rhys Kidd
ff615aca37 Resolve build error on OS X, from r15728. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15733
2015-11-21 00:37:33 +00:00