992 Commits

Author SHA1 Message Date
Tom Hughes
88e1a7587c Include the platform name in the unhandled system call message
We often get bug reports for an unhandled system call which don't
make it clear what platform is in use, which makes it impossible
to know which system call it is.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15033
2015-03-22 11:01:58 +00:00
Rhys Kidd
4669a61228 Fix memcheck/tests/strchr on OS X
bz#345394
- Support the required index and _platform_strchr alias

Before:

== 589 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 589 tests, 238 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15030
2015-03-21 14:25:02 +00:00
Florian Krohm
8a9117b3d7 Increase the size of the alternate stack. It was too small.
This was found by accident and there is no known way to detect
an overflow of an alternate stack in the general case.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15018
2015-03-16 22:03:42 +00:00
Philippe Waroquiers
83fefa7f05 Fix the following errors detected by makefile check
memcheck/tests/Makefile.am:1: error: wrap8.stderr.exp-ppc64 is missing in EXTRA_DIST
memcheck/tests/Makefile.am:1: error: wrap8.stdout.exp-ppc64 is missing in EXTRA_DIST
memcheck/tests/Makefile.am:1: error: wrap8.stdout.exp2 is in EXTRA_DIST but doesn't exist
memcheck/tests/Makefile.am:1: error: wrap8.stderr.exp2 is in EXTRA_DIST but doesn't exist



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15015
2015-03-15 12:22:43 +00:00
Florian Krohm
d2b07b7178 Organise the expected output files for the wrap8 testcase.
There is special behaviout on ppc64 only. Let the filenames
reflect that. At the same time update the ppc specific
output to what it is. The important thing here is that the
stack overflow is detected. Everything else is effectively a
don't care. Should line numbers and such differ in the future
that should be filtered out.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15012
2015-03-14 10:15:23 +00:00
Florian Krohm
74cbfc6f04 Update the ppc64 specific results to what they are.
The difference of the expected results as compared to other
platforms is

- Location 0x........ is 2 bytes inside local var "budget"
- declared at varinfo6.c:3115, in frame #2 of thread 1
+ Address 0x........ is on thread 1's stack
+ in frame #2, created by BZ2_blockSort (varinfo6.c:3107)

Should the stderr output of this testcase in the future 
match the generic output (varinfo6.stderr.exp) then this is
another incarnation of 
https://bugs.kde.org/show_bug.cgi?id=345121


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15011
2015-03-14 09:44:04 +00:00
Florian Krohm
ac9506ad26 Disable testcase because the ptrace system call is not
supported on ppc64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15010
2015-03-14 09:30:36 +00:00
Philippe Waroquiers
826502e89a Implement command line option --valgrind-stacksize=<number>
This allows to decrease memory usage when using many threads,
if no big stacksize is needed by Valgrind.
If needed (e.g. for demangling big c++ symbols), the V stacksize
can be increased.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15004
2015-03-12 20:43:46 +00:00
Florian Krohm
6dce653240 Add support for building with -fsanitize=undefined.
- add configure option --enable-ubsan 
- add __ubsan helpers (by Julian)

This requires gcc 4.9.2 or later. Not all platforms are supported, though.
With this change and VEX r3099 regression tests pass on amd64
with a valgrind compiled with -fsanitize=undefined.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14995
2015-03-10 16:13:59 +00:00
Rhys Kidd
a6edce5f4a Fix unhandled syscall: unix:348 (__pthread_chdir) and unhandled syscall: unix:349 (__pthread_fchdir) on OS X
bz#344512
- Support these two undocumented syscalls.
- New regression test case added.

Before:

== 588 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 589 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14987
2015-03-07 08:36:20 +00:00
Rhys Kidd
cfa6844024 Tweak test case for bz#344560 from r14985, now includes line numbers
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14986
2015-03-07 06:11:08 +00:00
Rhys Kidd
2424a2d347 Fix stack traces missing penultimate frame
bz#344560
- Also fixes memcheck/tests/badpoll test on OS X
- Problem occurs because the guest stack seen in a system call pre or post
  function happens to not have a correct topmost stack frame, as Darwin system
  call stubs do not start with the usual function prolog.
- New regression test case added.
- Thanks to Greg Banks for research, patch and test case.

Before:

