12144 Commits

Author SHA1 Message Date
Zhi-Gang Liu
bb0396704c Disable none/tests/bug234814 test for TileGx.
Add "bool on_altstack" parameter to VG_(sigframe_create)(..)
in sigframe-tilegx-linux.c


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15717
2015-10-23 02:36:09 +00:00
Philippe Waroquiers
6b5a479bda Fix 353891 Assert 'bad_scanned_addr < VG_ROUNDDN(start+len, sizeof(Addr))' failed
All memory dereferences during leak search are checked either with
aspacemgr or using the VA-bits.
So, in theory, no memory fault should occur.
However, the leak search is done so as to resist to e.g.
- desynchronisation between the real pages mapped and the aspacemgr state.
- client pages mprotected against reading
- any other reason why dereferencing a client address would fail.

So, the function lc_scan_memory installs a fault catcher that
is called if a memory fault signal is raised during memory scan.
However, memory dereference is also done in the function heuristic_reachedness.
So, this function must also resist to memory fault.

This patch also installs a fault catcher for the function heuristic_reachedness.

More in details, the following changes are done:
* pub_tool_signal.h and m_signals.c :
  VG_(set_fault_catcher) now returns the previously set fault catcher.
  This is needed so that heuristic_reachedness/lc_scan_memory can save
  and restore the previous fault catcher.

* mc_leakcheck.c:
  Addition of leak_search_fault_catcher that contains the common
  code for the (currently 2) fault catchers used during leak search.

* Modification of heuristic_reachedness and lc_scan_memory:
  Add 2 (small) specific fault catcher that are calling the common
  leak_search_fault_catcher.

