Commit Graph

12577 Commits

Author SHA1 Message Date
Petar Jovanovic
fa4577c0d5 mips: fix target_get_drv() function
Return correct Dtv location. Top of MIPS tcbhead structure is located
0x7000 bytes before the value of ULR. Dtv is the first of two pointers
in the tcbhead structure.

This fixes gdbserver_tests/hgtls on some MIPS platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16212
2017-01-27 17:55:13 +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
Ivo Raisr
5216c18012 Document limitation of --log-file when a program forks.
Follow up to r16200 and BZ#162848.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16210
2017-01-25 07:22:18 +00:00
Philippe Waroquiers
ce71fb2d50 xtree: use "UnknownFile???" and "UnknownFn???" instead of "???"
and "file ???"


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16209
2017-01-21 19:24:33 +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
f9e2cc163f x86-linux: Initialize x86 system GDT on first use. Bug 344139 comment 3.
Patch from Sebastian Lackner, sebastian@fds-team.de.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16204
2017-01-20 09:58:15 +00:00
Julian Seward
34b98bc823 Connect the v8 FP and SIMD tests to the build system.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16203
2017-01-19 06:53:13 +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
Petar Jovanovic
91a7579ee6 mips64: update exp file for test_math
Leave the old exp file that covers cases in which __addtf3 and __subtf3
did not take into account rounding modes. New exp file is the same file
that already exists in mips32 folder, so we just create a symbolic link
to it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16201
2017-01-13 16:29:15 +00:00
Ivo Raisr
db21c24191 Fix a bug when --log-file output isn't split when a program forks.
Patch loosely based on idea by Timur Iskhodzhanov <timurrrr@google.com>.
Fixes BZ#162848


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16200
2017-01-12 11:28:20 +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
Julian Seward
cf5a42f9ab Make this compile for both ARM and Thumb encodings,
and make it produce identical results for both encodings.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16198
2017-01-11 21:49:40 +00:00
Ivo Raisr
5670630242 Fix comments in m_trampoline.S for amd64/Solaris redirs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16197
2017-01-11 21:17:42 +00:00
Josef Weidendorfer
db860c7cdc Add a format marker to callgrind files
KCachegrind currently uses a quick format detection before
actually loading a file, and checks for a line starting with
"events:" in the first 2kB for that. This obviously is fragile,
as shown by an internal bug report by Philippe: before the
"events" line, Callgrind puts a "cmd:" line with the command
line. If this is very long, the detection fails and the file
does not get loaded at all.

While KCachegrind would not need to have this quick format
check at all, it is useful if multiple input format filters
get supported at some point, to automatically select the
correct filter.

Further, for the "file" command, for file managers and
desktop environments, having an unique way to detect a
file format is important.

It is not too late to fix this issue for the callgrind format.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16196
2017-01-10 20:21:21 +00:00
Philippe Waroquiers
d62083795c xtree: CALLED_FLF must be called only up to ips[0] + minor doc update
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16195
2017-01-10 18:07:07 +00:00
Julian Seward
2a218b7efc Add test cases for 32-bit v8 FP and SIMD insns.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16194
2017-01-10 16:09:53 +00:00
Philippe Waroquiers
f898cb0e21 xtree: minor updates to documentation, comments and indentation, no functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16193
2017-01-06 18:38:27 +00:00
Ivo Raisr
c77f2b7be3 Add Solaris specific notes on running regression tests
Reported by: Paul Floyd <paulf@free.fr>
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16192
2017-01-03 22:03:43 +00:00
Ivo Raisr
da6f9fc39b Update NEWS for recent VEX commit r3288.
Fixes BZ#373938.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16191
2016-12-23 12:40:33 +00:00
Petar Jovanovic
9738ccb30b mips: fix "cast-equal" warnings in coredump-elf.c
Remove the following warnings from the build:
m_coredump/coredump-elf.c:521:31: warning: cast discards 'const'
qualifier from pointer target type [-Wcast-qual]

