1173 Commits

Author SHA1 Message Date
Philippe Waroquiers
2f9cceafa3 introduce a test for n-i-bz fix bug in strspn replacement
c1eace647ca4f670ef9bec0d0fe72cdd25a96394 fixed a bug in strspn replacement.
Add a test to cover this fix.
2017-10-28 15:02:11 +02:00
Petar Jovanovic
91373819a3 mips: new Iops added to support MSA
New Iops are defined:
  Iop_Scale2_32Fx4, Iop_Scale2_64Fx2,
  Iop_Log2_32Fx4, Iop_Log2_64Fx2,
  Iop_F32x4_2toQ16x8, Iop_F64x2_2toQ32x4,
  Iop_PackOddLanes8x16, Iop_PackEvenLanes8x16,
  Iop_PackOddLanes16x8, Iop_PackEvenLanes16x8,
  Iop_PackOddLanes32x4, Iop_PackEvenLanes32x4.

Contributed by:
  Tamara Vlahovic, Aleksandar Rikalo and Aleksandra Karadzic.

Related BZ issue - #382563.
2017-10-27 16:27:24 +02:00
Petar Jovanovic
da3987aa18 mips32: add BE-exp files for several tests
This fixes several tests on mips32 BE platforms:

memcheck/tests/mips32/fadvise64
drd/tests/tc19_shadowmem
helgrind/tests/tc19_shadowmem
2017-10-02 14:54:20 +02:00
Petar Jovanovic
9fa2d21857 mips: fix typos for the recently added test
Correct name of the recently added test in Makefile.am.
2017-09-27 16:52:05 +02:00
Petar Jovanovic
8227e4a763 mips: new Memcheck test, bad_sioc
Check if Memcheck is able to recognize errors related to uninitialized
parameters in ioctl(SIOCSPGRP / SIOCATMARK) calls.

Test by Aleksandar Rikalo.
2017-09-27 15:55:16 +02:00
Philippe Waroquiers
f053756e28 Follow up to 345307 - Warning about "still reachable" memory when using libstdc++ from gcc 5
The bug itself was solved in 3.12 by the addition of __gnu_cxx::__freeres
in the libstdc++ and have valgrind calling it before exit.

However, depending on the version of the libstdc++, the test leak_cpp_interior
was giving different results.

This commit adds some filtering specific to the test, so as to not depend
anymore of the absolute number of bytes leaked, and adds a suppression entry to
ignore the memory allocated by libstdc++.

This allows to have only 2 .exp files, instead of 4 (or worse, if
we would have to handle yet other .exp files depending on the libstdc++
version).
2017-09-22 23:50:35 +02:00
Petar Jovanovic
211b0c303a mips: add clearing $ra to CLEAR_CALLER_SAVED_REGS macro
Return address register belongs to caller saved registers, and compiler can
use it to store temporary values. Clear it.
2017-09-15 16:04:18 +02:00
Rhys Kidd
55fe390c7a Fix missing pselect syscall (OS X 10.11). bz#379748
Based upon patch from Louis Brunner.
2017-09-03 12:55:52 -04:00
Petar Jovanovic
a1e5547a44 mips: remove incorrect implementation of several Iops
Remove incorrect implementation of
  Iop_DivModU64to32
  Iop_DivModS64to32
  Iop_DivModU128to64
  Iop_DivModS128to64
2017-08-22 16:05:00 +02:00
Petar Jovanovic
5f3cc6c828 mips: reimplement handling of div, divu and ddivu
Previous implementation misused some opcodes, and a side effect was
dead code emission.
To reimplement handling of these instructions, three new IoPs have been
introduced:

      Iop_DivModU64to64, // :: I64,I64 -> I128
                         // of which lo half is div and hi half is mod
      Iop_DivModS32to32, // :: I32,I32 -> I64
                         // of which lo half is div and hi half is mod
      Iop_DivModU32to32, // :: I32,I32 -> I64
                         // of which lo half is div and hi half is mod