* The way sigprocmask is handled has been changed:
  Before this patch, lc_scan_memory was saving/restoring the procsigmask
  for each scanned block (and was restoring it when the fault catcher
  was longjmp-ing back to lc_scan_memory in case of SEGV or BUS.
  This was causing 2 system calls for each block scanned.

  Now, lc_scan_memory and  heuristic_reachedness are not saving/restoring
  the procmask: the work to reset the sigprocmask is only done
  in leak_search_fault_catcher. This is more efficient as no syscall
  anymore is done during leak search, except for (normally) unfrequent
  SIGSEGV/BUS. It is also simpler as signal handling is now done at
  a single place.
  
  It is ok to reset the procmask (in fact, just remove the caught signal
  from the process sigmask) as during leak search, no other activity than
  the leak search is on-going, and so no other SEGV/BUS can be received
  while the handler runs.

This gives moderate speed improvements for applications allocating a lot of
blocks (about 10% improvement when leak searching in 1 million small blocks).

Test case (slightly modified) by Matthias Schwarzott.
  
  
  



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15716
2015-10-22 19:14:30 +00:00
Ivo Raisr
bf01b5a43f Add helgrind tool to the Solaris IPS packaging manifest.
Somehow it slipped through the cracks...
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15715
2015-10-22 13:36:07 +00:00
Ivo Raisr
2b983ea5ef Clarification for some of the Solaris requirements.
Reported by: Matthew Wozniczka <mattheww@simba.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15714
2015-10-21 12:02:04 +00:00
Julian Seward
5e5d78dda0 Fix inconsistent use of vki_ prefixes for struct vki_ifreq.
No functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15713
2015-10-19 11:21:33 +00:00
Rhys Kidd
cb7055b7ed Silence -Wincompatible-pointer-types-discards-qualifiers warning. n-i-bz.
m_replacemalloc/vg_replace_malloc.c:1286:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
ZONE_GET_NAME(VG_Z_LIBC_SONAME, malloc_get_zone_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME'
      return vg_default_zone.zone_name; \
             ^~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1287:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
ZONE_GET_NAME(SO_SYN_MALLOC,    malloc_get_zone_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME'
      return vg_default_zone.zone_name; \
             ^~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1286:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
ZONE_GET_NAME(VG_Z_LIBC_SONAME, malloc_get_zone_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME'
      return vg_default_zone.zone_name; \
             ^~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1287:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
ZONE_GET_NAME(SO_SYN_MALLOC,    malloc_get_zone_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME'
      return vg_default_zone.zone_name; \
             ^~~~~~~~~~~~~~~~~~~~~~~~~

No regressions on OS X 10.10

Before:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15712
2015-10-19 10:20:17 +00:00
Rhys Kidd
6251bc45e3 Silence -Wcast-qual const qualifier warning. n-i-bz.
m_debuginfo/readmacho.c:395:30: warning: cast from 'const void *' to 'DiSym *' drops const qualifier [-Wcast-qual]
   const DiSym* s1 = (DiSym*)v1;
                             ^
m_debuginfo/readmacho.c:396:30: warning: cast from 'const void *' to 'DiSym *' drops const qualifier [-Wcast-qual]
   const DiSym* s2 = (DiSym*)v2;
                             ^
m_libcsignal.c:481:49: warning: cast from 'const vki_sigset_t *' to 'vki_sigset_t *' drops const qualifier [-Wcast-qual]
  VG_(sigintersectset)(&pending, (vki_sigset_t*)set);
                                                ^

No regressions on OS X 10.10

Before:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15711
2015-10-19 10:18:28 +00:00
Florian Krohm
5085e06eb6 Fix a bug passing immediate values to ir_inject.c
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15710
2015-10-17 11:18:50 +00:00
Florian Krohm
1b73579e81 Link the vbit tester against libvex-<arch>-<os>.a
This allows to remove local copies of certain VEX functions.
VEX r3200 enables this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15709
2015-10-16 17:29:54 +00:00
Ivo Raisr
b6aeb1c9e6 Solaris syscall: Add support for lwp_cond_wait(170).
Provide scalar test as well.
Fixes BZ #353920.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15708
2015-10-16 12:20:20 +00:00
Ivo Raisr
9aaa41b23d Solaris syscall: Enable fchdir(120) - generic.
Provide scalar tests as well.
Fixes BZ #353917.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15707
2015-10-15 09:37:14 +00:00
Rhys Kidd
042e76373e Fill out missing functionality on amd64 OS X to load a fake sigreturn.
Also enhance consistency of formatting for x86 OS X section.

No regressions on OS X 10.10

Before:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15706
2015-10-15 07:01:57 +00:00
Rhys Kidd
06d960e68d Fill out missing functionality on amd64 OS X to back up guest state to restart a system call.
No regressions on OS X 10.10

Before:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15705
2015-10-15 05:40:17 +00:00
Rhys Kidd
7dec5ffbbf Establish some plumbing for old_semwait_signal syscall on OS X.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15704
2015-10-15 04:43:06 +00:00
Rhys Kidd
baff9a38b8 Fix typo in malloc_get_zone_name() intercept. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15703
2015-10-15 04:18:12 +00:00
Florian Krohm
91a29a676c On a zEC12 or z13, a glibc with lock elision enabled infers from HWCAP
that the prerequisites for lock elision are met.  Then it may use TBEGIN
and other transactional-execution instructions which are not implemented
by Valgrind.  Likewise, the upcoming glibc 2.23 will exploit vector
instructions if they are advertised by HWCAP; and those are currently
not implemented by Valgrind either.  In general, the increased use of
ifunc may lead to more such cases in the future.

This patch suppresses the advertising of those hardware features via
HWCAP which are either not known to Valgrind or currently unsupported.

Patch by Andreas Arnez (arnez@linux.vnet.ibm.com).
Fixes BZ #353680.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15702
2015-10-12 20:35:56 +00:00
Florian Krohm
611478a742 Use local labels instead of global labels (ppc and mips
specific code).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15701
2015-10-12 20:15:12 +00:00
Ivo Raisr
6ef7c1085f Solaris syscall: Add support for pset family (207).
Provide scalar tests as well.
Fixes BZ #353398.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15700
2015-10-12 19:10:42 +00:00
Mark Wielaard
26cbea8712 Bug #278744 cvtps2pd with redundant RexW.
Add testcase for VEX svn r3198.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15699
2015-10-12 14:32:03 +00:00
Rhys Kidd
821fd4cb11 Plumb malloc_zone_memalign() through malloc_zone_t struct on OS X. No regressions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15698
2015-10-04 09:23:07 +00:00
Rhys Kidd
84a78bdec6 Follow up to r15628, properly guard none/tests/ansi and fix a typo. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15697
2015-10-03 04:47:04 +00:00
Ivo Raisr
10fe719d7a Explicitly mark the stack as non-executable for Solaris
binaries (Valgrind launcher and tools).
Follow-up for r15692. n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15696
2015-10-02 16:45:01 +00:00
Mark Wielaard
8327786b08 Don't advertise RDRAND in cpuid for Core-i7-4910-like avx2 machine.
Announce fix for bug #353370 (VEX svn r3197) in NEWS.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15695
2015-10-01 12:35:16 +00:00
Florian Krohm
e055f3d4ed Beef up the check_headers_and_includes script to make sure
every assembler file instantiates MARK_STACK_NO_EXEC unconditionally.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15694
2015-09-30 20:58:36 +00:00
Florian Krohm
fd4b1a19c1 Remove an unneeded header file. Spotted by Matthias Schwarzott.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15693
2015-09-30 20:34:32 +00:00
Florian Krohm
193f88fad4 Make sure no executable stack gets created.
Explanation by Matthias Schwarzott:

The linker will request an executable stack as soon as at least one
object file, that is linked in, wants an executable stack.
And the absence of the 
      .section .note.GNU-stack."",@progbits
is enough to tell the linker that an executable stack is needed.
So even an empty asm-file must at least contain this statement to not
force executable stacks on the whole executable.

* Define a helper macro MARK_STACK_NO_EXEC that disables the
  executable stack.
* Instantiate this macro unconditionally at the end of each asm file.

Patch by Matthias Schwarzott <zzam@gentoo.org>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15692
2015-09-30 20:30:48 +00:00
Ivo Raisr
444ec8bbd5 Ignore some more executable files in memcheck/tests/solaris.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15691
2015-09-29 19:03:05 +00:00
Ivo Raisr
386124cab0 Move more complicated tests out of memcheck/tests/solaris/scalar_ioctl
to memcheck/tests/solaris/ioctl.
While at it, remove a fixed size buffer as reported by Florian Krohm.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15690
2015-09-29 18:57:56 +00:00
Ivo Raisr
cf2ca3123f Solaris ioctl: more of those sockio ioctl wrappers.
SIOCGLIFBRDADDR, SIOCGLIFCONF, SIOCGLIFFLAGS, SIOCGLIFNETMASK.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15689
2015-09-29 14:23:51 +00:00
Bart Van Assche
0c3280baa5 NEWS: Update
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15688
2015-09-29 05:40:43 +00:00
Bart Van Assche
08dcf38562 drd: Improve thread startup code for non-Linux platforms
Ivo Raisr had reported that thread startup was slow on Solaris.
This patch reduces the thread startup time on Solaris.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15687
2015-09-29 05:39:00 +00:00
Ivo Raisr
9c3ee43887 Solaris ioctl: more wrappers for sockio ioctls.
SIOCGIFCONF, SIOCGIFFLAGS, SIOCGIFNETMASK, and SIOCGIFNUM.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15686
2015-09-29 05:20:16 +00:00
Ivo Raisr
acadf89572 Fix compiler warning about unused functions and variables
on older Solaris where original auxv is not present.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15685
2015-09-26 03:45:11 +00:00
Ivo Raisr
a0bde0618b Solaris syscall: Add support for system_stats (154).
Provide scalar test as well.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15684
2015-09-25 21:04:45 +00:00
Ivo Raisr
fe22c1e6e2 Provide test for AT_SUN_SYSSTAT_ADDR emulation.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15683
2015-09-25 20:53:09 +00:00
Ivo Raisr
516df5f4b5 Support correctly AT_SUN_SYSSTAT_ADDR and AT_SUN_SYSSTAT_ZONE_ADDR
in the auxiliary vector.

This is possible as Solaris 12 kernel now creates auxv even
for statically linked binaries.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15682
2015-09-25 20:12:26 +00:00
Philippe Waroquiers
2f571b06e2 Factorise condition to do recursive merge in the macro
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15681
2015-09-24 20:31:04 +00:00
Rhys Kidd
87f2b96bc8 Set svn ignore on recently added or modified tests, n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15680
2015-09-24 11:50:02 +00:00
Julian Seward
0a8d1755ec Merge, from branches/VALGRIND_3_11_BRANCH, NEWS and docs/xml/vg-entities.xml.
Bump version to 3.12.0.SVN.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15679
2015-09-23 13:35:36 +00:00
Mark Wielaard
3d7da7a718 Bug 353084 arm64 doesn't support sigpending system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15676
2015-09-23 12:15:36 +00:00
Mark Wielaard
3d33343cb7 Bug 353083 arm64 doesn't implement various xattr system calls.
This enables setxattr, lsetxattr, fsetxattr, fgetxattr, removexattr,
lremovexattr, fremovexattr, listxattr, llistxattr and flistxattr on
arm64-linux.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15675
2015-09-23 11:51:47 +00:00
Florian Krohm
d6133786a6 Avoid a possible memory leak.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15673
2015-09-22 11:06:42 +00:00
Florian Krohm
a8a0c4bcce Add copyright/license comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15672
2015-09-22 07:21:50 +00:00
Florian Krohm
2b628c20a2 Update TODO list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15671
2015-09-22 07:04:25 +00:00
Florian Krohm
079e74fe78 Break a few overly long lines.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15670
2015-09-22 07:03:38 +00:00
Florian Krohm
c332279b5c Fix up a few comments.
Patch by Jean Delvare <jdelvare@suse.de>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15657
2015-09-20 13:42:06 +00:00
Florian Krohm
0d5f723bec Followup to r14908 (BZ #342603).
Comparing the command byte with VKI_I2C_SMBUS_QUICK is like comparing
apples to carrots, it makes no sense. The command byte is unused for
quick transactions anyway so checking its value is pointless.
Patch by Jean Delvare <jdelvare@suse.de>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15656
2015-09-20 13:41:25 +00:00
Florian Krohm
4a999cf4a2 Followup to r14908 (BZ #342603).
The first byte of the data array holds the length, so the actual data
length is the value of that byte plus one.
Patch by Jean Delvare <jdelvare@suse.de>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15655
2015-09-20 13:40:47 +00:00
Mark Wielaard
9ebcef0b66 Filter out glibc warning messages about unexpected futex results in tests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15654
2015-09-18 09:15:15 +00:00
Carl Love
7161ebc00f Add Power PC ISA check to the vbit-test
The support for the Valgrind Iops is dependent on the Power processor
support for various instructions.  The instructions supported by a
given Power processor is based on the version of the ISA.  The patch
add a check to the vbit-test to ensure it does not try to test an Iop
that generates an instruction on the host that is not supported.

This patch fixes bugzilla 352765.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15653
2015-09-16 23:33:40 +00:00