1090 Commits

Author SHA1 Message Date
Petar Jovanovic
23ac24e19b mips: acquire exact page size using sysconf for unit_libcbase
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
2016-02-27 00:38:38 +00:00
Petar Jovanovic
e7e2cc219f Allow 8k and 32k page sizes
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
2016-02-26 16:05:29 +00:00
Philippe Waroquiers
4649a16580 Fix typo in Makefile.am : remove the second _
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15800
2016-02-18 21:41:01 +00:00
Philippe Waroquiers
76002f0b47 Add a test for bug 359133 Assertion 'eltSzB <= ddpa->poolSzB' failed
Test case provided by David Hallas



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15799
2016-02-18 21:32:46 +00:00
Ivo Raisr
9c83cafb93 Fix some compiler errors about accessing static variables
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
2016-02-18 17:15:45 +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
2428a44b84 Fix scalar test case for llseek on x86/Solaris.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15786
2016-02-12 13:57:50 +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
Ivo Raisr
f18a40c2c8 Fix expected output of test memcheck/tests/leak_cpp_interior on Solaris 12.
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
2016-01-26 10:34:16 +00:00
Ivo Raisr
8952c86a9c Fix compilation error on Solaris.
Include <sys/segments.h> only on x86/amd64 architecture.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15774
2016-01-26 04:31:04 +00:00
Philippe Waroquiers
c80f32e662 Change tests using --fullpath-after so as to work with ccache caching compiler
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
2016-01-22 22:06:02 +00:00
Mark Wielaard
dcb119cf41 Squash glibc warning about _BSD_SOURCE being deprecated tests.
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
2016-01-22 13:49:22 +00:00
Ivo Raisr
719b0574ea Fix expected stderr on Solaris for memcheck/tests/gone_abrt_xml.
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
2015-12-15 10:43:25 +00:00
Philippe Waroquiers
21ec256b95 Fix 191069 Exiting due to signal not reported in XML output
Patch from  Matthias Schwarzott (slightly modified)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15747
2015-12-13 16:53:46 +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
Carl Love
0201caa575 This is a fix to Bug 354797 which added the vbit test support for the
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
2015-11-25 17:48:25 +00:00
Ivo Raisr
d5266b32f7 Solaris syscall: Fix pset(getloadavg).
The buffer holds integers, not doubles.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15732
2015-11-19 09:34:29 +00:00
Ivo Raisr
68c788c973 Expected stderr of test cases wrapmalloc and wrapmallocstatic are overconstrained.
Fixes BZ#355455.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15727
2015-11-18 04:13:12 +00:00
Mark Wielaard
8b4dd5c47c BZ#355188 valgrind should intercept all malloc related global functions.
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
2015-11-15 16:50:43 +00:00
Carl Love
79c80505d3 Add ISA 2.07 vbit test support
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
2015-11-03 17:48:04 +00:00
Ivo Raisr
e7be5069c3 Solaris syscall: Add support for lwp_cond_signal(171).
Fixes BZ#354392.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15718
2015-10-26 16:13:05 +00:00
Philippe Waroquiers
6b5a479bda Fix 353891 Assert 'bad_scanned_addr < VG_ROUNDDN(start+len, sizeof(Addr))' 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
2015-10-22 19:14:30 +00:00
Florian Krohm
5085e06eb6 Fix a bug passing immediate values to ir_inject.c
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15710
2015-10-17 11:18:50 +00:00
Florian Krohm
1b73579e81 Link the vbit tester against libvex-<arch>-<os>.a
This allows to remove local copies of certain VEX functions.
VEX r3200 enables this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15709
2015-10-16 17:29:54 +00:00
Ivo Raisr
b6aeb1c9e6 Solaris syscall: Add support for lwp_cond_wait(170).
Provide scalar test as well.
Fixes BZ #353920.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15708
2015-10-16 12:20:20 +00:00
Ivo Raisr
9aaa41b23d Solaris syscall: Enable fchdir(120) - generic.
Provide scalar tests as well.
Fixes BZ #353917.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15707
2015-10-15 09:37:14 +00:00
Ivo Raisr
6ef7c1085f Solaris syscall: Add support for pset family (207).
Provide scalar tests as well.
Fixes BZ #353398.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15700
2015-10-12 19:10:42 +00:00
Ivo Raisr
386124cab0 Move more complicated tests out of memcheck/tests/solaris/scalar_ioctl
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
2015-09-29 18:57:56 +00:00
Ivo Raisr
cf2ca3123f Solaris ioctl: more of those sockio ioctl wrappers.
SIOCGLIFBRDADDR, SIOCGLIFCONF, SIOCGLIFFLAGS, SIOCGLIFNETMASK.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15689
2015-09-29 14:23:51 +00:00
Ivo Raisr
9c3ee43887 Solaris ioctl: more wrappers for sockio ioctls.
SIOCGIFCONF, SIOCGIFFLAGS, SIOCGIFNETMASK, and SIOCGIFNUM.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15686
2015-09-29 05:20:16 +00:00
Ivo Raisr
a0bde0618b Solaris syscall: Add support for system_stats (154).
Provide scalar test as well.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15684
2015-09-25 21:04:45 +00:00
Ivo Raisr
fe22c1e6e2 Provide test for AT_SUN_SYSSTAT_ADDR emulation.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15683
2015-09-25 20:53:09 +00:00
Florian Krohm
d6133786a6 Avoid a possible memory leak.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15673
2015-09-22 11:06:42 +00:00
Florian Krohm
a8a0c4bcce Add copyright/license comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15672
2015-09-22 07:21:50 +00:00
Florian Krohm
2b628c20a2 Update TODO list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15671
2015-09-22 07:04:25 +00:00
Florian Krohm
079e74fe78 Break a few overly long lines.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15670
2015-09-22 07:03:38 +00:00
Carl Love
7161ebc00f Add Power PC ISA check to the vbit-test
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
2015-09-16 23:33:40 +00:00
Rhys Kidd
c48c36cf86 Re-enable formerly hanging regression test on OS X.
Related to bz#350359 and vex: r3184.

