Commit Graph

1968 Commits

Author SHA1 Message Date
Mark Wielaard
5027860f74 mc-manual.xml: Fix some mismatched open/close tags.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15987
2016-09-30 22:32:24 +00:00
Philippe Waroquiers
b53d2291e8 Add an optional 2nd arg to leak-autofreepool to test performance
e.g. using the beloz
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

This shows that freeing a mempool with significant nr of elements
has a bad effect on performance

Note that no effort has been spent to avoid leaks in this
optional perf test. This is just to analyse the time taken to
free the pool.

The above loop shows that a medium size pool (e.g. < 1000000 elts)
can already take significant time, probably due to the quadratic
algorithm to clear the pool.
Note that the increase can vary a lot, probably depending on the
way the blocks are spread in the hash table: when lucky, the quadratic
algorithm probably somewhat becomes more linear if the elements
are 'properly' ordered in the hash table by deletion order.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15986
2016-09-29 20:04:43 +00:00
Philippe Waroquiers
4a12396ba8 Fix test so that leaked bytes is the same in 32 and 64 bits
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15985
2016-09-25 18:38:19 +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
9c0d0908f9 Follow up to r15905, properly guard memcheck/tests/amd64/shr_edx on clang. n-i-bz.
“error in backend: 32-bit absolute addressing is not supported in 64-bit mode”

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15946
2016-09-11 04:33:20 +00:00
Mark Wielaard
a7d9347bdf Use -std=c++0x for big_debuginfo_symbol to appease older compilers.
gcc 4.4 doesn't know -std=c++11, but does recognize -std=c++0x.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15944
2016-09-05 13:13:12 +00:00
Mark Wielaard
2f1ec093bc Allow building vbit_test when srdir != builddir.
Link against libvex-<arch>-<os>.a in top_builddir.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15940
2016-08-26 13:10:14 +00:00
Carl Love
d2450cd776 Power PC test suite for ISA 3.0, part 5 of 5
The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3244 is added in this commit.

bugzilla 364948

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15938
2016-08-15 21:54:04 +00:00
Julian Seward
d1b3d1f181 Fix completely bogus array indexing introduced in r15927 -- how did this
ever work?  Spotted by UBSAN.  Yay UBSAN!  Also update comments.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15929
2016-08-05 17:22:21 +00:00
Julian Seward
7ce46139ec Reimplement MC_(final_tidy) much more efficiently. This reduces its instruction
count by a factor of about 4.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15927
2016-08-05 14:59:50 +00:00
Ivo Raisr
2935e69718 Fix test memcheck/tests/descr_belowsp so as the stack
guard page is visible also on Solaris.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15919
2016-07-30 03:01:52 +00:00
Ivo Raisr
d04009b787 Fix test memcheck/tests/descr_belowsp a bit on Solaris.
On Solaris, '%p' outputs just a hexadecimal number
without '0x' prefix. This is perfectly valid but not
understood by VG_(strtok_get_address_and_size)().
Therefore use universal PRIxPTR.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15918
2016-07-29 20:52:21 +00:00
Philippe Waroquiers
2679aea160 Regression test for n-i-bz amd64: memcheck false positive with shr %edx
Valgrind side : reproducer for the false positive memcheck
+ announce the fix (VEX side in next commit)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15905
2016-07-12 20:48:31 +00:00
Carl Love
8db3f9d608 Power PC test suite for ISA 3.0, part 4
The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3222 is added in this commit.

Note, this is part 4 of 5.  The NEWS file will be updated when the ISA 3.0
support is complete.

