Set exact value of VKI_PAGE_SIZE by calling sysconf(_SC_PAGESIZE).
This should set a correct value to this variable on MIPS systems with
different page sizes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15817
Allow 8k and 32k page sizes in memalign and other memory related tests.
This fixes crashes in the tests on systems with 8k or 32k pagesize.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15815
from non-static inline functions reported by gcc 5.3:
warning: "locf" is static but declared in inline function "fun_f" which is not static
While at it, silence also compiler warning about uninitialized
variable "result" when calling fun_a().
n-i-bz
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15797
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
C++ allocator from Solaris Studio allocates for std::string
57 bytes instead of former 40 bytes on 64-bit, and 45 bytes instead of 28 on 32-bit.
Confirmed with truss and --trace-alloc=yes.
n-i-bz
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15775
ccache sometimes causes the source file absolute name to be another
full path (not $PWD).
This means that the badfree3 and varinfo5 tests can fail due to
the full path after not being match on $PWD.
So, rather ask full path after a part of the path that is stable
even when ccache decides to reuse a already compiled object from
another directory.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15771
glibc 2.20 deprecated _BSD_SOURCE and _SVID_SOURCE and now requires
_DEFAULT_SOURCE to be defined instead. Add _DEFAULT_SOURCE define to
prevent warnings like:
In file included from /usr/include/stdio.h:27:0,
from stack_switch.c:5:
/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
^
See https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15768
On Solaris, the stack frame looks like:
<stack>
<frame>
<ip>0x........</ip>
<obj>/lib/amd64/libc.so.1</obj>
<fn>kill</fn>
</frame>
<frame>
<ip>0x........</ip>
<obj>.../gdbserver_tests/gone</obj>
<fn>(below main)</fn>
</frame>
</stack>
because Solaris libc does not currently contain DWARF CFI and
stack unwinder gets only return address from _start().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15750
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
Power 8 instructions.
The patch for bug 354797 moved the declaration for rc outside of the
architecture #ifdef. This results in an message about rc being unused
on architectures other then s390 and powerpc. This commit eliminates
the issue by:
powerpc: move rc declaration into #ifdef for powerpc.
Remove tab, put in missing break.
s390: remove rc declaration from inside case statement. Put rc declaration
before the switch statement but within the #ifdef for s390 so it will
be declared for use in both case clauses.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15738
This implements the interception of all globally public allocation
functions by default. It works by adding a flag to the spec to say the
interception only applies to global functions. Which is set for the
somalloc spec. The librarypath to match is set to "*" unless the user
overrides it. Then each DiSym keeps track of whether the symbol is local
or global. For a spec which has isGlobal set only isGlobal symbols will
match.
Note that because of padding to keep the addresses in DiSym aligned the
addition of the extra bool isGlobal doesn't actually grow the struct.
The comments explain how the struct could be made more compact on 32bit
systems, but this isn't as easy on 64bit systems. So I didn't try to do
that in this patch.
For ELF symbols keeping track of which are global is trivial. For pdb I
had to guess and made only the "Public" symbols global. I don't know
how/if macho keeps track of global symbols or not. For now I just mark
all of them local (which just means things work as previously on platforms
that use machos, no non-system symbols are matches by default for somalloc
unless the user explicitly tells which library name to match).
Included are two testcases for shared libraries (wrapmalloc) and staticly
linked (wrapmallocstatic) malloc/free overrides that depend on the new
default. One existing testcase (new_override) was adjusted to explicitly
not use the new somalloc default because it depends on a user defined
new implementation that has side-effects and should explicitly not be
intercepted.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15726
The ISA 2.07 support adds new Iops as well as support for some existing
Iops. None of these Iops have been enabled in the vbit tester. This commit
adds the needed support to the files in memcheck/tests/vbit-test.
These changes add support for additional immediate operands and additional
undefined bit checking functions.
There are additional changes to files VEX/priv/ir_inject.c and VEX/pub/libvex.h
that are in VEX commit 3202
Bugzilla 354797 was created for this issue.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15720
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
to memcheck/tests/solaris/ioctl.
While at it, remove a fixed size buffer as reported by Florian Krohm.
n-i-bz
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15690
The support for the Valgrind Iops is dependent on the Power processor
support for various instructions. The instructions supported by a
given Power processor is based on the version of the ISA. The patch
add a check to the vbit-test to ensure it does not try to test an Iop
that generates an instruction on the host that is not supported.
This patch fixes bugzilla 352765.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15653
s390: Add testcase for fixbr.
Patch by Andreas Arnez <arnez@linux.vnet.ibm.com>.
Part of fixing BZ #350290.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15629
Just add a configure check to see if the assembler understands
fxsave64/fxrstor64 and fall back to the old-school rex64 prefix
otherwise.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15625
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
clang up to and including 3.6.2 does not recognise the fxsave64
and fxrstor64 mnemonics. It does recognise rex64/fxsave etc..
Related to BZ #339636.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15606
Default value changed following discussion on valdev.
Giving more information for errors with freed blocks can help
when investigating difficult problems (e.g. double free, programs
using 'cleanup list' collecting different types of memory, ...)
Regression tested on various setup (x86, ppc64, s390x, amd64, debian or fedora)
Tests that have only one exp files have been updated to use the output
of the new default value in their .exp file.
Tests having more than one exp file have been changed so as to
specify explicitely the previous clo default value (i.e. adding
--keep-stacktraces=alloc-then-free in the vgtest file).
Possibly, some tests might fail on non tested platforms
(e.g. mips, macos, solaris, tilegx).
Fixes should be straightforward, using one of the above fix techniques.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15597
This is just a testsuite cleanup. In the case defcfaexpr was compiled
with line number information (which might happen in some distro builds)
just throw it away because the expected output just wants to see the
function names.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15566