== 587 tests, 240 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 588 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14985
2015-03-07 05:22:12 +00:00
Rhys Kidd
c31c62f916 Fix memcheck/tests/err_disable4 test on OS X
bz#344621
- Unnamed semaphores are not supported on OS X, must use named semaphores.
- To use named semaphores sem_open() instead of sem_init() utilised.
- Test case updated accordingly across all platforms.

Before:

== 586 tests, 240 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 586 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14968
2015-02-27 11:34:07 +00:00
Florian Krohm
f029054493 Update opcode list following VEX r3092.
Add an assertion to trigger a compile time error in case this
happens again.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14961
2015-02-24 17:17:19 +00:00
Florian Krohm
75e739efc0 Revert accidental checkin for Makefile.am
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14914
2015-02-06 20:33:51 +00:00
Florian Krohm
c29515885b Fix undefined behaviours when shifting.
Found by libubsan.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14913
2015-02-06 20:32:15 +00:00
Christian Borntraeger
c95c10bea0 valgrind part to VEX:3083 Fix bugzilla 343802, also extend testcase
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14905
2015-02-05 11:05:53 +00:00
Florian Krohm
fe89cb4e4d Fix Makefile.am so it works for builds configured with
--enable-only32bit.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14849
2015-01-04 22:55:45 +00:00
Philippe Waroquiers
d1b502efef Fix 341539 VG_(describe_addr) should not describe address as belonging to client
segment if it is past the heap end

Describes specifically an address that is in the brk data segment
or in the 'reduced' (after brk reduction) section of the brk data segment.

Based on a patch from Ivo Raisr.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14833
2014-12-28 17:30:22 +00:00
Florian Krohm
569012f885 Avoid compiler warnings on s390x.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14817
2014-12-17 11:35:10 +00:00
Philippe Waroquiers
fa26e45f97 reach_thread_register cannot be compiled on Mac OS as Mac OS
had no pthread barrier.
(the Makefile.am protects this with a if HAVE_PTHREAD_BARRIER)
But the test should then be protected with a prereq that the
executable exists.
(analysis and fix suggestion by rhyskidd, part of fixing 341613)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14807
2014-12-13 16:36:12 +00:00
Florian Krohm
f38d96dd61 Add -Wformat -Wformat-security to the list of compile flags.
This was not as straight forward as expected. Specifically, adding the
new flag to CFLAGS in configure.ac did not work and was causing
compiler warnings. For instance, compiling memcheck/tests/execve2.c will
generate a -Wnonnull warning even though the testcase is explicitly
compiled with -Wno-nonnull. The reason is that (a) -Wformat is implied by
-Wnonnull and (b) the list of compiler flags gets assembled in the wrong
order. The culprit appears to be that we modify CFLAGS in configure.ac and
that really is not the right place. Conceptually, configure should determine
tool-chain capabilities and not assemble compiler flags. That should be done
in Makefiles. This patch entangles all this.

So, whatever was added to CFLAGS in configure.ac has now been moved to
Makefile.all.am and Makefile.tool-tests.am. Those are:
-Wno-long-long
-Wwrite-strings
-Wcast-qual
-fno-stack-protector
Note, that this change allows us to simplify Makefile.tool-tests.am which
in the past was disabling some of those flags (e.g. by adding -Wno-cast-qual
again).
In case of the clang compiler, extra command line options are needed. I've
moved those into a separate 'if COMPILER_IS_CLANG' section and not merge
them into baseline flags.

Related to BZ 334727.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14798
2014-12-03 22:53:00 +00:00
Florian Krohm
84e3e486d3 Change the testcase to not depend on the type of 'this' in the output.
GCC 4.9.2 and GCC 4.8.x have different opinions about that variable's type.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14780
2014-11-24 22:30:49 +00:00
Philippe Waroquiers
01782fe668 Change pub_tool_addrinfo.h AddrInfo and VG_(describe_addr) so as to describe
anonymous or file mmap-ed segments and shared memory segments.

* pub_tool_addrinfo.h:
    new AddrTag Addr_SegmentKind  // Client segment (mapped memory)
    new struct SegmentKind in AddrInfo

* m_addrinfo.c:
   If address is still undescribed, try to describe by findinf a client segment.

* update various tests