valgrind bugzilla 363858


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15896
2016-06-29 18:09:57 +00:00
Carl Love
47216ba855 Add the HW register support for missing registers in get_otrack_shadow_offset_wrk(). The registers are: NRADDR, NRADDR_GPR2, (REDIR_STACK, TFHAR, TEXASR, TEXASRU, TFIAR, PPR, PSPB.
Bugzilla  36728

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15895
2016-06-27 15:50:29 +00:00
Ivo Raisr
ed93dc1aea Unify expected output of memcheck/tests/solaris/scalar test case
on amd64 and x86 architectures.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15886
2016-05-29 17:28:00 +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
Philippe Waroquiers
268ff84f7b Document brk segment limitation, reference manual in limit reached msg.
The msg telling brk cannot be extended confuses some users
so improve the documentation and have the msg referencing the doc.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15880
2016-05-22 20:48:09 +00:00
Ivo Raisr
ffcb955c34 Solaris: Add wrapper for setparam subcode of the door syscall.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15879
2016-05-16 12:51:27 +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
Carl Love
b52e8b1c78 Power PC Fix V bit error in 128-bit BCD add and subtract instructions
The original code was using the bcdadd / bcdsub instruction on the operand
shadow bits to calculate the shadow bits for the result.  This introduced
non-zero bits shadow bits in the result.   The shadow bits for these
instructions should be set to all valid or all invalid.  If one of the
argument shadow bits was one, then all of the shadow bits of the result should
be one.  Otherwise the result shadow bits should be zero.

This patch fixes the above bug in memcheck/mc_translate.c

Fixing the above bug broke the v-bit test.  The issue is the v-bit tester 
assumes the shadow bits for the operands of a given Iop can be set to one
for testing purposes.  The implementation of the bcdadd and bcdsub was passing
a constant value for the variable ps.  The ps value is an argument to the
instruction that specifies how to set the sign code of the result.  The
implementation of the instructions was changed to issue the instruction with
ps=0.  Then the result of the instruction is updated in the VEX code if ps=1.
This changed also results in cleaning up the vbit test code.  

This patch also fixes the issues with the v-bit test program.

Valgrind commit 3218

Bugzilla 360035


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15871
2016-04-26 19:53:56 +00:00
Ivo Raisr
da7df0f276 Valgrind is able to read compressed debuginfo sections in two formats:
- zlib ELF gABI format with SHF_COMPRESSED flag (gcc option -gz=zlib)
  - zlib GNU format with .zdebug sections (gcc option -gz=zlib-gnu)

Patch by: Aleksandar Rikalo <aleksandar.rikalo@imgtec.com>
Fixes BZ#303877



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15868
2016-04-23 20:28: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
7407c16737 Fix compiler warnings on Solaris 12 about assigning a function pointer
of an incompatible type to signal handler.
Untyped function pointer sa_handler() is no longer available
so we leverage sa_sigaction(int, siginfo_t *, void *) instead.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15858
2016-04-17 19:28:04 +00:00
Ivo Raisr
e6a8721902 Fix build on newer illumos distributions which streamlined inclusion of sys/regset.h.
This means that sys/regset.h needs to be included explicitly now.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15857
2016-04-17 15:57:11 +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
Julian Seward
a8ed4ccdd8 Improve performance of helperc_MAKE_STACK_UNINIT, especially for the
amd64-{linux,darwin} cases.  n-i-bz.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15850
2016-04-06 09:52:17 +00:00
Carl Love
e33db5dc56 Power PC Add test suite support for ISA 3.0, part 1, fixes to memcheck
This is a fix for memchech/mc_machine.c found by the nightly regression
test.  The fix is for valgrind commit 15837

valgrind bugzilla 359767



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15841
2016-03-30 20:09:26 +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
Julian Seward
c647b13523 MC_(helperc_MAKE_STACK_UNINIT): make the #if 0'd bits of code actually
compile.  This is clearly pointless but is done for a cleanliness
point of view.  No functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15836
2016-03-25 14:27:20 +00:00
Mark Wielaard
a848da57ad Add arm64 scalar test. Enable tested syscalls.
The new memcheck/tests/arm64-linux/scalar test is based on the
memcheck/tests/x86-linux/scalar test and contains all syscalls
that are also available on arm64. To make comparison of exp results
easier the order of the tested syscalls is the same as on x86.
This enables a couple extra arm64 syscalls. Part of the fix for
bug #359503 - Add missing syscalls for aarch64 (arm64).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15825
2016-03-09 16:18:36 +00:00
Ivo Raisr
6da8549607 Unbreak build of several regression tests on Solaris 12 with gcc 5.3
We need to move _XOPEN_SOURCE from 500 to 600 which
comes with '-std=c99'.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15821
2016-03-04 20:49:35 +00:00
Mark Wielaard
9c751d21ef Fix memcheck/tests/memalign_test expected output.
r15815 "Allow 8k and 32k page sizes" added an extra line in memalign_test.c.
This changed the line numbers in the output compared to the .exp file.
Just put everything on one (long) line to match expectations again.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15818
2016-02-28 10:37:55 +00:00
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
Philippe Waroquiers
f2e1687cb8 Fix misplaced closing parenthesis in various VG_(....) calls
At many places, we have:
   VG_(fun(a,b,c))
instead of
   VG_(fun)(a,b,c)
So, fix these cases, found using:
grep -n -i -e 'VG_([a-z][a-z0-9_]*[^a-z0-9_)]' *.c */*.c */*/*.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15776
2016-01-27 22:35:14 +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