10647 Commits

Author SHA1 Message Date
Philippe Waroquiers
9b67d18f11 Improve address description for address in the stack.
--read-var-info=yes is very memory and cpu intensive.
This patch ensures that even witout --read-var-info=yes that
the frame where the address point is reported in the address
description.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13991
2014-05-22 23:48:24 +00:00
Tom Hughes
104fc12674 Check for setcap executables, as we already do for setuid and
setgid ones, and refuse to run them in the same way. BZ#335143.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13990
2014-05-22 08:57:06 +00:00
Julian Seward
32adfb9026 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13989
2014-05-21 20:23:43 +00:00
Carl Love
2548eee443 Forgot to update NEWS file with bugzilla 335155 fix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13988
2014-05-21 19:33:57 +00:00
Carl Love
34318fb8f8 vgdb, fix error print statement.
This patch fixes printing the first not delivered signal.

Signed-off-by: Carl Love <carll@us.ibm.com>

This bug was reported in bugzilla 335155.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13987
2014-05-21 19:06:59 +00:00
Julian Seward
66a38e23e3 Add test cases for PCMPxSTRx cases 0x0E, 0x34, 0x14, and reformat some
of the associated switch statements.  Pertains to #326469, #327639,
#328878 respectively.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13986
2014-05-21 14:43:11 +00:00
Bart Van Assche
af88283a6d NEWS: Add #333072
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13985
2014-05-18 19:33:39 +00:00
Bart Van Assche
f879a52027 drd: Add semaphore annotations (#333072)
This is a slightly modified version of a patch from Ivo Raisr <ivosh@ivosh.net>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13984
2014-05-18 19:32:26 +00:00
Philippe Waroquiers
e4c6d8b5ab on ppc64, pthread_create_WRK is not (always) produced in the stacktrace
showing where a thread was created.
This makes many tests fail => use sed to delete pthread_create_WRK
from the stacktrace to let tests succeed on ppc64.
With this change, on ppc64 gcc110 (fedora 18), helgrind failures
goes from 28 tests failing to 4, with following reasons:
helgrind/tests/pth_cond_destroy_busy     (stderr)
    (6 errors instead of 3 in the summary line ???)
helgrind/tests/tc06_two_races_xml        (stderr)
    similar change needed in filter_xml to del pthread_create_WRK
helgrind/tests/tc18_semabuse             (stderr)
   -   with error code 22 (EINVAL: Invalid argument)
   +   with error code 38 (ENOSYS: Function not implemented)
helgrind/tests/tc20_verifywrap           (stderr)
   -   with error code 22 (EINVAL: Invalid argument)
   +   with error code 38 (ENOSYS: Function not implemented)


More details about the stacktrace not containing pthread_create_WRK:
--------------------------------------------------------------------
Here is the stacktrace obtained by GDB+vgdb:
(gdb) bt
#0  0x0000008074f7ac5c in .__clone () from /lib64/libc.so.6
#1  0x000000807517b1ec in do_clone (pd=0x4c6f200, attr=0x8075189c90 <default_attr>, stackaddr=<optimized out>, stopped=<optimized out>, 
    fct=@0x80751a01e0: 0x807517c500 <start_thread>, clone_flags=4001536) at ../nptl/sysdeps/pthread/createthread.c:74
#2  0x000000000403ed0c in pthread_create_WRK (thread=<error reading variable: value has been optimized out>, 
    attr=<error reading variable: value has been optimized out>, start=<error reading variable: value has been optimized out>, 
    arg=0xfff00ee18) at hg_intercepts.c:269
#3  0x000000000403ef1c in _vgw00000ZZ_libpthreadZdsoZd0_pthreadZucreateZAZa (thread=<optimized out>, attr=<optimized out>, 
    start=<optimized out>, arg=<optimized out>) at hg_intercepts.c:300
#4  0x000000003806f1d8 in ?? ()
#5  0x0000008074e9fb94 in generic_start_main (main=@0x100200d8: 0x100013a0 <main>, argc=<optimized out>, ubp_av=0xfff00f2d8, 
    auxvec=0xfff00f408, init=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>, fini=<optimized out>)
    at ../csu/libc-start.c:225