Related BZ#370028

Patch by Aleksandar Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16190
2016-12-21 17:45:28 +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
Petar Jovanovic
98d36af988 mips: remove some old cruft from clone functions
Follow up to r16186 when this cruft was noticed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16188
2016-12-16 18:31:57 +00:00
Philippe Waroquiers
984cc6d07c Add missing EXTRA_DIST clonev.stdout.exp
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16187
2016-12-11 22:18:07 +00:00
Philippe Waroquiers
489cfd5156 Fix 342040 Valgrind mishandles clone with CLONE_VFORK | CLONE_VM that clones to a different stack
Fix 373192 Calling posix_spawn in glibc 2.24 completely broken

Functionally, this patch just does the following 2 changes to the
fork clone handling:
* It does not mask anymore CLONE_VFORK :
  The only effect of this flag is to suspend the parent, waiting for
  the child to either exit or execve.
  If some applications depends on this synchronisation, better keep it,
  as it will not harm to suspend the parent valgrind waiting for the
  child valgrind to exit or execve.
* In case the guest calls the clone syscall providing a non zero client stack,
  set the child guest SP after the syscall, before executing guest instructions.
  Not setting the guest stack ptr was the source of the problem reported
  in the bugs.

This also adds a test case  none/tests/linux/clonev.
Before this patch, test gives a SEGV, which is fixed by the patch.

The patch is however a lot bigger : this fix was touching some (mostly
identical/duplicated) code in all the linux platforms.
So, the clone/fork code has been factorised as much as possible.
This removes about 1700 lines of code.

This has been tested on:
* amd64
* x86
* ppc64 be and le
* ppc32
* arm64

This has been compiled on but *not really tested* on:
* mips64 (not too clear how to properly build and run valgrind on gcc22)

It has *not* been compiled and *not* tested on:
* arm
* mips32
* tilegx
* darwin   (normally, no impact)
* solaris  (normally, no impact)

The changes are relatively mechanical, so it is not impossible that
it will compile and work out of the box on these platforms.
Otherwise, questions welcome.

A few points of interest:
* Some platforms did have a typedef void vki_modify_ldt_t,
  and some platforms had no definition for this type at all.
  To make it easier to factorise, for such platforms, the following has
  been used:
     typedef char vki_modify_ldt_t;
    When the sizeof vki_modify_ldt_t is > 1, then the arg syscall is checked.
  This is somewhat a hack, but was simplifying the factorisation.

* for mips32/mips64 and tilegx, there is a strange unconditional assignment
  of 0 to a register (guest_r2 on mips, guest_r0 on tilegx).
  Unclear what this is, in particular because this is assigned whatever
  the result of the syscall (success or not).
  



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16186
2016-12-11 21:39:23 +00:00
Rhys Kidd
db0a061667 Add placeholders for all new OS X 10.11 syscalls. Related to bz#348909.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16185
2016-12-11 08:07:21 +00:00
Rhys Kidd
766afc937e Add placeholders for all new macOS 10.12 syscalls. Related to bz#365327.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16184
2016-12-11 07:17:43 +00:00
Petar Jovanovic
d047f65f4e mips64: add cvm_atomic.stdout.exp-BE
Add BE variant of exp file for cvm_atomic test.
This fixes none/tests/mips64/cvm_atomic for Cavium MIPS64 BE systems.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16183
2016-12-10 00:29:58 +00:00
Petar Jovanovic
5e3a397049 mips32: minor style change to r16181
Divide one line into two lines that fit "80 columns" rule.
Non-functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16182
2016-12-09 18:51:58 +00:00
Petar Jovanovic
1287ae8616 mips32: allow execution of round_fpu64 test for fpxx
Allow execution of none/tests/mips32/round_fpu64 test if it is built with
-mfpxx. It gets us more coverage eventually.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16181
2016-12-09 18:35:37 +00:00
Petar Jovanovic
99cd942e35 mips: fix VG_(gdbserver_report_signal) arguments
When definition of VG_(gdbserver_report_signal) was changed in r15248,
the function VG_(synth_sigfpe) was omitted from the update.

