Commit Graph

12222 Commits

Author SHA1 Message Date
Mark Wielaard
54794decc8 Bug 359201 followup. futex skips argument 5 if op is FUTEX_WAIT_BITSET.
The original fix in svn r15793 read argument 6 separately by using PRA6
unconditionally. This is wrong. We need to first check whether a
track_pre_reg_read callback is registered (only memcheck does).
The PRE_REG_READX macro already had this check. Just add the same
before calling PRA6. Thanks to Tom Hughes for noticing. Without this
helgrind/tests/cond_timedwait_test and drd/tests/pth_inconsistent_cond_wait
regtests would fail.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15795
2016-02-18 11:14:47 +00:00
Philippe Waroquiers
be2da24d6c Fix incorrect (or infinite loop) unwind on RHEL7 amd64 64 bits.
Same kind of problems as explained and fixed in revision 15720:
In some cases, unwinding always retrieves the same pc/sp/bp.

Fix for 64 bits is similar: stop unwinding if the previous sp is >= new sp



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15794
2016-02-17 22:41:14 +00:00
Mark Wielaard
ccd541e916 Bug 359201 futex syscall skips argument 5 if op is FUTEX_WAIT_BITSET
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15793
2016-02-17 20:53:34 +00:00
Florian Krohm
a696c9e44a s390: Fix BZ #359289, adding support for popcnt insn.
Companion patch is VEX r3210.
Patch by Andreas Arnez (arnez@linux.vnet.ibm.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15792
2016-02-17 20:00:59 +00:00
Ivo Raisr
f71b442444 Solaris syscall: commands A_GETSTAT and A_SETSTAT
for auditon(2) subcode of the auditsys() syscall
were removed in Solaris 12.
However they stay for Solaris 11 and illumos.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15791
2016-02-17 18:11:32 +00:00
Carl Love
0e62935bd4 Power PPC 128bit modulo and carry instruction fix
VEX commit 3209 fixed: an issue with caculating the carry to the next 32-bit
chunk for the Power PPC 128-bit add and subract instructions: vaddcuq, vadduqm,
vsubcuq, vsubuqm, vaddecuq, vaddeuqm, vsubecuq, vsubeuqm

The corresponding test case didn't catch the issue.  This commit adds data
values to the test that verify the issue is fixed.

Valgrind Bugzilla 359472 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15790
2016-02-16 21:23:52 +00:00
Florian Krohm
686abc2134 s390: Recognise machine model z13s (2965).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15789
2016-02-16 21:15:32 +00:00
Philippe Waroquiers
e2d594ccbc Speed up vgdb in standalone mode by using noack mode
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15788
2016-02-15 22:53:45 +00:00
Philippe Waroquiers
f6f39d4dbe Fix Bug 359133 - m_deduppoolalloc.c:258 (vgPlain_allocEltDedupPA): Assertion 'eltSzB <= ddpa->poolSzB' failed.
When the elt to allocate is bigger than the pool size, allocate
a specific pool only for this element.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15787
2016-02-14 22:14:19 +00:00
Ivo Raisr
2428a44b84 Fix scalar test case for llseek on x86/Solaris.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15786
2016-02-12 13:57:50 +00:00
Ivo Raisr
970c6d26d2 New gcc versions (4.9, 5.3) provided by Solaris enable
largefile support by default. This gets in the way what
Valgrind core expects (vki, various m_libc modules).
Therefore disable largefile support if it is enabled.
Anyway, support for 32-bit applications is going away in Solaris 12.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15785
2016-02-12 13:43:59 +00:00
Ivo Raisr
f6c211aaf8 Exclude 'threading model' information from Solaris coredump_many_threads test as well
See previous SVN r15783 for details.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15784
2016-02-08 08:26:17 +00:00
Ivo Raisr
2811d9dff6 Exclude 'threading model' information from Solaris coredump tests
Solaris 12 transitioned to public libproc and mdb now prints
'raw lwps' instead of 'native threads' for the threading model.
This information is irrelevant for coredump generation and analysis;
therefore leave it out.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15783
2016-02-07 23:59:41 +00:00
Ivo Raisr
24e1e9f493 Solaris syscall: Add support for getrandom(143).
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15782
2016-02-05 22:57:42 +00:00
Mark Wielaard
11e3a4824d Explicitly test command -v host output before trying host command.
We have to explicitly test command -v host worked otherwise on systems
that do not have 'host' installed will return error code 127 and stop
testing. This is because vg_regtest uses '/bin/sh -c' to execute the
prereq command. Found by Petar Jovanovic.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15781
2016-02-04 22:38:06 +00:00
Philippe Waroquiers
861333b084 Some more fixes for Bug 348345 - Assertion fails for negative lineno
* Complain instead of asserting when negative line nr in inline info
* use a macro to factorise the complain once logic about lineno limits



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15780
2016-02-03 22:12:56 +00:00
Tom Hughes
5465229553 Add tests for FCOM/FCOMP instructions. BZ#212352.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15779
2016-02-03 10:15:56 +00:00
Petar Jovanovic
525050c47a mips64: use getdents() if getdents64() is not available
The MIPS64 getdents64() system call is only present in 3.10+ kernels.
If the getdents64() system call is not available fall back to using
getdents() and modify the result to be compatible with getdents64().
This matters only when --track-fds=yes is set.

This change fixes none/tests/fdleak* failures on MIPS64 platforms with
kernel versions older than 3.10.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15778
2016-01-29 17:47:43 +00:00
Julian Seward
696487740c Update list of bugs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15777
2016-01-28 12:20:42 +00:00
Philippe Waroquiers
f2e1687cb8 Fix misplaced closing parenthesis in various VG_(....) calls
At many places, we have:
   VG_(fun(a,b,c))
instead of
   VG_(fun)(a,b,c)
So, fix these cases, found using:
grep -n -i -e 'VG_([a-z][a-z0-9_]*[^a-z0-9_)]' *.c */*.c */*/*.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15776
2016-01-27 22:35:14 +00:00
Ivo Raisr
f18a40c2c8 Fix expected output of test memcheck/tests/leak_cpp_interior on Solaris 12.
C++ allocator from Solaris Studio allocates for std::string
57 bytes instead of former 40 bytes on 64-bit, and 45 bytes instead of 28 on 32-bit.
Confirmed with truss and --trace-alloc=yes.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15775
2016-01-26 10:34:16 +00:00
Ivo Raisr
8952c86a9c Fix compilation error on Solaris.
Include <sys/segments.h> only on x86/amd64 architecture.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15774
2016-01-26 04:31:04 +00:00
Bart Van Assche
85cbffe27b configure.ac: Port to gcc 5
Apparently gcc 5 behaves as follows:
$ gcc -dumpversion
5



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15773
2016-01-25 04:27:25 +00:00
Mark Wielaard
be3614b774 Fix tinycc.c misleading indentation as pointed out by GCC6.
tinycc.c: In function ‘expr_eq’:
tinycc.c:13368:21: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
                     gv(rc);
                     ^~

tinycc.c:13366:17: note: ...this ‘else’ clause, but it is not
                 else
                 ^~~~

Two statements are indeed misleadingly indented. Fixed by unindenting them.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15772
2016-01-24 13:39:10 +00:00
Philippe Waroquiers
c80f32e662 Change tests using --fullpath-after so as to work with ccache caching compiler
ccache sometimes causes the source file absolute name to be another
full path (not $PWD).
This means that the badfree3 and varinfo5 tests can fail due to
the full path after not being match on $PWD.
So, rather ask full path after a part of the path that is stable
even when ccache decides to reuse a already compiled object from
another directory.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15771
2016-01-22 22:06:02 +00:00
Philippe Waroquiers
9c66c9607b Implement support for 'catch syscall' in gdbserver.
Note that catch syscall implies to use the soon to be released
gdb 7.11 version.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15770
2016-01-22 21:06:23 +00:00
Mark Wielaard
50fb5a1834 Squash GCC warning in none/tests/arm/v6media.c
v6media.c: In function ‘gen_cin’:
v6media.c:10:12: warning: type of ‘cin’ defaults to ‘int’ [-Wimplicit-int]
 static int gen_cin(cin)

Just make the argument an int.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15769
2016-01-22 15:14:16 +00:00
Mark Wielaard
dcb119cf41 Squash glibc warning about _BSD_SOURCE being deprecated tests.
glibc 2.20 deprecated _BSD_SOURCE and _SVID_SOURCE and now requires
_DEFAULT_SOURCE to be defined instead. Add _DEFAULT_SOURCE define to
prevent warnings like:

In file included from /usr/include/stdio.h:27:0,
                 from stack_switch.c:5:
/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^

See https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15768
2016-01-22 13:49:22 +00:00
Mark Wielaard
e484dcb4ff Squash deprecation warnings from GCC in mpi wrapper code.
We wrap some deprecated things in libmpiwrap. Since we do want to keep
wrapping those add -Wno-deprecated-declarations to squash warnings like:

libmpiwrap.c:281:4: warning: ‘ompi_mpi_ub’ is deprecated: MPI_UB is deprecated in MPI-2.0 [-Wdeprecated-declarations]

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15767
2016-01-22 13:42:47 +00:00
Mark Wielaard
6072a5a3ac Bug #357833 Setting RLIMIT_DATA to zero breaks with linux 4.5+
We used to set the process datasize rlimit to zero to prevent
any internal use of brk() from having any effect. But later
linux kernels redefine RLIMIT_DATA as the size of any data
areas, including some dynamic mmap memory allocations.

See bug #357833 for the commit that went into linux 4.5
changing the definition of RLIMIT_DATA. So don't mess with
RLIMIT_DATA anymore. Just remember it for use in the syscall
wrappers.

This also cleans up some hacks around the execv and spawn wrappers.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15766
2016-01-21 11:37:43 +00:00
Mark Wielaard
0fe0da145d Use command -v instead of which in res_search.vgtest prereq.
"command -v" is a (POSIX) shell builtin that should work everywhere.
"which" might be an external command that might not be installed in
which case the shell might just error out.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15765
2016-01-20 23:15:04 +00:00
Mark Wielaard
68a1308014 Bug #358030 Support direct socket calls on x86 32bit (new in linux 4.3)
Patch by ronald.wahl@raritan.com.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15764
2016-01-20 22:24:43 +00:00
Florian Krohm
6389086806 Followup to r15762. Add missing type in cast expression.
Do not use C++ comments. They are not allowed in this file.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15763
2016-01-17 20:34:53 +00:00
Florian Krohm
d6156d8f84 Avoid an MSVC compiler warning about an unused function parameter.
Fixes BZ #356817


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15762
2016-01-17 16:20:14 +00:00
Florian Krohm
45e3d3012d In ML_(am_allocate_segname) do not set the reference count of the
slot to 1. Rather do that in add_segment which is where the segment
refering to that name actually comes into existence.
Properly handle the case in add_segment where the to-be-added segment
and one (or more) of the segments it replaces have the same name
This may occur when doing a mremap.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15761
2016-01-16 21:44:31 +00:00
Florian Krohm
f44db9afb3 Remove code that has no effect. Looks like a leftover from early
debugging days.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15760
2016-01-16 21:12:57 +00:00
Philippe Waroquiers
647642d093 fix n-i-bz false positive leaks due to aspacemgr merging non heap segments with heap segments.
aspace mgr provides VG_(am_mmap_client_heap) that mmaps memory and
marks it as being client heap memory. Marking superblock segments used
for malloc/free as heap is critical for correct leak search: segments
mmap-ed for malloc/free cannot be considered as part of the root set.
On the other hand, other mmap-ed segments cannot be marked as client
heap, otherwise these segments will not be part of the root set, and
will not be scanned.

aspacemgr merges adjacent segments when they have the same characteristics
e.g. kind, RWX and isCH (is client heap) must be the same (see function
maybe_merge_nsegments).

However, VG_(am_mmap_client_heap) has a bug:
  * it first mmaps a normal segment (not marked as heap) using
     VG_(am_mmap_anon_float_client)
  * it then searches the segment that contains the just mmap-ed address and
    marks it as heap.
    
The problem is that VG_(am_mmap_anon_float_client) has already
possibly merged the new segment with a neighbour segment, without
taking the to be marked isCH into account, as the newly allocated memory
has not yet been marked as Client Heap.  So, this results in some memory being
marked as client heap, while it in fact is not client heap. This
memory will then not be scanned by the leak search.

The fix consists in having VG_(am_mmap_anon_float_client) and
VG_(am_mmap_client_heap) calling a new function
am_mmap_anon_float_client, which will mark (or not) the new segment as
client heap *before* trying to merge it with neighbouring segments.
Then the new (heap) segment will only be merged with neighbours that are also
client heap segments.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15759
2016-01-14 20:23:11 +00:00
Ivo Raisr
da7db302c1 Fix expected output of helgrind/tests/tc20_verifywrap on Solaris.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15758
2016-01-13 05:37:36 +00:00
Ivo Raisr
fd75106fb5 Announce properly fix of:
357871 - pthread_spin_destroy not properly wrapped


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15757
2016-01-12 20:32:31 +00:00
Ivo Raisr
702c19e525 Fix typo in Helgrind's wrapper of pthread_spin_destroy().
Patch provided by: Jason Dillaman <dillaman@redhat.com>.
Fixes BZ #357871.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15756
2016-01-12 20:31:15 +00:00
Florian Krohm
5abaa97db8 VG_(fclose) ought to close the file, you silly. Fixes BZ #357887.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15755
2016-01-12 14:32:05 +00:00
Petar Jovanovic
76b3f1624d mips: remove link script exception for MIPS arch
Current toolchains on MIPS targets that we care about are reasonably
modern and we do not need this link script exception for MIPS anymore.

This should fix issues with newer toolchain versions and .MIPS.abiflags
section.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15754
2015-12-29 19:14:37 +00:00
Philippe Waroquiers
10876a2dbe Fix 353660 XML in auxwhat tag not escaping reserved symbols properly
Changed a few %s or %pS into %ps in m_addrinfo.c
(based on code reading matching the pattern given in the bug report,
as there was no reproducer).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15753
2015-12-28 22:02:18 +00:00
Petar Jovanovic
13e817c2ea mips: update exp files for helgrind/tests/tc20_verifywrap
Some recent changes, starting from r15426, have modified the test and
its expected output. The exp files have been only partially updated for
MIPS. We complete that with this change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15752
2015-12-23 18:48:18 +00:00
Petar Jovanovic
a5f0b51ef3 mips: update expected output for helgrind/tests/tc18_semabuse
r15620 changed the test and the expected output for tc18_semabuse,
r15630 fixed the expected output file for other architectures but not
for mips.
Now we update it for mips as well.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15751
2015-12-22 16:06:07 +00:00
Ivo Raisr
719b0574ea Fix expected stderr on Solaris for memcheck/tests/gone_abrt_xml.
On Solaris, the stack frame looks like:
  <stack>
    <frame>
      <ip>0x........</ip>
      <obj>/lib/amd64/libc.so.1</obj>
      <fn>kill</fn>
    </frame>
    <frame>
      <ip>0x........</ip>
      <obj>.../gdbserver_tests/gone</obj>
      <fn>(below main)</fn>
    </frame>
  </stack>

because Solaris libc does not currently contain DWARF CFI and
stack unwinder gets only return address from _start().



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15750
2015-12-15 10:43:25 +00:00
Ivo Raisr
683c52fb7e Fix expected output of massif/tests/mmapunmap on Solaris.
On Solaris and Linux, mmap() is an optimized function without
prologue and epilogue. However, Solaris libc does not currently
bear any DWARF CFI. Therefore stack chain unwinder grabs only
two entries: IP inside mmap() and return address from the previous
frame which points inside _start(), right after where main()  
is invoked. By introducing an intermediate function f(), main()
is now visible in the stack trace even on Solaris.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15749
2015-12-14 20:14:44 +00:00
Philippe Waroquiers
7a0b7b8b55 Fix the bug description in NEWS
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15748
2015-12-13 16:54:34 +00:00
Philippe Waroquiers
21ec256b95 Fix 191069 Exiting due to signal not reported in XML output
Patch from  Matthias Schwarzott (slightly modified)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15747
2015-12-13 16:53:46 +00:00
Ivo Raisr
bcea2454f3 Remove a temporary file after massif/tests/mmapunmap test run.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15746
2015-12-12 19:58:40 +00:00