#6  0x0000008074e9fd90 in __libc_start_main (argc=<optimized out>, ubp_av=<optimized out>, ubp_ev=<optimized out>, 
    auxvec=<optimized out>, rtld_fini=<optimized out>, stinfo=<optimized out>, stack_on_entry=<optimized out>)
    at ../sysdeps/unix/sysv/linux/powerpc/libc-start.c:91
#7  0x0000000000000000 in ?? ()
(gdb) 


and here is the stacktrace produced by Valgrind unwinder:
Thread 1: status = VgTs_Runnable
==41687==    at 0x8074F7AC5C: clone (in /usr/lib64/libc-2.16.so)
==41687==    by 0x807517B1EB: do_clone.constprop.3 (createthread.c:74)
==41687==    by 0x403EF1B: pthread_create@* (hg_intercepts.c:300)
==41687==    by 0x10001597: main (tc19_shadowmem.c:172)
valgrind stack top usage: 15328 of 1048576


When the 2nd clone break is encountered (in the child thread), here is 
the GDB stacktraces:

Thread 2 (Thread 6028):
#0  0x0000008074f75fb0 in .madvise () from /lib64/libc.so.6
#1  0x000000807517c700 in start_thread (arg=0x4c6f200) at pthread_create.c:402
#2  0x0000008074f7acf0 in .__clone () from /lib64/libc.so.6

Thread 1 (Thread 41687):
#0  pthread_create_WRK (thread=0xfff00ee10, attr=0x0, start=@0x100200e8: 0x10001dd0 <steer>, arg=0xfff00ee18) at hg_intercepts.c:248
#1  0x000000000403ef1c in _vgw00000ZZ_libpthreadZdsoZd0_pthreadZucreateZAZa (thread=<optimized out>, attr=<optimized out>, 
    start=<optimized out>, arg=<optimized out>) at hg_intercepts.c:300
#2  0x000000003806f1d8 in ?? ()
#3  0x0000008074e9fb94 in generic_start_main (main=@0x100200d8: 0x100013a0 <main>, argc=<optimized out>, ubp_av=0xfff00f2d8, 
    auxvec=0xfff00f408, init=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>, fini=<optimized out>)
    at ../csu/libc-start.c:225
#4  0x0000008074e9fd90 in __libc_start_main (argc=<optimized out>, ubp_av=<optimized out>, ubp_ev=<optimized out>, 
    auxvec=<optimized out>, rtld_fini=<optimized out>, stinfo=<optimized out>, stack_on_entry=<optimized out>)
    at ../sysdeps/unix/sysv/linux/powerpc/libc-start.c:91
#5  0x0000000000000000 in ?? ()
(gdb) 


Here are the valgrind stacktraces:
Thread 1: status = VgTs_Runnable
==41687==    at 0x403EBE0: pthread_create_WRK (hg_intercepts.c:248)
==41687==    by 0x403EF1B: pthread_create@* (hg_intercepts.c:300)
==41687==    by 0x8074E9FB93: generic_start_main.isra.0 (libc-start.c:225)
==41687==    by 0x8074E9FD8F: (below main) (libc-start.c:91)
valgrind stack top usage: 15328 of 1048576

Thread 2: status = VgTs_WaitSys
==41687==    at 0x8074F75FB0: madvise (in /usr/lib64/libc-2.16.so)
==41687==    by 0x807517C6FF: start_thread (pthread_create.c:402)
valgrind stack top usage: 10320 of 1048576


And then after a few more next/breaks:
Thread 1: status = VgTs_Runnable
==41687==    at 0x8074F7AC5C: clone (in /usr/lib64/libc-2.16.so)
==41687==    by 0x807517B1EB: do_clone.constprop.3 (createthread.c:74)
==41687==    by 0x403EF1B: pthread_create@* (hg_intercepts.c:300)
==41687==    by 0x100015BB: main (tc19_shadowmem.c:173)
valgrind stack top usage: 15328 of 1048576