This change fixes:

gdbserver_tests/mcsignopass              (stderr)
gdbserver_tests/mcsignopass              (stdoutB)
gdbserver_tests/mcsigpass                (stderr)
gdbserver_tests/mcsigpass                (stdoutB)

on MIPS platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16180
2016-12-08 14:52:02 +00:00
Petar Jovanovic
43de83c736 Update memcheck/tests/amd64-linux ignore list
Add access_below_sp file to the ignore list.
Non-functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16179
2016-12-06 14:07:30 +00:00
Petar Jovanovic
89c5eb92a1 mips: add fadvise64 to svn ignore list
More housekeeping after r16175.
Add fadvise64 executable to the ignore list.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16178
2016-12-06 13:47:33 +00:00
Mark Wielaard
d8a311f659 Adjust line number in mcblocklistsearch.stderrB.exp.
valgrind svn r16173 "Add CLEAR_CALLER_SAVED_REGS in leak-tree test"
added one extra line to memcheck/tests/leak-tree.c which is used in
gdbserver_tests/mcblocklistsearch.vgtest. Adjust the line numbers in
the exp file to match.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16177
2016-12-06 09:50:47 +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
6c8edf155a Remove second definition of typedef ‘Time’
Remove redefinition of typedef ‘Time’ already defined in pub_tool_xtree.h

This fixes warning/error:

ms_main.c:633:14: warning: redefinition of typedef ‘Time’ [-Wpedantic]
 typedef Long Time;



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16174
2016-12-05 16:54:06 +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
Rhys Kidd
1a30c53075 Update SVN ignore propset for tests/libc_test. n-i-bz. Refer r16097.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16171
2016-12-04 04:06:25 +00:00
Rhys Kidd
a0c4cd6b74 Update SVN ignore propset for include/vgversion.h. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16170
2016-12-04 04:00:11 +00:00
Rhys Kidd
f3bc22d097 Fix typo in syswrap-darwin log output. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16169
2016-12-04 03:50:33 +00:00
Rhys Kidd
386749fe29 Fix 373046 - Stacks registered by core are never deregistered (macOS-specific follow-up). Refer r16159.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16168
2016-12-04 03:43:29 +00:00
Philippe Waroquiers
53032ebb48 Small optimisation: no need to have a syscall wrapper unless collect systime is yes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16167
2016-12-03 17:09:20 +00:00
Petar Jovanovic
7746f34db7 mips: fix call_on_new_stack_0_1 code
MIPS32 implementation missed to set up a correct (zero) return address.
This led to incorrect execution of get_StackTrace_wrk as it was not
able to unwind stack correctly.
This change fixes memcheck/tests/leak-autofreepool-5.

MIPS64 implementation missed clearing all integer registers before
entering the function.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16166
2016-12-01 16:01:45 +00:00
Philippe Waroquiers
f6699cd906 Update NEWS for the fixing of 358213 helgrind/drd bar_bad testcase hangs or
crashes with new glibc pthread barrier implementation

(this was fixed in revision 16154)
        


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16165
2016-11-29 22:54:05 +00:00
Philippe Waroquiers
11671ae1d3 352395 - Please provide SVN revision info in --version -v
Finally committed ... :)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16164
2016-11-29 22:32:27 +00:00
Petar Jovanovic
dee49c2144 mips64: fix fadvise64 syscall wrappers
Use platform specific pre-wrapper for fadvise64 system call and respect
size of parameters, instead of using generic wrapper written for 32bit
architectures.

Issue reported by Marcin Juszkiewicz.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16163
2016-11-29 14:57:51 +00:00