sys_socketcall was duplicated in syswrap-{ppc64|ppc32|arm|mips32|s390x}-linux.c
=>
* Similarly for what was done for sys_ipc, factorise the code in syswrap-linux.c
* re-enabled PRE_MEM_READ for VKI_SYS_SENDMSG and VKI_SYS_RECVMSG
(PRE_MEM_READ calls were commented out around 2003, for what
was supposed a glibc bug.
The PRE_MEM_READ calls were already re-enabled in s390x)
* s390x also had some more checking to verify the addressibility of
the args and fail the syscall with EFAULT if not addressable
=> same checks are now done for all platforms.
(tested on x86/amd64/mips32/s390x/ppc32/ppc64,
compiled for arm-android-emulator)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13104
* use normal 'char' (when possible) rather than 'unsigned char'
* fix bug in case a character val >= 128 is given in a -c command
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13098
Additional refinement in PRE(sys_ipc) on which arguments to check for the call.
This is still a simplistic check, yet it should resolve additional cases.
One of the resolved cases is memcheck/tests/sem on MIPS.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13084
Depending on the semctl command (arg3), arg4 might or might not be needed.
The PRE(sys_ipc) multiplexed syscall for semctl was always checking
all 4 args.
The fix consists in dereferencing the 4th arg (which in sys_ipc is ARG5)
only if the semctl syscall cmd implies 4 arguments.
This avoids the false positive on linux x86.
Note that PRE(sys_ipc) is still too simplistic as it assumes
that 6 args are always read, which is not the case.
This seems to cause false positive on mips:
memcheck on none/tests/sem gives:
Syscall param ipc(fifth) contains uninitialised byte(s)
It would be nice to implement the multiplexed PRE(sys_ipc) by
calling the PRE(sys_xxxx) similar PRE, depending on ARG1 of sys_ipc.
This would then avoid the simplistic PRE(sys_ipc) logic without duplicating
the logic in PRE(sys_semctl) (and all other sys_ipc multiplexed syscalls).
However, I found no easy way to do that.
With the current fix, some logic about semctl is partially duplicated between
the PRE(sys_ipc) (for platforms such as x86 having a multiplexed sys call)
and PRE(sys_semctl) (for platforms such as amd64, having a direct sys call)
to fix the false positive encountered on x86.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13082
Reserve space for frame header in disp_run_translations, as some optimizations
may decide to use it. This should fix issue #307141.
Related link:
https://bugs.kde.org/show_bug.cgi?id=307141
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13080
Rev 13078 removed a PRE call (for SEMCTL) in the POST(sys_ipc).
This commit adds the correct POST call for SEMCTL in POST(sys_ipc).
(note: some tests are missing in this area, as removing PRE
and adding POST did not cause any test result to change).
This is the last patch to restructure the sys_ipc code.
After this patch, should be able to do the real fix
for 23837 (semctl GETVAL false positive)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13079
Now that the PRE/POS(sys_ipc) code is not duplicated anymore,
fix two strange things in this code:
* PRE(sys_ipc) : add missing ; after the call PRE_REG_READ6
(strange that this was compiling without it ???)
* POST(sys_ipc) : it seems there was a copy/paste of
the PRE(sys_ipc) code for VKI_SEMCTL.
Cannot understand why we would need to call again
deref_Addr and ML_(generic_PRE_sys_semctl) in the POST(sys_ipc).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13078
In case of out of memory, Valgrind will output
the state of the address space manager and of the arena.
Then it will output a message to inform the user about the out of memory.
In case out of memory happens again while outputting the aspacemgr
or arena info, then another trial is done to only output the user msg.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13077
(allows to have the list of opened fds and the associated info
on request from GDB or from the shell, using vgdb)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13072
Add support to properly handle TEQ, ADD and SUB instructions that generate
exceptions on MIPS platforms. A SignalException test for MIPS32 has also been
added, so we can cover more cases.
This resolves:
none/tests/faultstatus
gdbserver_tests/mcsignopass
gdbserver_tests/mcsigpass
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13059
New function write_cache_info to dump what was detected for debugging
purposes.
New function cache_info_is_sensible to ensure that autodetected
cache info lives up to the promises made in libvex.h.
Moved the trace-cache related kludgery to cachegrind where it belongs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13053
patch from Mark Wielaard.
(with small modifications).
Also clarified some comments related to the resume reply.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13052
Makes it easier to figure out what was not initialised.
Thanks, once again, to Julien Grall.
From: Ian Campbell <ian.campbell@citrix.com>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13050
This is pretty dodgy on 64 bit systems.
Thanks to Julien Grall.
From: Ian Campbell <ian.campbell@citrix.com>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13049
all take const HChar * arguments.
__FILE__ and __func__ expand into string literals (or character
arrays initialised by them), as do strings created by the preprocessor
e.g. #stuff.
This change reduces the number of warnings from 17000+ to ~5500
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13039
For example, options below are silently "accepted"+ignored:
valgrind --profile-heaps=yes --max-stackframes=35 memcheck/tests/trivialleak
valgrind --profile-heaps=oui --max-stackframes=3.141592654 memcheck/tests/trivialleak
Also fixed the on-line --help output for option --core-redzone-size
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13037
It's reorg only. No new cache autodetection stuff has been added.
coregrind
pub_tool_cpuid.h is removed as it is no longer exposed to tools.
Its contents has moved to pub_core_cpuid.h.
New file: coregrind/m_cache.c to contain the autodetect code for
cache configurations and define other cache characteristics that
cannot be autodetected (i.e. icaches_maintain_coherence). Most of
cg-arch/x86-amd64.c was moved here. The cache detection code for
x86-64 needs to be fixed to properly initialise VexCacheInfo. It
currently has cachegrind bias.
m_cache.c exports a single function (to coregrind):
VG_(machine_get_cache_info)(VexArchInfo *vai)
This function is called from VG_(machine_get_hwcaps) after hwcaps have
been detected.
cachegrind
Remove cachegrind/cg-{ppc32,ppc43,arm,mips32,s390x,x86-amd64}.c
With the exception of x86/mamd64 those were only establishing a
default cache configuration and that is so small a code snippet that
a separate file is no longer warranted. So, the code was moved to
cg-arch.c. Code was added to extract the relevant info from
x86-amd64.
New function maybe_tweak_LLc which captures the code to massage the
LLc cache configuration into something the simulator can handle. This
was originally in cg-x86-amd64.c but should be used to all architectures.
Changed warning message about missing cache auto-detect feature
to be more useful. Adapted filter-stderr scripts accordingly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13028
coregrind/m_translate.c does not compile on ppc64 (ppc32 maybe also?)
due to missing include file.
Note: libvex_emnote.h is unconditionally included, even if only
useful for ppc. I suppose we do not want #ifdef for that.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13017
Enable wrappers for MIPS for the following two system calls:
- sys_settimeofday, and
- sys_stime.
Resolves https://bugs.kde.org/show_bug.cgi?id=306783
Patch contributed bederic M. <dark_footix@yahoo.fr>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12995