I had added parens to force the use of the function rarther than a
macro expanding to the _chk version. The _chk functions are now wrapped
so no longer need to keep the workaround.
The test was doing a write of an uninit ilocal 32byte char buffer.
This has started outputting junk resulting in a stdout diff. So
make sure that the buffer only contains zeros (but still uninit).
Hope the compiler doesn't get too smart.
== 721 tests, 46 stderr failures, 6 stdout failures, 0 stderrB failures, 0 stdoutB failures, 4 post failures ==
A couple more failures in none (empty-exe and scripts/shell). Otherwise quite like
macOS 10.14.
Much of the code merged from Louis Brunner's git repo. Many thanks once again
Louis.
As per tests/vg_regtest:
Expected stdout (filtered) is kept in <test>.stdout.exp* (can be more
than one expected output). It can be missing if it would be empty.
Add a few more ignore-fn options to the massif tests for the
extra leaks that are in Darwin 18.
Add some suppressions to a couple of memcheck tests that use
num-callers of 2 or 3. The shorter callsteack means some of the
many Darwin default suppressions don't match which was causing
these tests to fail.
Add more DRD suppressions for getaddrinfo. There seems to be a never
ending amount of conflicts in dyld.
Mixed up 2 files with previous commit. This also contains
a missing proto and the previous commit fixes issues with badly formed
segments. Needs more investigation.
Most of these changes are from Louis Brunner's GitHub repo.
The most imortant changes are to the memory space and to the code
related to getting the host filename during startup. This means
that when Valgrind crashes or hits an assert we now get a legible
host stacktrrace.
This also fixes none/tests/darwin/bug228343
Fix ioctl(fd, PROCMAP_QUERY, ...) so that valgrind correctly considers
memory referenced by vma_name_size and vma_name_addr members of struct
procmap_query as initialized by ioctl().
Extend ioctl syscall wrappers with needed PRE_MEM_WRITE() and
mainly POST_MEM_WRITE(). Add a testcase.
https://bugs.kde.org/show_bug.cgi?id=508328
The PFPO facility is always present on the supported machines.
- Remove VEX_HWCAPS_S390X_PFPO, s390_host_has_pfpo and EmFail_S390X_pfpo
- Update tests/s390x_features.c and none/tests/s390x/pfpo
- Update memcheck/tests/vbit-test
Part of fixing https://bugs.kde.org/show_bug.cgi?id=509562
The floating-point-extension facility is always present on the supported
machines.
- Remove s390_host_has_fpext and VEX_HWCAPS_S390X_FPEXT
- Remove EmWarn_S390X_fpext_rounding and EmFail_S390X_fpext
- Remove testscases none/tests/s390x/fpext_fail and fpext_warn
- Update tests/s390x_features.c and memcheck/tests/vbit-test
Part of fixing https://bugs.kde.org/show_bug.cgi?id=509562
memcheck/tests/descr_belowsp requires a sysctl
memcheck/tests/freebsd/scalar requires a kenrnel module
neither of trhe above are cleard/loaded by default.
There were numerous issues, particularly with syscall SYS_syscall
and the scalar tests. Only tested on amd64, I don't have access to
an OSX 10.12 or earlier machine to do any testing.
The key elements in VG_(client_syscall) are, when the PRE wrapper
does not handle the syscall
1. getSyscallArgsFromGuestState
2. getSyscallArgLayout
3. call PRE wrapper
either blocking
4. putSyscallArgsIntoGuestState
5. do_syscall_for_client
or non-blocking
6. VG_(do_syscall)
What has changed
----------------
struct SyscallArgs now like FreeBSD, stores both the
canonical_sysno (which is the final syscall number, never
SYS_syscall) and the original_sysno (which can be SYS_syscall).
These get set in getSyscallArgsFromGuestState which has
changed accordingly.
getSyscallArgsFromGuestState has changed to always get the layout
coresponding to the canonical layout. This was the cause of the
problems with the scalar tests - the arguments were effectively
out by one.
Many subsequent changes to the scalar test, filter and expected.
The scalar test still isn't quite right. __NR_kevent_qos is missing
a scalar error from argument 6. That's the one with special case
handling because it is a register argument for a normal syscall
but a stack argument for syscall SYS_syscall.
The perl script filter_memcheck removes callstack elements that
are not of interest and changes vg_replace_strmem.c/vg_replace_malloc.c
line numbers to '...'. It protects lines containing the testcase
name.
When the testcase name is the same as the C function being tested
that's not really what we want. My perl isn't really good enough
to be able to only change the line numbers when it is a 'tool file'.
Instead I'm renaming the testcase.
Also start trying to del with some redir issues.
For some libc functions the plain function gets replaced by a
checked version (not sure if this is only for debug builds).
For instance in /usr/include/secure/_string.h there are a load of macros
that look like
/* void *memccpy(void *dst, const void *src, int c, size_t n) */
__builtin___memccpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
To defeat these macros I've put the function name in parens. That hasn't
solved the issue. In addition these seems to be an ifunc like mechanism
that resolves calls to platform functions. For instance
nm /usr/lib/system/*dylib | grep memcc
0000000000081e14 T ___memccpy_chk
U __platform_memccpy
I _memccpy (indirect for __platform_memccpy)
0000000000004eb4 T __platform_memccpy
That matches what I see in lldb (memccpy then function lookup code then _platform_memccpy).
Need to look at how indirects work.
Use -q to hide Darwin leaks in HEAP SUMMARY
The pcmpgt test uses uint64_t whish is unsigned long long on Darwin
but unsigned long on all other amd64 OSes
Swap malloc_zone_memalign with posix_memalign
Darwin libc is quite incontinent, so use filter_xml_leak
in a few places rather than filter_xml.
Also old Darwin 17.7 sed doesn't understand "+1d" to delete the
matched line and the next line. So use N to join, s to delete the
newline and another match with d to delete the joined linbes.
The filter removes used suppression lines and duplicate lines.
Old Darwin sed doesn't understand 'M{}', so use "cat -s" to remove
duplicate blank lines instead.
Like so:
/usr/bin/ld: int3-x86.o: warning: relocation in read-only section `.text'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
Link with -no-pie.
- Update COPYING and VEX/LICENSE.GPL to version 3.
- Update README, NEWS, docs/manual license and contributing text.
- Update file headers to say either version 3 of the License,
or (at your option) any later version.
- Leave tests and perf file headers as is, unless the code is derived
from Valgrind/VEX.
- Leave valgrind.h, cachegrind.h, callgrind.h, drd.h, helgrind.h,
memcheck.h and dhat.h Hybrid-BSD licensed.