Thread 2: status = VgTs_WaitSys
==41687==    at 0x8074F75FB0: madvise (in /usr/lib64/libc-2.16.so)
==41687==    by 0x807517C6FF: start_thread (pthread_create.c:402)
valgrind stack top usage: 10320 of 1048576


So, pthread_create_WRK is not in the stacktrace anymore.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13983
2014-05-18 17:09:44 +00:00
Florian Krohm
6eb77b4746 Fix exp-bbv testcases such that they can be built out-of-tree.
Part of fixing #333628.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13982
2014-05-18 16:16:13 +00:00
Philippe Waroquiers
f0cbcd63c3 Enable vgdb ptrace invoker for aarch64.
This only works in non-bi arch mode. If ever aarch64+arm
are compiled bi-arch, then some more work is needed to have
a 64 bits vgdb able to ptrace invoke a 32 bits valgrind.

Note also that PTRACE_GETREGSET is defined on other platforms
(e.g. ppc64 fedora 18 defines it), but it is not used on
these platforms, as again, PTRACE_GETREGSET implies some
work for bi-arch to work properly.
So, on all platforms except arm64, we use PTRACE_GETREGS
or PTRACE_PEEKUSER.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13981
2014-05-17 13:50:02 +00:00
Bart Van Assche
7c67e90c47 drd/tests/atomic_var: Revert r13876.
r13876 was a workaround for false ordering introduced by platform-specific
(Solaris) code. The conclusion of an off-list discussion was that this has
to be solved in the drd tool itself and not by modifying test programs. Hence
this revert.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13980
2014-05-17 10:44:00 +00:00
Philippe Waroquiers
ab71852280 Fix 334788 clarify doc about --log-file initial program directory
Behaviour is kept unchanged, a paragraph is added in the doc to
clarify.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13979
2014-05-17 05:50:46 +00:00
Mark Wielaard
a1513e0348 Revert "Tools should explain why an option is bad when using fmsg_bad_option."
This reverts valgrind svn r13975. This was a work in progress, still being
discussed in bug #334802. It should not yet been pushed.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13978
2014-05-16 22:38:46 +00:00
Philippe Waroquiers
e984a5b888 On old kernel, poll syscall being ptraced (vgdb+ptrace) is not necessarily
properly restarted. Instead, it can fail with EINTR, even if no signal was
effectively received.

Handle such case by retrying the poll syscall when the poll syscall
is failing due to EINTR



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13977
2014-05-16 22:37:57 +00:00
Mark Wielaard
f826a8f60c Revert configure support for adding -Werror=format-security.
This reverts part of valgrind svn r13962. There was a typo in the configure
check that caused failures when -Werror=format-security wasn't supported
and the flag interfered badly with -Wno-format-zero-length. So remove
for now and only add back when properly tested on various (older) setups.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13976
2014-05-16 22:28:48 +00:00
Mark Wielaard
1418e68e22 Tools should explain why an option is bad when using fmsg_bad_option.
Add an explanation of why an option was bad to fmsg_bad_option calls that
were just using "" as argument. Fixes bug #334802.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13975
2014-05-16 22:28:42 +00:00
Julian Seward
e5d979564f arm64-linux: enable sys_sched_setaffinity, sys_linkat.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13974
2014-05-16 15:02:09 +00:00
Julian Seward
b0e2fd66e4 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13973
2014-05-16 12:22:50 +00:00
Julian Seward
8b72a31ca9 Enable: sys_add_key, sys_keyctl, apparently needed by glibc-2.19.90 on
arm64-linux.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13972
2014-05-15 16:47:56 +00:00
Julian Seward
d406e8725c Make the PLAT_ identification work properly for mingw-win64. Problem was
that mingw64 also defines __MINGW32__, which led to the 32-bit definitions
being used in the 64-bit case.  n-i-bz.  (Bernhard.Loos@ruecker.de)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13971
2014-05-15 13:50:47 +00:00
Julian Seward
5bd3d910c3 Add more test cases: trn1, trn2, uzp1, uzp2, zip1, zip2, urecpe, ursqrte.
This completes the test cases for the SIMD integer instructions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13970
2014-05-15 12:18:17 +00:00
Julian Seward
099e255374 Add more test cases: sqrshrn, uqrshrn, sqshrn, uqshrn, sqrshrun,
sqshrun, sqshl, uqshl, sqshlu, sqxtn, uqxtn, sqxtun, srhadd, urhadd,
sshl, ushl, shl, sshr, ushr, ssra, usra, srshl, urshl, srshr, urshr,
srsra, ursra, suqadd, usqadd.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13969
2014-05-15 11:55:56 +00:00
Julian Seward
1866af3dac Add more test cases: sqdmulh, sqrdmulh, sqshl, uqshl, sqrshl, uqrshl,
sqrshrn, uqrshrn, sqshrn, uqshrn, sqrshrun, sqshrun.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13968
2014-05-15 08:22:34 +00:00
Julian Seward
02f1067f35 Add tests for VFPv4 VFMA/VMFS. Pertains to #331057.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13967
2014-05-15 00:12:36 +00:00
Philippe Waroquiers
1fbb08a5af minor comment reformatting
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13966
2014-05-14 21:53:48 +00:00
Philippe Waroquiers
183b978d08 Factorises the address code description and printing
of memcheck and helgrind in a common module:
  pub_tool_addrinfo.h pub_core_addrinfo.h m_addrinfo.c

