5340 Commits

Author SHA1 Message Date
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
Julian Seward
9e280aa166 Bug 377717 - Fix massive space leak when reading compressed debuginfo sections.
This makes reading of compressed debuginfo usable for very large object files.
It also adds a bunch extra documentation about a tricky invariant in the
compressed debuginfo handling (a recursive cache refill path!) and adds a
whole bunch of assertions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16279
2017-03-20 21:34:02 +00:00
Philippe Waroquiers
c54854475c And some more follow up for 376956 syswrap of SNDDRV and DRM_IOCTL_VERSION
causing some addresses to be wrongly marked as addressable

Just in case, do the assert after ARG2 has been truncated to 32 bits,
to avoid comparing sign extended requests on 64 bits.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16278
2017-03-17 18:45:23 +00:00
Philippe Waroquiers
eb0d79c25a Follow up to fix 376956 syswrap of SNDDRV and DRM_IOCTL_VERSION causing some
addresses to be wrongly marked as addressable

As noted by Ivo, if the syscall fails, then we have a leak.

So, enable the flag SfPostOnFail if we allocate memory.
In the POST ioctl, check that FAILURE only happens for this drm ioctl,
and free the memory for both SUCCESS and FAILURE.
Do the POST_MEM_WRITE only if SUCCESS
        


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16277
2017-03-17 18:38:42 +00:00
Petar Jovanovic
1a9da5927f Fix broken build on non-Linux systems
After r16273, non-Linux Valgrind builds report:

 m_signals.c:1732:36: 
 error: 'VKI_PT_PTRACED' undeclared (first use in this function)

Fix the issue with #if defined(VGO_linux) for the reported code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16275
2017-03-16 13:10:16 +00:00
Philippe Waroquiers
a6a72c71be Fix 376956 syswrap of SNDDRV and DRM_IOCTL_VERSION causing some addresses
to be wrongly marked as addressable

Patch from Daniel Glöckner, slightly modified.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16274
2017-03-15 19:35:29 +00:00
Petar Jovanovic
30717ab5a2 Add support for syscall ptrace(traceme)
It fixes Bug 377376.

Patch by Aleksandra Karadzic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16273
2017-03-15 15:23:27 +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
Philippe Waroquiers
5bc11df85c Add missing break for the DRM ioctl operations that do not have any args
Due to this missing break, the code was falling through to
the case VKI_SNDRV_CTL_IOCTL_PVERSION:
and was then setting some bytes as defined at (whatever address is in) ARG3.

Patch and analysis by Daniel Glöckner 



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16266
2017-03-11 21:07:21 +00:00
Petar Jovanovic
1e7427106a mips: do not unmap vDSO
vDSO cannot be unmaped for mips architecture because there is no
support for custom signal restorer since kernel 2.5.

It should fix KDE Bug #376142.

Patch by Tamara Vlahovic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16261
2017-03-08 16:30:19 +00:00
Mark Wielaard
add127dbf9 Fix two safe_to_deref/sizeof mismatches in sys_sigaction/sys_rt_sigaction.
Before dereferencing the sigaction pointer and reading the fields we
need to make sure the whole struct is safe_to_deref. We were using the
size of the pointer, but needed the size of the struct.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16258
2017-03-02 11:14:36 +00:00
Carl Love
41308849ef Patch submitted by Will Schmidt for PPC64.
On ppc64*, the TOC ptr should not be considered a scratch
register, and should not be in the clobber list.
This is called out in newer GCC (i.e. gcc7) and triggers an error.

Thusly, remove R2 from the clobber list.

Signed-Off-By: Will Schmidt <will_schmidt@vnet.ibm.com>

Tested and committed by: Carl Love <cel@us.ibm.com>