* mc_errors.c:
  add a call to VG_(clear_addrinfo) in MC_(pp_describe_addr)
  as the memory allocated in the local AddrInfo has to be cleared once
  info is printed.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14779
2014-11-24 17:46:41 +00:00
Florian Krohm
de7b44d5a6 Announce fix of BZ #155125. As of r14685 I think.
Add testcase.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14731
2014-11-18 10:03:14 +00:00
Philippe Waroquiers
77f136cef4 Implement Option --error-markers=<begin>,<end>
* This option can be used to mark the begin/end of errors in textual
output mode, to facilitate searching/extracting errors in output files
mixing valgrind errors with program output.

* Use the new option in various existing regtests to test the various
  possible usage.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14714
2014-11-12 19:43:29 +00:00
Florian Krohm
d2723ddc9b Merge r14308 from the BUF_REMOVAL branch to trunk
Changes VG_(describe_IP) to return the untruncated result in a statically
allocated local buffer. Fix call sites and update two .exp files who had
truncated names.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14685
2014-11-03 22:43:42 +00:00
Florian Krohm
665280aeaf Merge r14202 from the BUF_REMOVAL branch to trunk.
This patch changes the interface and behaviour of VG_(demangle) and
VG_(maybe_Z_demangle). Instead of copying the demangled name into a
fixed sized buffer that is passed in from the caller (HChar *buf, Int n_buf),
the demangling functions will now return a pointer to the full-length
demangled name (HChar **result). It is the caller's responsiblilty to
make a copy if needed. 

This change in function parameters ripples upward
- first: to get_sym_name
- then to the convenience wrappers
  - VG_(get_fnname)
  - VG_(get_fnname_w_offset)
  - VG_(get_fnname_if_entry)
  - VG_(get_fnname_raw)
  - VG_(get_fnname_no_cxx_demangle)
  - VG_(get_datasym_and_offset)

The changes in foComplete then forces the arguments of
  - VG_(get_objname) to be changed as well

There are some issues regarding the ownership and persistence of
character strings to consider.
In general, the returned character string is owned by "somebody else"
which means the caller must not free it. Also, the caller must not 
modify the returned string as it possibly points to read only memory.
Additionally, the returned string is not necessarily persistent. Here are
the scenarios:
- the returned string is a demangled function name in which case the
  memory holding the string will be freed when the demangler is called again.
- the returned string hangs off of a DebugInfo structure in which case
  it will be freed when the DebugInfo is discarded
- the returned string hangs off of a segment in the address space manager
  in which case it may be overwritten when the segment is merged with
  another segment
So the rule of thunb here is: if in doubt strdup the string.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14664
2014-10-25 19:20:38 +00:00
Florian Krohm
27df6d48bf Followup to r14646. The symbol TIOCSIG is not necessarily defined,
e.g. on s390x with glibc 2.3.4. Modify the testcase to bypass the ioctl
call in that case.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14649
2014-10-22 09:25:03 +00:00
Florian Krohm
17fe8c0a09 Add support for ioctl(fd, TIOCSIG, signal_number) which used
to issue a false complaint. Fixes BZ #339706
Source patch by David Herrmann (dh.herrmann@gmail.com).
Testcase by myself.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14646
2014-10-21 07:20:20 +00:00
Florian Krohm
9959f9acb0 Constify m_oset, m_sparsewa, and m_wordfm.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14640
2014-10-18 16:17:13 +00:00
Julian Seward
635bb7bca9 Hide .version directives in assembly code on Mac, since XCode doesn't
seem to like them.  Patch from Rhys Kidd (rhyskidd@gmail.com).
Fixes #339688.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14623
2014-10-12 17:02:55 +00:00
Julian Seward
77791188fc Fix the thread-name facility and associated test on Darwin.
Patch from Rhys Kidd (rhyskidd@gmail.com).  Fixes #339442.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14622
2014-10-12 13:47:30 +00:00
Florian Krohm
7cfaa923ea Remove unneeded header file which does not exist on Darwin.
Disable test for darwin as pthread_setname_np is not implemented.
But setting and observing the threadname is what this test is all about.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14573
2014-09-27 11:36:08 +00:00
Mark Wielaard
d5e8b1f68f Old STABS code is still being compiled, but never used. Remove it.
Since valgrind 3.9.0 the STABS support was already disabled completely.
But the code was still there being compiled and we were still searching
for stabs sections in binaries. Completely remove all sources, tests and
references. Add a note to coregrind/m_debuginfo/README.txt to mention
the old code can be found in the subversion repository.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14550
2014-09-18 12:24:53 +00:00
Carl Love
559f0eb765 Valgrind regression test fix for stfdpx instruction.
There is a bug in the stfdpx instruction test for ppc32 and ppc64.
The inline assembly to move the arguments into the registers before
the store instruction were moving from the register not to the
register.  The error has been fixed.  This results in a change in
the expected output.
    