On OS X 10.10

Before:

== 595 tests, 215 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 596 tests, 215 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15649
2015-09-12 06:12:27 +00:00
Florian Krohm
71246132f3 Update due to r13991.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15638
2015-09-07 19:21:54 +00:00
Florian Krohm
93504b89c4 Changes related to new IROp Iop_RoundF128toInt. See VEX r3183.
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
2015-09-05 20:39:27 +00:00
Mark Wielaard
758fab675c Fix bug #339636 Use fxsave64 and fxrstor64 mnemonics again.
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
2015-09-04 21:52:52 +00:00
Florian Krohm
d0cf6ac4fa Suppress unwanted clang 3.7 warnings.
Fix undefined behaviour in perf/tinycc.c


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15616
2015-09-02 15:47:33 +00:00
Julian Seward
b18e81a7af Rename the new option --expensive-definedness-check introduced in
r15594 to --expensive-definedness-checks.  (Pluralised it, iow.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15611
2015-09-01 08:48:04 +00:00
Ivo Raisr
7a4cc7d5fd Add support for ldsoexec on Solaris.
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
2015-08-31 21:31:09 +00:00
Florian Krohm
76ecd8f607 Ensure the testcase compiles with clang.
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
2015-08-31 21:18:18 +00:00
Julian Seward
5d3dfe7224 Make --partial-loads-ok=yes the default on all platforms, not just OS X.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15600
2015-08-31 10:36:02 +00:00
Philippe Waroquiers
8f0961e770 Change default value for --keep-stacktraces has been changed to alloc-and-free
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
2015-08-29 10:45:26 +00:00
Florian Krohm
2c79dd79f5 New memcheck command line option: --expensive-definedness-check
Pertains to BZ #340392


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15594
2015-08-27 17:50:47 +00:00
Mark Wielaard
70848c7696 Handle (unwanted) line number info in filter_defcfaexpr.
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
2015-08-18 14:34:49 +00:00
Julian Seward
683436b8ea arm32: make sure we actually generate real 64-bit loads/stores for the
64 bit tests, rather than two 32 bit transactions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15558
2015-08-16 17:23:50 +00:00