1817 Commits

Author SHA1 Message Date
Zhi-Gang Liu
2e186aae13 To address memcheck/tests/leak-segv-jmp test failure for TILEGX
By: Zhi-Gang Liu       zhg.liu@gmail.com


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15097
2015-04-15 03:26:38 +00:00
Philippe Waroquiers
8707b88cbb Update expected result for leak-segv-jmp, following TileGX addition of
a few lines in leak-segv-jmp.c


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15081
2015-04-10 19:08:17 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Julian Seward
e51ade1d11 Track vex r3120, that changed the type of Iop_Sqrt64x2 and Iop_Sqrt32x4.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15074
2015-04-07 09:08:42 +00:00
Julian Seward
2eca28d9d3 Memcheck: add support for recently added IROps:
Iop_F64toF16 
Iop_F32toF16 
Iop_F16toF64 
Iop_F16toF32 



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15070
2015-04-06 14:52:28 +00:00
Julian Seward
149f6c980d Un-break the build following vex r3110. Thanks to PetarJ for the fix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15052
2015-03-30 19:14:35 +00:00
Florian Krohm
f39011b8b6 Add STATIC_ASSERT and use it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15047
2015-03-28 18:36:01 +00:00
Philippe Waroquiers
275c1897dc Extensible main thread stack is tricky :(.
Revision 14976 causes a regression : stacktrace produced when the
stack has not yet been extended to cover SP will only contain one
element, as the stack limits are considered to be the limits of
the resvn segment.

This patch fixes that, by taking Resvn/SmUpper segment into
account to properly compute the limits.
It also contains a new regtest that fails with the trunk
(only one function in the stacktrace)
and succeeds with this patch (the 2 expected functions).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15046
2015-03-28 12:52:23 +00:00
Rhys Kidd
d442b97795 Further fixes for bz#345394 specifically for OS X 10.10
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15038
2015-03-26 10:14:25 +00:00
Florian Krohm
e7674cfdbb Add VG_(am_is_bogus_client_stack_pointer)(Addr).
The function is used in VG_(client_syscall) to avoid extending the stack
when it is clear that the current value of the stack pointer does not
point into a segment that looks like a stack segment.
See the comments in the code there.
As a side effect of this we can now revert r15018 which increased
the stack size of the alternate stack in memcheck/tests/sigaltstack.c.
The reason is that the belief at the time: "alternate stack is too small"
was not correct. What instead happened was that VG_(client_syscall) called
VG_(extend_stack) without need (the syscall was tgkill) and the new stack
pointer happened to be in a file segment. 
In other words: the current stack pointer was still within the alternate
stack, i.e. the alternate stack was (barely) large enough.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15034
2015-03-23 17:13:04 +00:00
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
Florian Krohm
d485eed8e0 Fix a few compiler warnings issued by clang 3.6.0
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14969
2015-02-28 09:22:09 +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
Julian Seward
fbf8cd3a46 Handle new IROps added in vex r3092:
Iop_RecipStep64Fx2, Iop_RSqrtStep64Fx2 
Iop_RSqrtEst64Fx2,  Iop_RecipEst64Fx2 
Iop_RecpExpF64,     Iop_RecpExpF32 
 --This line, and those below, will be ignored--

M    memcheck/mc_translate.c


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14959
2015-02-24 12:24:35 +00:00
Florian Krohm
3e53930ad0 Update a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14950
2015-02-20 16:46:50 +00:00
Florian Krohm
00ffec50e5 Pass in a mask of segment kinds to VG_(get_segment_starts)
and VG_(am_get_segment_starts) to indicate which segments
should be collected. That should solve the following problem:
in m_main.c we used to:

      seg_starts = VG_(get_segment_starts)( &n_seg_starts );

      for (i = 0; i < n_seg_starts; i++) {
         Word j, n;
         NSegment const* seg 
            = VG_(am_find_nsegment)( seg_starts[i] );
         vg_assert(seg);
         if (seg->kind == SkFileC || seg->kind == SkAnonC) {

         ...
         // ... dynamic memory allocation for valgrind
         ...
      }

This caused the vassert(seg) to fire because the dynamic memory
allocation further down the loop changed segments such that a 
valgrind segment which used to be non-SkFree suddenly became 
SkFree and hence VG_(am_find_nsegment) returned NULL. Whoom.

With this revision we only collect the segments we're really
interested in. For the example above that is all client segments.
So if V allocates memory -- fine. That will not change the layout
of client segments.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14949
2015-02-20 14:00:23 +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
Julian Seward
7c988b57cb Handle new value ILGop_Ident64 in enum type IRLoadGOp. This tracks
vex r3074.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14892
2015-01-27 23:10:19 +00:00
Florian Krohm
e70cb7b851 VG_(am_get_filename) returns a pointer to memory that belongs to the
address space manager. Callers should neither modify the string nor
free it (as the string resides is statically allocated memory). That
calls for a   const HChar *
The type change exposed two bugs. One in m_addrinfo.c and one in 
m_debuginfo.c. In both cases the returned string could possibly be freed later
on. So we need to strdup it first. Now fixed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14886
2015-01-24 00:02:19 +00:00
Philippe Waroquiers
5f8b8d6918 Small doc improvement: make more clear that --show-leak-kinds and --errors-for-leak-kinds
have an effect only for a full leak search.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14852
2015-01-05 17:00:54 +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
Florian Krohm
e7ed65a9f3 Track the IMark changes in VEX r3055.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14844
2015-01-02 17:32:40 +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
1aa9a52c1c Avoid spurious warnings about white space following a backslash
in a line splice.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14832
2014-12-28 16:46:14 +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
70a8ef051c Fix 197259 Unsupported arch_prtctl PR_SET_GS option
(valgrind side).
In summary: we were counting somewhat on the luck for FS,
we now similarly count on luch for GS
See VEX commit log r3043 for more details.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14815
2014-12-17 00:00:11 +00:00
Florian Krohm
48c0ff5c76 Fix BZ #116002.
Left justification of strings in myvprintf_str was mixed up.
Now fixed and %s formats changed accordingly.
In function myvprintf_int64: the local buffer was not large
enough to hold ULONG_MAX in binary notation. Numbers were
truncated at 39 digits. 
Testcases added.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14808
2014-12-13 18:35:00 +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
f7c5c06c5d Add limited support for printing floating point numbers to
VG_(debugLog_vprintf). 
Remove function VG_(percentify) and fix up its call sites (part of
fixing BZ #337869.
Allow the width in a format specification to be '*', i.e. the width is
given as an additional function argument.

The limitations for printing floating point numbers are:
(1) %f is the only supported format. Width and precision can be
    specified.
(2) Funny numbers (NaN and such) are not supported.
(3) Floating point numbers need to be benign in the sense that their
    integral part fits into an ULong.
This is good enough for our purposes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14806
2014-12-12 19:32:10 +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
Julian Seward
7b68710471 isBogusAtom: handle missing case Ico_F32.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14740
2014-11-20 10:15:17 +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