Additionally, it was noted that the inline assembly was using "f" rather
then "d" for the double arguments.  Similarly, the prints should have
been %lf not %f for doubles.  These changes were made but they did not
change the output of the tests.
    
This patch fixes Vagrind bugzilla 339020.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14545
2014-09-17 17:43:08 +00:00
Florian Krohm
d71ff248bd Add a missing break as identified by IBM's BEAM checker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14519
2014-09-11 22:27:20 +00:00
Philippe Waroquiers
dd1e6eb3a6 Replace wrong <../memcheck.h> by "../memcheck.h"
This might cause the test to fail to compile with clang.
Might be worth merging in 3.10 branch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14504
2014-09-08 20:41:30 +00:00
Florian Krohm
fc33936e0a Fix function prototype as pointed out by clang.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14470
2014-09-05 19:23:20 +00:00
Florian Krohm
ed872a7014 Fix most clang warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14467
2014-09-05 18:30:05 +00:00
Carl Love
2fabdec65e The update fixes a format issue in the PPC test
none/tests/ppc32/jm-insns.c and none/tests/ppc64/jm-insns.c.
The BE and LE output expect files are updated as well.

There is no Bugzilla related to this update.  The issue
was found and the initial patch and BE output update 
was done by Florian Krohm <florian@eich-krohm.de>.
Carl Love <cel@us.ibm.com> added the LE output update.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14466
2014-09-05 18:05:24 +00:00
Florian Krohm
898b5a08a4 Make sure valgrind builds with clang 3.5.0
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14463
2014-09-05 14:08:51 +00:00
Philippe Waroquiers
104e009d55 prepare for changing the default of --read-inline-info
suppvarinfo5 is using suppression entries that explicitely checks
for a stack trace without inline info.
So, indicate to not read the inline info.
This also means we will have (and keep) at least one test testing the
behaviour of --read-inline-info=no


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14420
2014-09-01 21:52:47 +00:00
Julian Seward
76aa4710d8 Track vex r2939 (renaming and arg-order change for Iop_Extract{64,V128}).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14404
2014-09-01 11:34:32 +00:00
Philippe Waroquiers
3159bc49c8 Improve description of an address that is on a stack but below sp.
An address below the sp will be described as being on a stack, but below sp.

The stack for such an address is found in the registered stacks.

Also, if there is a guard page at the end of the stack (lowest address)
an address in this page will be described as being in thread guard page.
A guard page is recognised as being a page not readable/writable/executable.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14399
2014-08-31 22:27:19 +00:00
Mark Wielaard
e12b5e5ac2 Fix typo in syswrap ppoll param, equate ppoll and poll for memcheck testcase.
ppoll argument is called ufds like the poll argument.
Newer architectures (aarch64) implement poll by calling ppoll directly.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14370
2014-08-26 22:15:58 +00:00
Mark Wielaard
60fe2d5a5b Add socket.S to memcheck/tests/filter_stderr.
sendmsg.vgtest shows socket.S on some arches instead of syscall-template.S
to indicate "in ...libc...".

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14364
2014-08-26 19:41:51 +00:00
Julian Seward
6a859c491c Track renaming of {reciprocal, reciprocal sqrt}{estimate, step}
primops in vex r2932.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14350
2014-08-24 14:02:22 +00:00
Mark Wielaard
262ce8ca11 Bug 338445 amd64 vbit-test fails with unknown opcodes used by arm64 VEX.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14327
2014-08-21 14:44:48 +00:00
Julian Seward
8ad42245b5 Track vex r2924 (Renaming of Iop_QSalN*, Iop_QShlN* and Iop_QShlN*S)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14282
2014-08-15 09:12:28 +00:00