Patch by Aleksandra Karadzic and Tamara Vlahovic.
2017-08-22 15:53:15 +02:00
Petar Jovanovic
9f3c890a9c mips: mute 'uninitialized' value compiler warning
fadvise64.c deliberately uses uninitialized value.
This patch removes the following warning:

warning: 'x' is used uninitialized in this function
2017-08-17 19:13:47 +02:00
Ivo Raisr
dfbf6cca38 Fix the Solaris build after development trunk has been renamed.
Effectively Solaris 12 is now becoming Solaris 11.4.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16464
2017-07-31 15:24:08 +00:00
Mark Wielaard
2b5eab6a8d memcheck/tests: Use ucontext_t instead of struct ucontext
glibc 2.26 does not expose struct ucontext anymore.

Signed-off-by: Khem Raj <raj.khem@gmail.com>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16457
2017-06-29 15:26:30 +00:00
Mark Wielaard
3ac87cf927 epoll_pwait can have a NULL sigmask.
According to the epoll_pwait(2) man page:

       The  sigmask  argument  may  be  specified  as  NULL,  in  which  case
       epoll_pwait() is equivalent to epoll_wait().

But doing that under valgrind gives:

==13887== Syscall param epoll_pwait(sigmask) points to unaddressable byte(s)
==13887==    at 0x4F2B940: epoll_pwait (epoll_pwait.c:43)
==13887==    by 0x400ADE: main (syscalls-2007.c:89)
==13887==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

This is because the sys_epoll_pwait wrapper has:

   if (ARG4)
      PRE_MEM_READ( "epoll_pwait(sigmask)", ARG5, sizeof(vki_sigset_t) );

Which looks like a typo (ARG4 is timeout and ARG5 is sigmask).

This shows up with newer glibc which translates an epoll_wait call into
an epoll_pwait call with NULL sigmask.

Fix typo and add a testcase.

https://bugs.kde.org/show_bug.cgi?id=381289

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16451
2017-06-17 13:49:22 +00:00
Ivo Raisr
2cc0e531ec Port changes from r16407 to Solaris OS.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16411
2017-05-23 21:37:50 +00:00
Ivo Raisr
f8a8e3de4d Fix expected output of brk tests after r16407.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16410
2017-05-23 21:22:31 +00:00
Petar Jovanovic
6618bb12bc mips32: remove assembler warning in memcheck/leak* tests
Use .set noat directive to prevent assembler from complaining about
subsequent instructions that use register $at.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16400
2017-05-19 13:51:02 +00:00
Philippe Waroquiers
7d1c3b23a6 Fix mempool2 test
mempool2 test was using a wrong address for the pool arguments
in the client requests VALGRIND_MEMPOOL_FREE.
So, instead of testing what it was supposed to test (e.g. reading
memory from a freed mempool block), this was all causing
an illegal memory pool address.
So, fix the calls, and add a specific test to verify the illegal
mempool address.

(detected while looking at bug 375415)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16369
2017-05-13 10:19:16 +00:00
Bart Van Assche
2393a4c5ca tests: Remove exception specifications
Exception specifications are a deprecated feature in C++11 and gcc 7
complains about these specifications. Hence remove these specifications.
This patch avoids that gcc reports the following:
    
  warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16360