At the same time, the factorised code is made usable by other
tools also (and is used by the gdbserver command 'v.info location'
which replaces the helgrind 'describe addr' introduced 1 week ago
and which is now callable by all tools).

The new address description code can describe more addresses
(e.g. for memcheck, if the block is not on the free list anymore,
but is in an arena free list, this will also be described).

Similarly, helgrind address description can now describe more addresses
when --read-var-info=no is given (e.g. global symbols are
described, or addresses on the stack are described as
being on the stack, freed blocks in the arena free list are
described, ...).
See e.g. the change in helgrind/tests/annotate_rwlock.stderr.exp
or locked_vs_unlocked2.stderr.exp

The patch touches many files, but is basically a lot of improvements
in helgrind output files.
The code changes are mostly refactorisation of existing code.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13965
2014-05-14 20:39:27 +00:00
Julian Seward
cdce5974bf Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13964
2014-05-14 13:29:04 +00:00
Mark Wielaard
85011418d1 Use safe_to_deref in coregrind syswrap-generic.c (msghdr_foreachfield).
Call ML_(safe_to_deref) before using msghdr msg_name, msg_iov or msg_control.
Fixes bug #334705.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13963
2014-05-14 11:35:54 +00:00
Mark Wielaard
5f385bb6e3 Support -Wformat -Werror=format-security.
Check if gcc supports -Wformat -Werror=format-security and use it if so.
Fix m_gdbserver/remote-utils.c sr_perror call. Fixes Bug #334727.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13962
2014-05-14 10:50:14 +00:00
Mark Wielaard
1c16e7fb7f Add send_signal to gdbserver_tests/Makefile.am (dist_noinst_SCRIPTS).
If the send_signal script is missing the nlvgdbsigqueue test would hang.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13961
2014-05-13 20:42:04 +00:00
Julian Seward
c388df8977 Followup to r13958: add reg-trash lists to inline assembly in
TESTINSTPCMISALIGNED TESTINSTPCMISALIGNED_DWORDOUT
TESTINSTPCMISALIGNED_2OUT and nice up the the indentation a bit.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13960
2014-05-13 16:15:56 +00:00
Julian Seward
61a0ca0857 Thumb encoding: add test case for assertion failure caused by
"ldr.w pc, [reg, #imm]".  See #333428.  (dimitry@google.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13959
2014-05-13 15:55:00 +00:00
Julian Seward
f6d56584b4 Thumb encoding: add test cases for misaligned loads of the form
LD Rt, [Rn +/- #imm12]  when Rn == PC
See #333145.  (dimitry@google.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13958
2014-05-13 14:45:54 +00:00
Julian Seward
83f1843c61 On 32-bit x86, allow lzcnt to be detected on Intel CPUs as well as on
AMDs.  64-bit equivalent does not have this bug.  Fixes #334049.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13957
2014-05-13 14:10:44 +00:00
Julian Seward
b6ac3b9da4 Add more test cases: shll, shrn, rshrn, sli, sri, smaxp, umaxp, sminp,
uminp, smlal, umlal, smlsl, umlsl, smull, umull, sqabs, sqneg, sqadd,
uqadd, sqsub, uqsub, sqdmlal, sqdmlsl, sqdmull, sqrdmulh.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13956
2014-05-13 09:34:54 +00:00
Julian Seward
a9be523b3f Minor updates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13955
2014-05-13 09:29:33 +00:00
Julian Seward
c4d3b61787 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13954
2014-05-13 09:28:19 +00:00
Philippe Waroquiers
73c15271b9 In case gdbsrv poll syscall fails, produces more information
gdbsrv poll syscall seems to very infrequently (1 on 100000 vgdb invocations§)
to be EINTR-upted.
So, when poll syscall fails, output stacktrace + sigmask status
to capture more info about the problem.
This is a follow-up/extension of r13748, which showed poll was interrupted
but it is not clear why. In particular, all async signals are supposed
to be masked at the time vgdb has forced an invocation



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13953
2014-05-12 20:29:17 +00:00
Julian Seward
7e1d3cd3c2 Update __VALGRIND_MINOR__ before it gets forgotten again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13952
2014-05-12 10:12:08 +00:00
Julian Seward
2c2bee19b1 3_9_BUGSTATUS.txt: looked at all bugs in the file. Moved fixed ones
to NEWS (if not already there).  Put the rest of them into a set of
categories depending on which part of the code base is affected, which
divides them up into -- IMO -- much more managable groups.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13951
2014-05-09 16:13:21 +00:00
Mark Wielaard
895f25f4a2 Add uninstall-local rules to make distcheck happy.
Also remove generated FAQ.txt in docs distclean-local rule.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13950
2014-05-09 14:25:39 +00:00
Mark Wielaard
fbd9fe855d Out of tree build. Partial fix for Bug 333628.
Patch by Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
Partial fix. make && make check now works with builddir != srcdir.
But make regtest doesn't yet.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13949
2014-05-09 13:34:13 +00:00
Mark Wielaard
a07285e393 Add test for MPX instructions and bnd prefix. Bug #333666.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13948
2014-05-09 11:41:46 +00:00
Julian Seward
9760f54be8 Update bug list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13947
2014-05-09 11:24:50 +00:00
Julian Seward
75219a52db Add more test cases: mul, mvni, not, pmul, pmull, rbit, rev16/32/64,
saba, uaba, sabal, uabal, sabd, uabd, sabdl, uabdl, sadalp, uadalp,
saddl, uaddl, ssubl, usubl, saddlp, uaddlp, saddlv, uaddlv, saddw,
uaddw, ssubw, usubw, shadd, uhadd, shsub, uhsub.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13946
2014-05-09 09:36:56 +00:00
Julian Seward
4862771a72 Add more test cases: ext, ins, mla, mls, movi.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13945
2014-05-08 22:19:16 +00:00
Philippe Waroquiers
7094d0ebd7 Keep the reading side of the FIFO opened after a vgdb disconnect
Otherwise, if the valgrind process has just forked before
the vgdb connect, and the child has not yet closed the FIFO it inheritates
from its parent, and a 2nd vgdb is started before the parent has
re-opened the reading side FIFO, the 2nd vgdb can connect to the child,
which will not handle the wakeup character/connection request, and
vgdb will have a write error and/or block.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13944
2014-05-08 20:42:08 +00:00
Julian Seward
c513ea3cd8 When constructing a signal frame, tell the tool that the registers
that carry the arguments (signo, siginfo, mcontext) for the handler,
have been written.  In particular this makes Memcheck think
(correctly) they are defined and so removes a bunch of false positives
that can happen in the signal handler, should the registers have been
marked undefined before the signal.

The same fix needs to be applied to various other of these
sigframe-*.c files.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13943
2014-05-08 15:14:48 +00:00
Philippe Waroquiers
4aea515f54 * document the %ps / %pS extensions to printf
* remove (from memcheck) emiN, as PRINTF_CHECK can be done properly


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13942
2014-05-07 22:03:59 +00:00