2036 Commits

Author SHA1 Message Date
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
Julian Seward
5cc18ff30b Improve the implementation of expensiveCmpEQorNE.
.. so that the code it creates runs in approximately half the time it did
before.  This is in support of making the cost of expensive (exactly)
integer EQ/NE as low as possible, since the day will soon come when we'll
need to enable this by default.
2017-08-31 11:11:25 +02:00
Ivo Raisr
74b0936752 Mention AddrCheck at Memcheck's command line option --undef-value-errors=no 2017-08-28 12:43:34 +02: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
Philippe Waroquiers
dc0fb705e9 Various minor fixes and correction in user manual and monitor command help
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16466
2017-08-01 20:21:38 +00: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
Philippe Waroquiers
f488879e5f Removes a useless part of a condition, as discussed in bug 375415
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16402
2017-05-20 16:13:33 +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
Julian Seward
e706fbfa9f Bug 368507 - valgrind throws std::bad_alloc on memory allocations larger than 34255421416 bytes.
Increase the amount of usable memory from 64GB to 128GB on Linux and Solaris.
(Solaris bits from Ivo Raisr.)  OSX is so far unchanged.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16381
2017-05-16 06:20:26 +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
aa0dc56441 Reduce the number of compiler warnings on MIPS platforms.
Patch by: Tamara Vlahovic <tamara.vlahovic@imgtec.com>
Partially fixes BZ#370028.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16352
2017-05-10 12:52:40 +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
Carl Love
6c88349325 PPC64 ISA 3.0B, add support for the additional instructions: addex, mffscdrn,
mffscdrni, mffsce, mffscrn, mffscrni, mffsl. vmsumudm.

Additionally, the OV32 and CA32 bits were introduced in ISA 3.0 but
Valgrind add support for setting these bits for ISA 3.0.  The OV32 and CA32
bits must now be set on a number of pre ISA 3.0 instructions.  So now the
instructions produce different results in the XER register.  Thus we need pre
and post ISA 3.0 expect files.  Command line options were added to thee 
pre ISA test cases so instructions that didn't change could be run with one
set of command line args.  The instructions that have different XER results
are run using a different set of command line args.  The tests were split into
two, one for instructions that didn't change on for instructions that do 
change under ISA 3.0.  We then create ISA3.0 expect files only for the tests
that run differently.  By doing this we minimized the size of the expect files
needed.

Vex commit 3359  Has the source code changes for the instruction and OV32, CS32
support

This commit is all the test case changes, adding the new test case files.

Valgrind bugzilla 378931

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16329
2017-05-03 17:28:35 +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
Julian Seward
9d6e165ea7 Bug 369459 - valgrind on arm64 violates the ARMv8 spec (ldxr/stxr)
This implements a fallback LL/SC implementation as described in bug 344524.

Valgrind side changes:

* Command line plumbing for --sim-hints=fallback-llsc

* memcheck: handle new arm64 guest state in memcheck/mc_machine.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16309
2017-04-24 09:24:57 +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
Petar Jovanovic
ff3c67a396 mips: improve emulation of LL/SC
Follow up to VEX r3316.

Related issue KDE #344524.

Patch by Maran Pakkirisamy.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16269
2017-03-13 17:55:07 +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
Philippe Waroquiers
22fb38cb1c Samll changes on xtree leak event short names
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16214
2017-01-29 16:11:19 +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
Philippe Waroquiers
e696a029ca Similar to xtree memory, give a user msg with the xtree leak filename
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16208
2017-01-21 15:46:44 +00:00
Philippe Waroquiers
d9ca38cdc8 Fix --help for --xtree-leak-file
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16207
2017-01-21 13:22:06 +00:00
Philippe Waroquiers
5788cf1880 xtree leak.
As option --xtree-leak=yes is useless without a full leak report,
sets automatically full leak report if xtree leak report is requested.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16206
2017-01-21 12:20:33 +00:00
Philippe Waroquiers
c972a2b8b0 Allow memcheck to output the leak results as a callgrind xtree file.
* New command line options --xtree-leak=no|yes and --xtree-leak-file=<file>
  to produce the end of execution leak report in a xtree callgrind format
  file.

* New option 'xtleak' in the memcheck leak_check monitor command, to
  produce the leak report in an xtree file.

* File name template arguments (such as --log-file, --xtree-memory-file, ...)
  have a new %n format letter that is replaced by a sequence number.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16205
2017-01-21 11:00:39 +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
Philippe Waroquiers
488f1cc4dc Do not capture the free stacktrace in memcheck, unless we have
either to keep the free stacktrace and/or to compute full xtree memory.

Also, properly compute avg nr of IP per execontext: the avg must
be computed using the real nr of execontext stored, not the hash
table size.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16199
2017-01-11 22:13:52 +00:00
Ivo Raisr
61b7d61d7b Rename BBPTR to GSPTR as it denotes guest state pointer only
Fixes BZ#373555.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16189
2016-12-16 21:21:05 +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