2017-05-11 03:07:11 +00:00
Ivo Raisr
84ad3a82c2 Fix compilation problems with some unit tests on Ubuntu 16.10+.
Compiler produces position independent executables (PIE) by default
which gets in the way of some unit tests.
Fixes BZ#377066.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16349
2017-05-10 05:43:03 +00:00
Ivo Raisr
246bb0e25f Remove TileGX/Linux port.
Fixes BZ#379504.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16340
2017-05-08 17:21:59 +00:00
Ivo Raisr
d8f648486e Fix some spelling mistakes.
Fixes BZ#374719
Patch by: klemens <ka7@la-evento.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16336
2017-05-05 22:13:20 +00:00
Ivo Raisr
38edd50c0e Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16333
2017-05-04 15:09:39 +00:00
Ivo Raisr
99d603d2eb Follow up to SVN r16311.
Fix mismerge from SVN r16314.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16315
2017-04-27 07:45:16 +00:00
Ivo Raisr
c356e1c01f Syscall wrapper for prctl(PR_SET_NAME) must not check more than 16 bytes.
Fixes BZ#379039.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16314
2017-04-26 19:27:14 +00:00
Ivo Raisr
e8a32aa888 Valgrind reports INTERNAL ERROR in rt_sigsuspend syscall wrapper.
Fixes BZ#379094.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16311
2017-04-25 06:44:28 +00:00
Ivo Raisr
8d35572e60 Fix an INTERNAL ERROR problem in execve syscall wrapper.
Fixes BZ#378535.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16301
2017-04-10 20:36:00 +00:00
Ivo Raisr
76e451c60d fcntl syscall wrapper was missing flock structure check on Linux.
Fixes BZ#377930.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16287
2017-03-27 05:06:32 +00:00
Bart Van Assche
935a7fcdd8 memcheck/tests/unit_oset.c: Fix compiler warnings
Avoid that the compiler warns about using the result of an assignment
as a truth value.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16286
2017-03-24 02:07:14 +00:00
Ivo Raisr
d9f02db4c8 Fix for 377698 - Missing memory check for futex() uaddr arg for FUTEX_WAKE,
and FUTEX_WAKE_BITSET, check only 4 args for FUTEX_WAKE_BITSET,
and 2 args for FUTEX_TRYLOCK_PI.
Fixes BZ#377698.
Patch by: diane.meirowitz@oracle.com


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16285
2017-03-23 23:22:21 +00:00
Ivo Raisr
fc10a2f3de Solaris: include <sys/lgrp_user_impl.h> only on newer Solaris.
Follow up to SVN r16224 and r16225, BZ#376455. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16226
2017-02-15 15:22:05 +00:00
Ivo Raisr
72a8b52a60 Solaris: Add additional subcodes for lgrpsys(180) syscall
Fixes BZ#376455.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16225
2017-02-14 12:38:06 +00:00
Ivo Raisr
0f667376e6 Solaris: Add syscall wrapper for lgrpsys(180)
Fixes BZ#376455.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16224
2017-02-14 10:35:20 +00:00
Petar Jovanovic
16df59b858 fix leak-segv-jmp test for platforms with 64K pagesize
Increase the size of allocated array, so mprotect call does not end up
protecting non-allocated areas. This enables the test to work on
platforms with pagesize=64K.

Issue discovered on MIPS XLP machine with 64K pagesize.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16220
2017-02-03 01:19:55 +00:00
Petar Jovanovic
33a203f1cb force old implementation of std::string for leak_cpp_interior test
This patch forces leak_cpp_interior to be compiled using old implementation
of std::string.

Related issue #373069

Patch by Aleksandar Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16217
2017-01-31 18:22:20 +00:00
Petar Jovanovic
9f6e3a5cb5 Adding new filter to memcheck/tests/filter_stderr
This should fix issue with sendmsg test and glibc 2.22.

Glibc 2.22 introduced sysdeps/unix/sysv/linux/sendmsg.c that has
__libc_sendmsg function implementation (in comparison to earlier
implementation in syscall-template.S).
So, test suite needs to filter out this case, otherwise we get test
diffs such as:

 Syscall param sendmsg(msg) points to uninitialised byte(s)
-   at 0x........: sendmsg (in /...libc...)
+   at 0x........: sendmsg (sendmsg.c:28)

which are false positives.

This fixes memcheck/tests/sendmsg (stderr) on platforms with 2.22+ glibc.