Bugzilla is 376729.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16254
2017-02-20 19:04:13 +00:00
Ivo Raisr
39dcf62ccd Fix sr_EQ() comparison on Solaris syscall failure
On rare occasions, garbage is found in sr1._val2
while sr2._val2 contains 0.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16252
2017-02-20 08:07:21 +00:00
Mark Wielaard
42ff65da99 Remove arm64 specific (unused) setup_child () and assign_guest_tls ().
valgrind svn r16186 (which fixed bug #342040 and #373192) introduced a
generic linux way of handling setup_child and assign_guest_tls. So there
is no need anymore for arch specific implementations. And gcc complained
they were unused.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16249
2017-02-18 21:16:05 +00:00
Mark Wielaard
fb6b3d98c2 aarch64: mark not implemented syscalls as such
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16248
2017-02-18 21:16:04 +00:00
Mark Wielaard
90147d8c7f aarch64: enable sethostname syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16247
2017-02-18 21:16:04 +00:00
Mark Wielaard
ddc6432205 aarch64: enable getcpu syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16246
2017-02-18 21:16:03 +00:00
Mark Wielaard
c33888cd76 aarch64: enable kcmp syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16245
2017-02-18 21:16:02 +00:00
Mark Wielaard
83530aa5cb aarch64: enable clock_adjtime syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16244
2017-02-18 21:16:01 +00:00
Mark Wielaard
cb5c2db67d aarch64: enable fanotify_mark syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16243
2017-02-18 21:16:00 +00:00
Mark Wielaard
a0c40043fd aarch64: enable fanotify_init syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16242
2017-02-18 21:16:00 +00:00
Mark Wielaard
cbc35e55e3 aarch64: enable rt_tgsigqueueinfo syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16241
2017-02-18 21:15:59 +00:00
Mark Wielaard
2bb11a32ac aarch64: enable move_pages syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16240
2017-02-18 21:15:58 +00:00
Mark Wielaard
67c85b2cc8 aarch64: enable request_key syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16239
2017-02-18 21:15:57 +00:00
Mark Wielaard
c4ce4f8099 aarch64: enable tkill syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16238
2017-02-18 21:15:56 +00:00
Mark Wielaard
b49d8c0666 aarch64: enable sched_rr_get_interval syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16237
2017-02-18 21:15:55 +00:00
Mark Wielaard
3729c265d0 aarch64: enable delete_module syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16236
2017-02-18 21:15:54 +00:00
Mark Wielaard
2d6a711e16 aarch64: enable get_robust_list syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16235
2017-02-18 21:15:53 +00:00
Mark Wielaard
ce78c07359 aarch64: enable unshare syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16234
2017-02-18 21:15:53 +00:00
Mark Wielaard
c97d53db3a aarch64: enable sync_file_range syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16233
2017-02-18 21:15:52 +00:00
Mark Wielaard
1dbcb195da aarch64: enable pivot_root syscall (generic wrapper)
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16232
2017-02-18 21:15:51 +00:00
Mark Wielaard
dc1e28e958 aarch64: remove bogus syscall part
Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16231
2017-02-18 21:15:50 +00:00
Mark Wielaard
58b58f73e4 aarch64: add missing syscalls into table
All entries are added disabled - enabling them will be done later.

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16230
2017-02-18 21:15:49 +00:00
Mark Wielaard
83a0887f9a fix order of timer_* syscalls on aarch64 - bug #371225
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16229
2017-02-18 21:15:48 +00:00
Mark Wielaard
8a63a637d8 Bug 376611 - ppc64 and arm64 don't know about prlimit64 syscall.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16228
2017-02-18 13:20:16 +00:00
Ivo Raisr
804686fc2c Solaris: Add syscall wrapper for fast trap getlgrp(6)
Fixes BZ#376518.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16227
2017-02-16 18:29:46 +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
Julian Seward
49a83a0cac am_munmap_both_wrk: safely initialise out-param for all return paths.
Silences what I think is a false complaint from gcc at -O3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16221
2017-02-08 08:27:34 +00:00
Ivo Raisr
b8854a1c50 Fix +1 error in get_elf_symbol_info() when computing value of 'hi' address for ML_(find_rx_mapping)()
Fixes BZ#375772


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16216
2017-01-31 12:33:54 +00:00
Petar Jovanovic
1f203e73de mips: implement calculation for static TLS
Extend valgrind_get_tls_addr() with static TLS calculation for MIPS.

Related issue #375514.

Patch by Aleksandar Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16215
2017-01-30 19:33:47 +00:00
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
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
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
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
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