Patch by Aleksandra Karadzic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16213
2017-01-27 18:20:50 +00:00
Petar Jovanovic
795ee051e6 mips32: add support for ptrace syscall
Add wrapers for ptrace syscall for mips32.

Patch by Aleksandra Karadzic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16211
2017-01-27 17:01:49 +00:00
Julian Seward
8840b0bb8d Add support for Iop_MaxNumF64, Iop_MinNumF64, Iop_MaxNumF32 and
Iop_MinNumF32, as introduced in vex r3293.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16202
2017-01-13 18:02:38 +00:00
Ivo Raisr
744910ac3b Some housekeeping related to recent r16175.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16176
2016-12-06 08:47:30 +00:00
Petar Jovanovic
55c565435d mips: add regression test for fadvise64
Add regression tests for fadvise64.

Change by A Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16175
2016-12-05 18:00:01 +00:00
Petar Jovanovic
d91042c29d Add CLEAR_CALLER_SAVED_REGS in leak-tree test
Motivation for this change is similar to what has already been done in other
leak-* tests. That is, call CLEAR_CALLER_SAVED_REGS (currently used only on
PPC and MIPS arches) to clear temporary registers that might be holding 
pointers lost in a previously called function.

This fixes memcheck/tests/leak-tree failure on some MIPS platforms.

Patch by Aleksandar Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16173
2016-12-05 16:29:24 +00:00
Petar Jovanovic
992cea3551 mips: implement CLEAR_CALLER_SAVED_REGS for memcheck tests
Implement CLEAR_CALLER_SAVED_REGS macro that is used for some memcheck
tests. This is done in order to clear temporary registers that still
might be holding pointers to lost memory regions.
Similar change has been made for PPC.

This fixes the following tests:

memcheck/tests/leak-cases-full           (stderr)
memcheck/tests/leak-cases-summary        (stderr)
memcheck/tests/leak-cycle                (stderr)
memcheck/tests/lks                       (stderr)

on some MIPS platforms.

Patch by Aleksandar Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16172
2016-12-05 16:03:21 +00:00
Ivo Raisr
8f6ff4a27b Solaris: Add syscall wrapper for sigsendsys(108)
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16145
2016-11-20 05:19:02 +00:00
Ivo Raisr
8e08fc91ec Solaris: Add syscall wrapper for sigsuspend(95)
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16144
2016-11-20 00:20:34 +00:00
Philippe Waroquiers
aa630a3169 Locally define vgPlain_scrcmp in 2 unit tests
Humph, this should have been part of :
   16122 Add VG_(strIsMemberXA) in pub_tool_xarray.h
which means that between 16122 and this revision, these 2 unit tests
will (very probably) not compile.
That will make bissect not easy :(


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16126
2016-11-11 14:26:54 +00:00
Ivo Raisr
89046d2a5c Move scalar test of lwp_private syscall to platform specific directories
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16114
2016-11-02 22:33:16 +00:00
Ivo Raisr
2dbada9642 Follow up to SVN r16105.
Forgot to include scalar.stderr.exp changes in the commit.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16107
2016-10-26 09:44:39 +00:00
Ivo Raisr
a32762d529 Solaris: Add wrapper for fcntl(F_DUPFD_CLOEXEC)
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16105
2016-10-25 04:55:35 +00:00
Carl Love
ae13bd7244 Update memcheck/tests/ppc64/power_ISA2_05.vgtest
The option   --workaround-gcc296-bugs=yes has been depricated and 
replaced with the option --ignore-range-below-sp=1024-1

Updated the vgtest file with this change.

No associated bugzilla.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16079
2016-10-19 17:23:19 +00:00
Julian Seward
766292973d Add to Memcheck a flag --ignore-range-below-sp=<offset>-<offset>, for
ignoring accesses on the stack below SP.  Serves as a more modern
replacement for --workaround-gcc296-bugs, which is now deprecated.
Fixes #360571.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16073
2016-10-18 17:16:11 +00:00