]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
11 years agoFix problems due to generating Neon instructions on non-Neon capable
Julian Seward [Wed, 4 Mar 2015 12:35:54 +0000 (12:35 +0000)] 
Fix problems due to generating Neon instructions on non-Neon capable
hosts:

* iselNeon64Expr, iselNeonExpr: assert that the host is actually
  Neon-capable.

* iselIntExpr_R_wrk, existing cases for Iop_GetElem8x8,
  Iop_GetElem16x4, Iop_GetElem32x2, Iop_GetElem8x16, Iop_GetElem16x8,
  Iop_GetElem32x4:
  Limit these to cases where the host is Neon capable, else we wind up
  generating code which can't run on the host.

* iselIntExpr_R_wrk: add alternative implementation for
  Iop_GetElem32x2 for non-Neon capable hosts.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3098

11 years agoFix 343173 - helgrind crash during stack unwind
Philippe Waroquiers [Tue, 3 Mar 2015 22:00:06 +0000 (22:00 +0000)] 
Fix 343173 - helgrind crash during stack unwind

This fixes a helgrind crash detected on android.
Android bionic pthread lib unmaps the stack for detached threads
before exiting.
Helgrind tries to unwind the stack to record a 'read' after
the stack unmap, just before the exit syscall.
The unwind then causes a SEGV.

The solution consists in tightening the calculation of
the stack limits, so as to stop unwinding when no valid stack
can be found.
Regression test reproduces the same problem by simulating the
bionic behaviour on linux, using asm similar to bionic lib.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14976

11 years agoUpdate list of ignored files.
Florian Krohm [Tue, 3 Mar 2015 14:58:29 +0000 (14:58 +0000)] 
Update list of ignored files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14975

11 years agoProduce a user message in case of stack overflow.
Florian Krohm [Tue, 3 Mar 2015 14:56:17 +0000 (14:56 +0000)] 
Produce a user message in case of stack overflow.
Change VG_(extend_stack) and VG_(am_extend_into_adjacent_reservation_client)
accordingly.
Remove some redundant checking.
Add testcase.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14974

11 years agoUpdate a comment. Apparently the code was refactored at some point...
Florian Krohm [Mon, 2 Mar 2015 21:10:46 +0000 (21:10 +0000)] 
Update a comment. Apparently the code was refactored at some point...

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14973

11 years agoFix missing libobjc suppressions on OS X 10.10
Rhys Kidd [Sun, 1 Mar 2015 13:22:21 +0000 (13:22 +0000)] 
Fix missing libobjc suppressions on OS X 10.10
bz#344702
- Update darwin14.supp suppressions
- Includes malloc_zone_malloc and malloc related issues in system libraries

Before

== 585 tests, 256 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After

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

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14972

11 years agoChange the testcase such that the output matches the intended output.
Florian Krohm [Sun, 1 Mar 2015 09:36:54 +0000 (09:36 +0000)] 
Change the testcase such that the output matches the intended output.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14971

11 years agoFix suppression for pthread_rwlock_init on OS X 10.10
Rhys Kidd [Sun, 1 Mar 2015 01:35:59 +0000 (01:35 +0000)] 
Fix suppression for pthread_rwlock_init on OS X 10.10
bz#344686
- Update darwin14.supp to match prior OS X versions

Before

== 585 tests, 257 stderr failures, 23 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After

== 585 tests, 256 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14970

11 years agoFix a few compiler warnings issued by clang 3.6.0
Florian Krohm [Sat, 28 Feb 2015 09:22:09 +0000 (09:22 +0000)] 
Fix a few compiler warnings issued by clang 3.6.0

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14969

11 years agoAdd machinery to try and transform A ^ ((A ^ B) & M)
Julian Seward [Fri, 27 Feb 2015 13:33:56 +0000 (13:33 +0000)] 
Add machinery to try and transform A ^ ((A ^ B) & M)
into (A ^ ~M) | (B & M).

The former is MSVC's optimised idiom for bitfield assignment, the
latter is GCC's idiom.  The former causes Memcheck problems because it
doesn't understand that (in this complex case) XORing an undefined
value with itself produces a defined result.

Believed to be working but currently disabled.  To re-enable, change
if (0) to if (1) at line 6651.  Fixes, to some extent, and when
enabled, bug 344382.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3097

11 years agoEnhance the CSE pass so it can common up loads from memory. Disabled
Julian Seward [Fri, 27 Feb 2015 13:22:48 +0000 (13:22 +0000)] 
Enhance the CSE pass so it can common up loads from memory.  Disabled
by default since this is a somewhat dodgy proposition in the presence
of spinloops and racy accesses.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3096

11 years agoTidy up of CSE. Create functions irExpr_to_TmpOrConst,
Julian Seward [Fri, 27 Feb 2015 13:06:43 +0000 (13:06 +0000)] 
Tidy up of CSE.  Create functions irExpr_to_TmpOrConst,
tmpOrConst_to_IRExpr and subst_AvailExpr_TmpOrConst and use them
instead of in-line code.  No functional change.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3095

11 years agofold_Expr: add rules
Julian Seward [Fri, 27 Feb 2015 12:51:22 +0000 (12:51 +0000)] 
fold_Expr: add rules
   Xor8/16/32/64(0,t) ==> t
   Xor8/16/32/64(t,0) ==> t

git-svn-id: svn://svn.valgrind.org/vex/trunk@3094

11 years agoFix memcheck/tests/err_disable4 test on OS X
Rhys Kidd [Fri, 27 Feb 2015 11:34:07 +0000 (11:34 +0000)] 
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

11 years agoSimplify do_brk
Florian Krohm [Thu, 26 Feb 2015 21:48:19 +0000 (21:48 +0000)] 
Simplify do_brk
- remove redundant asserts
- let VG_(am_extend_into_adjacent_reservation_client) worry about
  - whether delta is too large
  - whether the segment abutting this one exists and is a reservation
    segment
  The function already checks these things. No need to do it again here.
- do_brk does not need to know that a reservation segment must not
  shrink beyond a single page. That detail ought to be hidden in
  the address space manager.
Also, turn a few conditions into asserts.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14967

11 years agoInclude pub_core_aspacemgr.h only where needed.
Florian Krohm [Thu, 26 Feb 2015 17:48:07 +0000 (17:48 +0000)] 
Include pub_core_aspacemgr.h only where needed.
Also fixes BZ #344235.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14966

11 years agoChange the prototype of VG_(am_extend_into_adjacent_reservation_client)
Florian Krohm [Thu, 26 Feb 2015 16:07:12 +0000 (16:07 +0000)] 
Change the prototype of VG_(am_extend_into_adjacent_reservation_client)
to match VG_(am_extend_map_client) for consistency.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14965

11 years agoBug #344318 socketcall should wrap recvmmsg and sendmmsg
Mark Wielaard [Wed, 25 Feb 2015 14:00:14 +0000 (14:00 +0000)] 
Bug #344318 socketcall should wrap recvmmsg and sendmmsg

Some architectures, e.g. s390, don't have dedicated recvmmsg and sendmmsg
system calls, but use the socketcall multiplexing system call with
SYS_RECVMMSG or SYS_SENDMMSG (just like the accept4 systemcall can also
be called through socketcall). Create separate helpers for recvmmsg and
sendmmsg helpers that can be used by either the direct syscall or the
socket call.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14964

11 years agoChange VG_(am_extend_map_client) as follows:
Florian Krohm [Wed, 25 Feb 2015 10:06:06 +0000 (10:06 +0000)] 
Change VG_(am_extend_map_client) as follows:
- Tighten up on asserts
- Simplify; as the function grows memory into a free segment, there
  cannot possibly be any translations to be discarded. Free segments
  do not have translations. sane_NSegment will make sure.
- Change the prototype to take in the start address of the mapping and
  return a pointer to the resized segment. Previously, the code

   ok = VG_(am_extend_map_client)( &d, old_seg, needL );
   if (!ok)
      goto eNOMEM;
   VG_TRACK( new_mem_mmap, needA, needL,
                           old_seg->hasR, old_seg->hasW, old_seg->hasX,

  was examining old_seg->hasR etc even though VG_(am_extend_map_client)
  stated that *old_seg was invalid after the function returned.
  That wasn't exactly a problem, but clearly looked wrong.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14963

11 years agoAdd a comment explaining why there are only 3 emulation warnings
Florian Krohm [Tue, 24 Feb 2015 18:11:01 +0000 (18:11 +0000)] 
Add a comment explaining why there are only 3 emulation warnings
and not 4 as one would expect.
Update the .exp file to show correct line numbers.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14962

11 years agoUpdate opcode list following VEX r3092.
Florian Krohm [Tue, 24 Feb 2015 17:17:19 +0000 (17:17 +0000)] 
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

11 years agoarm64: enable test cases for conversion instructions which are
Julian Seward [Tue, 24 Feb 2015 13:24:52 +0000 (13:24 +0000)] 
arm64: enable test cases for conversion instructions which are
in fact implemented at this point.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14960

11 years agoarm64: enable all remaining cases in the
Julian Seward [Tue, 24 Feb 2015 13:23:38 +0000 (13:23 +0000)] 
arm64: enable all remaining cases in the
FCVT{N,P,M,Z,A}{S,U} (scalar, integer) group

git-svn-id: svn://svn.valgrind.org/vex/trunk@3093

11 years agoHandle new IROps added in vex r3092:
Julian Seward [Tue, 24 Feb 2015 12:24:35 +0000 (12:24 +0000)] 
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

11 years agoarm64: enable test cases for
Julian Seward [Tue, 24 Feb 2015 12:21:26 +0000 (12:21 +0000)] 
arm64: enable test cases for
FRECPS  d_d_d, s_s_s
FRSQRTS d_d_d, s_s_s
FRECPE  d_d, s_s
FRSQRTE d_d, s_s
FRECPX  d_d, s_s
FRECPS  2d_2d_2d, 4s_4s_4s, 2s_2s_2s
FRSQRTS 2d_2d_2d, 4s_4s_4s, 2s_2s_2s
FRECPE  2d_2d, 4s_4s, 2s_2s
FRSQRTE 2d_2d, 4s_4s, 2s_2s
 --This line, and those below, will be ignored--

M    none/tests/arm64/fp_and_simd.c
M    none/tests/arm64/fp_and_simd.stdout.exp

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14958

11 years agoarm64: implement:
Julian Seward [Tue, 24 Feb 2015 12:21:01 +0000 (12:21 +0000)] 
arm64: implement:
FRECPS  d_d_d, s_s_s
FRSQRTS d_d_d, s_s_s
FRECPE  d_d, s_s
FRSQRTE d_d, s_s
FRECPX  d_d, s_s
FRECPS  2d_2d_2d, 4s_4s_4s, 2s_2s_2s
FRSQRTS 2d_2d_2d, 4s_4s_4s, 2s_2s_2s
FRECPE  2d_2d, 4s_4s, 2s_2s
FRSQRTE 2d_2d, 4s_4s, 2s_2s

git-svn-id: svn://svn.valgrind.org/vex/trunk@3092

11 years agoFix an off-by-one error - this time, do it right.
Florian Krohm [Tue, 24 Feb 2015 11:23:51 +0000 (11:23 +0000)] 
Fix an off-by-one error - this time, do it right.
A segment with start == end is not empty.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14957

11 years agoRevert r14954. If the end of a segment is 0xfffff.....fffff
Florian Krohm [Mon, 23 Feb 2015 21:56:16 +0000 (21:56 +0000)] 
Revert r14954. If the end of a segment is 0xfffff.....fffff
then end + 1 == 0 and any start address will be >= end.
Think some more.....

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14956

11 years agoFix configure for Linux kernel >= 4.0-rc1
Christian Borntraeger [Mon, 23 Feb 2015 20:19:03 +0000 (20:19 +0000)] 
Fix configure for Linux kernel >= 4.0-rc1
In addition raise the minimal Linux version to 2.6 as there is almost
no test coverage for 2.4 and 2.6 was released in 2003.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14955

11 years agoFix an off-by-one error. A segment with start == end is not
Florian Krohm [Mon, 23 Feb 2015 19:57:12 +0000 (19:57 +0000)] 
Fix an off-by-one error. A segment with start == end is not
empty.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14954

11 years agoStop gcc -Og complaining (incorrectly) about filessize being used
Julian Seward [Mon, 23 Feb 2015 13:58:55 +0000 (13:58 +0000)] 
Stop gcc -Og complaining (incorrectly) about filessize being used
uninitialised.  No functional change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14953

11 years agoFix bz#343523, OS X mach_ports_register: UNKNOWN task message [id 3403, to mach_task_...
Rhys Kidd [Sun, 22 Feb 2015 00:42:52 +0000 (00:42 +0000)] 
Fix bz#343523, OS X mach_ports_register: UNKNOWN task message [id 3403, to mach_task_self(), reply 0x30f]

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14952

11 years agoFix OS X 10.10 (Yosemite) - missing system calls and fcntl code, courtesy of Bill...
Rhys Kidd [Sat, 21 Feb 2015 12:24:18 +0000 (12:24 +0000)] 
Fix OS X 10.10 (Yosemite) - missing system calls and fcntl code, courtesy of Bill Zissimopoulos

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14951

11 years agoUpdate a comment.
Florian Krohm [Fri, 20 Feb 2015 16:46:50 +0000 (16:46 +0000)] 
Update a comment.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14950

11 years agoPass in a mask of segment kinds to VG_(get_segment_starts)
Florian Krohm [Fri, 20 Feb 2015 14:00:23 +0000 (14:00 +0000)] 
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

11 years agocanonicaliseSymtab: fix silly logic that could cause the function to
Julian Seward [Fri, 20 Feb 2015 12:29:59 +0000 (12:29 +0000)] 
canonicaliseSymtab: fix silly logic that could cause the function to
loop forever.  In particular, it will do that when two symbols have
exactly the same address range but differ in their .isText attribute.
Fixes #342117.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14948

11 years agoFix Bug #344314 callgrind_annotate ... commands containing newlines
Josef Weidendorfer [Wed, 18 Feb 2015 16:28:58 +0000 (16:28 +0000)] 
Fix Bug #344314  callgrind_annotate ... commands containing newlines

Escape newlines in command arguments for "cmd:" header field in dumps
We could do unescaping in callgrind_annotate, but a escaped command
even seems better there.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14947

11 years agoCorrectly handle prctl(VKI_PR_SET_PTRACER, ..) so as to avoid false
Julian Seward [Wed, 18 Feb 2015 15:46:19 +0000 (15:46 +0000)] 
Correctly handle prctl(VKI_PR_SET_PTRACER, ..) so as to avoid false
positives (eg when running Wine).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14946

11 years agoMessaging cleanup for the PDB reader. No functional change.
Julian Seward [Wed, 18 Feb 2015 15:38:25 +0000 (15:38 +0000)] 
Messaging cleanup for the PDB reader.  No functional change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14945

11 years agoBug #344307 2 unhandled syscalls on aarch64/arm64: umount2(39), mount (40)
Mark Wielaard [Wed, 18 Feb 2015 14:23:17 +0000 (14:23 +0000)] 
Bug #344307 2 unhandled syscalls on aarch64/arm64: umount2(39), mount (40)

Reporter: Branislav Blaskovic, bblaskov@redhat.com
Patch: Robin Hack, rhack@redhat.com
Test: MiloÅ¡ Prchlík, mprchlik@redhat.com

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14944

11 years agoFor PDB stats printing, don't print the number of inl-info records,
Julian Seward [Wed, 18 Feb 2015 12:58:56 +0000 (12:58 +0000)] 
For PDB stats printing, don't print the number of inl-info records,
since it's always zero.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14943

11 years agoImprove string table reading for MSVC2010 compiled code. Also seems
Julian Seward [Wed, 18 Feb 2015 12:57:06 +0000 (12:57 +0000)] 
Improve string table reading for MSVC2010 compiled code.  Also seems
to help with MSVC2013 compiled code.  Variant of a patch from
Mark Browning (mabrowningrr@gmail.com).  Fixes #211529.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14942

11 years agoUpdate a comment.
Florian Krohm [Tue, 17 Feb 2015 21:51:53 +0000 (21:51 +0000)] 
Update a comment.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14941

11 years agoBug #344295 syscall recvmmsg on arm64 (243) and ppc32/64 (343) unhandled
Mark Wielaard [Tue, 17 Feb 2015 19:50:45 +0000 (19:50 +0000)] 
Bug #344295 syscall recvmmsg on arm64 (243) and ppc32/64 (343) unhandled

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14940

11 years agoBug #344279 syscall sendmmsg on arm64 (269) and ppc32/64 (349) unhandled.
Mark Wielaard [Tue, 17 Feb 2015 16:04:09 +0000 (16:04 +0000)] 
Bug #344279 syscall sendmmsg on arm64 (269) and ppc32/64 (349) unhandled.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14939

11 years agoML_(find_name_of_pdb_file): bit a bit more careful when grepping the
Julian Seward [Tue, 17 Feb 2015 13:46:26 +0000 (13:46 +0000)] 
ML_(find_name_of_pdb_file): bit a bit more careful when grepping the
output from /usr/bin/strings, so as to not get confused by substrings
".pdb" and ".PDB" when they don't appear at the end of a line.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14938

11 years agoUpdate comment for VG_(am_find_nsegment) to match the code.
Florian Krohm [Mon, 16 Feb 2015 23:04:53 +0000 (23:04 +0000)] 
Update comment for VG_(am_find_nsegment) to match the code.
Likewise for VG_(am_next_nsegment). Also make the code similar to
VG_(am_find_nsegment) for easier comprehension.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14937

11 years agoTranslations are allowed from all client segments. Update comments
Florian Krohm [Mon, 16 Feb 2015 22:58:30 +0000 (22:58 +0000)] 
Translations are allowed from all client segments. Update comments
and rename VG_(am_set_segment_hasT_if_SkFileC_or_SkAnonC) to
VG_(am_set_segment_hasT_if_client_segment). Change it so it handles
all client segments.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14936

11 years agoUpdate a few comments.
Florian Krohm [Mon, 16 Feb 2015 22:29:03 +0000 (22:29 +0000)] 
Update a few comments.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14935

11 years agoDocument the --max-threads command line option.
Florian Krohm [Mon, 16 Feb 2015 21:55:52 +0000 (21:55 +0000)] 
Document the --max-threads command line option.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14934

11 years agoMisc tweaks in segAddr_to_index:
Florian Krohm [Sat, 14 Feb 2015 21:17:46 +0000 (21:17 +0000)] 
Misc tweaks in segAddr_to_index:
(1) It is always invalid for the incoming segment pointer to be
    out of range. Assert that.
(2) Let the compiler do the address arithmetic. They're good at that
    and therefore:
(3) No asserts needed to check the result.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14933

11 years agoAdd command line flag --max-threads=<integer> to increase the number of
Florian Krohm [Fri, 13 Feb 2015 19:08:26 +0000 (19:08 +0000)] 
Add command line flag --max-threads=<integer> to increase the number of
threads that valgrind can handle. No recompile is needed.
Part of fixing BZ #337869.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14932

11 years agoMore use of LibVEX_GUEST_STATE_ALIGN.
Florian Krohm [Fri, 13 Feb 2015 17:05:57 +0000 (17:05 +0000)] 
More use of LibVEX_GUEST_STATE_ALIGN.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14931

11 years agoUse LibVEX_GUEST_STATE_ALIGN introduced in VEX r3091.
Florian Krohm [Fri, 13 Feb 2015 16:26:44 +0000 (16:26 +0000)] 
Use LibVEX_GUEST_STATE_ALIGN introduced in VEX r3091.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14930

11 years agoAdd symbolic constant LibVEX_GUEST_STATE_ALIGN.
Florian Krohm [Fri, 13 Feb 2015 16:25:41 +0000 (16:25 +0000)] 
Add symbolic constant LibVEX_GUEST_STATE_ALIGN.
Use it.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3091

11 years agoarm32-linux: for the magic-call CALL_FN_* macros, add r12 to the asm
Julian Seward [Wed, 11 Feb 2015 19:46:27 +0000 (19:46 +0000)] 
arm32-linux: for the magic-call CALL_FN_* macros, add r12 to the asm
trash list.  Not doing so was causing r12 to get corrupted by the
called function, which lead to some very strange failures in Helgrind
on arm32.  Fixes #344033.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14929

11 years agoarm32-linux: GET_STARTREGS has always been wrong on this target,
Julian Seward [Wed, 11 Feb 2015 00:49:45 +0000 (00:49 +0000)] 
arm32-linux: GET_STARTREGS has always been wrong on this target,
confusing SP and LR and resulting in no backtraces during internal
assertion failures etc on this platform.  Fixes #343219.  Noticed by
dimitry@google.com.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14928

11 years agoarm32: local_sys_write_stderr and local_sys_getpid: don't trash r7
Julian Seward [Wed, 11 Feb 2015 00:41:48 +0000 (00:41 +0000)] 
arm32: local_sys_write_stderr and local_sys_getpid: don't trash r7
in the inline assembly, because gcc doesn't like that when compiling
for Thumb.  And this file is compiled for Thumb during "make check".

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14927

11 years agoBug #344007 accept4 syscall unhandled on arm64 (242) and ppc64 (344)
Mark Wielaard [Tue, 10 Feb 2015 13:39:04 +0000 (13:39 +0000)] 
Bug #344007 accept4 syscall unhandled on arm64 (242) and ppc64 (344)

ppc64 might fall back to socketcall in some cases, but arm64 always uses
accept4 syscall directly. Some (confusing) background on when/how glibc
(wrongly) decides to use a direct accept4 or the socketcall system call:
https://sourceware.org/ml/libc-alpha/2013-12/msg00014.html

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14926

11 years agoRemove an unused macro (which also had undefined behaviours).
Florian Krohm [Mon, 9 Feb 2015 23:21:07 +0000 (23:21 +0000)] 
Remove an unused macro (which also had undefined behaviours).

git-svn-id: svn://svn.valgrind.org/vex/trunk@3090

11 years agoFix a bug introduced in r14913.
Florian Krohm [Mon, 9 Feb 2015 21:59:00 +0000 (21:59 +0000)] 
Fix a bug introduced in r14913.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14925

11 years agoEnsure vgdb gets the nr of threads from Valgrind via shared memory,
Philippe Waroquiers [Mon, 9 Feb 2015 21:30:58 +0000 (21:30 +0000)] 
Ensure vgdb gets the nr of threads from Valgrind via shared memory,
rather than using a compile time constant.
This is in preparation for a future change by Florian, to have
the max nr of threads specifiable at startup via a clo

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14924

11 years agoBug #343978 Recognize DWARF5/GCC5 DW_LANG_Fortran 2003 and 2008 constants.
Mark Wielaard [Mon, 9 Feb 2015 20:41:48 +0000 (20:41 +0000)] 
Bug #343978 Recognize DWARF5/GCC5 DW_LANG_Fortran 2003 and 2008 constants.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14923

11 years agoBug #343967 Don't warn about setuid/setgid/setcap exec for dirs.
Mark Wielaard [Mon, 9 Feb 2015 13:27:07 +0000 (13:27 +0000)] 
Bug #343967 Don't warn about setuid/setgid/setcap exec for dirs.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14922

11 years agoUpdate.
Julian Seward [Mon, 9 Feb 2015 09:15:00 +0000 (09:15 +0000)] 
Update.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14921

11 years agoEnable test cases for
Julian Seward [Mon, 9 Feb 2015 09:10:27 +0000 (09:10 +0000)] 
Enable test cases for
  FMOV (vector, immediate, single precision)
  {FRINTN,FRINTM,FRINTP,FRINTZ,FRINTA,FRINTX,FRINTI} 2d_2d, 4s_4s, 2s_2s
  {FRINTN,FRINTM,FRINTP,FRINTZ,FRINTA,FRINTX,FRINTI} d_d, s_s

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14920

11 years agoImplement FP instructions:
Julian Seward [Mon, 9 Feb 2015 09:07:47 +0000 (09:07 +0000)] 
Implement FP instructions:
  FMOV (vector, immediate, single precision)
  FRINTN 2d_2d, 4s_4s, 2s_2s
  FRINTM 2d_2d, 4s_4s, 2s_2s
  FRINTP 2d_2d, 4s_4s, 2s_2s
  FRINTZ 2d_2d, 4s_4s, 2s_2s
  FRINTA 2d_2d, 4s_4s, 2s_2s
  FRINTX 2d_2d, 4s_4s, 2s_2s
  FRINTI 2d_2d, 4s_4s, 2s_2s
  FRINTN d_d, s_s

git-svn-id: svn://svn.valgrind.org/vex/trunk@3089

11 years agoEnable test cases for all remaining FP multiply instructions:
Julian Seward [Sun, 8 Feb 2015 18:26:05 +0000 (18:26 +0000)] 
Enable test cases for all remaining FP multiply instructions:
  FMULX d_d_d, s_s_s
  FMLA d_d_d[], s_s_s[]
  FMLS d_d_d[], s_s_s[]
  FMUL  d_d_d[], s_s_s[]
  FMULX d_d_d[], s_s_s[]
  FMULX 2d_2d_2d, 4s_4s_4s, 2s_2s_2s
  FMULX 2d_2d_d[], 4s_4s_s[], 2s_2s_s[]
and possibly more.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14919

11 years agoImplement all remaining FP multiple style instructions:
Julian Seward [Sun, 8 Feb 2015 18:24:38 +0000 (18:24 +0000)] 
Implement all remaining FP multiple style instructions:
  FMULX d_d_d, s_s_s
  FMLA d_d_d[], s_s_s[]
  FMLS d_d_d[], s_s_s[]
  FMUL  d_d_d[], s_s_s[]
  FMULX d_d_d[], s_s_s[]
  FMULX 2d_2d_2d, 4s_4s_4s, 2s_2s_2s
  FMULX 2d_2d_d[], 4s_4s_s[], 2s_2s_s[]
The FMULX variants are currently handed the same as FMUL.  This is a
kludge that will have to be fixed at some point.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3088

11 years agoEnable test cases:
Julian Seward [Sun, 8 Feb 2015 12:11:52 +0000 (12:11 +0000)] 
Enable test cases:
  {FMADD,FNMADD,FMSUB,FNMSUB} d_d_d_d, s_s_s_s
  {FMAXMNV,FMINMNV,FMAXV,FMINV} s_4s
  {FMAXNMP,FMINNMP,FMAXP,FMINP} d_2d, s_2s
  {FMAXNM,FMINNM,FMAX,FMIN} 2d_2d_2d, 4s_4s_4s, 2s_2s_2s
  {FMAXNMP,FMINNMP,FMAXP,FMINP} 2d_2d_2d, 4s_4s_4s, 2s_2s_2s

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14918

11 years agoImplement all remaining FP min/max style instructions:
Julian Seward [Sun, 8 Feb 2015 12:08:56 +0000 (12:08 +0000)] 
Implement all remaining FP min/max style instructions:
  {FMAXMNV,FMINMNV,FMAXV,FMINV} s_4s
  {FMAXNMP,FMINNMP,FMAXP,FMINP} d_2d, s_2s
  {FMAXNM,FMINNM,FMAX,FMIN} 2d_2d_2d, 4s_4s_4s, 2s_2s_2s
  {FMAXNMP,FMINNMP,FMAXP,FMINP} 2d_2d_2d, 4s_4s_4s, 2s_2s_2s

git-svn-id: svn://svn.valgrind.org/vex/trunk@3087

11 years agoBug 343733 Unhandled syscall 187 (msgctl and related) on aarch64
Mark Wielaard [Sat, 7 Feb 2015 22:58:51 +0000 (22:58 +0000)] 
Bug 343733 Unhandled syscall 187 (msgctl and related) on aarch64

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14917

11 years agoBug 343732 - Unhandled syscall 144 (setgid) on aarch64.
Mark Wielaard [Sat, 7 Feb 2015 22:36:48 +0000 (22:36 +0000)] 
Bug 343732 - Unhandled syscall 144 (setgid) on aarch64.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14916

11 years agoEnable test cases for all FP compare instructions:
Julian Seward [Sat, 7 Feb 2015 21:12:04 +0000 (21:12 +0000)] 
Enable test cases for all FP compare instructions:
{FCMEQ,FCMGE,FCMGT,FACGE,FACGT} d_d_d, s_s_s
{FCMEQ,FCMGE,FCMGT,FACGE,FACGT} d_d_#0.0, s_s_#0.0
{FCMEQ,FCMGE,FCMGT,FACGE,FACGT} 2d_2d_#0.0, 4s_4s_#0.0, 2s_2s_#0.0
{FCCMP,FCCMPE} s_s, d_d
{FCMP,FCMPE} d_d, s_s
{FCMP,FCMPE} d_#0.0, s_#0.0

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14915

11 years agoImplement all remaining FP compare instructions:
Julian Seward [Sat, 7 Feb 2015 21:09:47 +0000 (21:09 +0000)] 
Implement all remaining FP compare instructions:
{FCMEQ,FCMGE,FCMGT,FACGE,FACGT} d_d_d, s_s_s
{FCMEQ,FCMGE,FCMGT,FACGE,FACGT} d_d_#0.0, s_s_#0.0
{FCMEQ,FCMGE,FCMGT,FACGE,FACGT} 2d_2d_#0.0, 4s_4s_#0.0, 2s_2s_#0.0
{FCCMP,FCCMPE} s_s, d_d

git-svn-id: svn://svn.valgrind.org/vex/trunk@3086

11 years agoRevert accidental checkin for Makefile.am
Florian Krohm [Fri, 6 Feb 2015 20:33:51 +0000 (20:33 +0000)] 
Revert accidental checkin for Makefile.am

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14914

11 years agoFix undefined behaviours when shifting.
Florian Krohm [Fri, 6 Feb 2015 20:32:15 +0000 (20:32 +0000)] 
Fix undefined behaviours when shifting.
Found by libubsan.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14913

11 years agoThere must be at least one element in a VLA.
Florian Krohm [Fri, 6 Feb 2015 20:25:57 +0000 (20:25 +0000)] 
There must be at least one element in a VLA.
Found by libubsan.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14912

11 years agoFix debug output of aspacemgr
Philippe Waroquiers [Thu, 5 Feb 2015 22:30:57 +0000 (22:30 +0000)] 
Fix debug output of aspacemgr
The list of segnames was shown with a seq nr,
while each segment was referencing its segname with an offset.
The patch ensures that at all places, both the seq nr and the
offset is output

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14911

11 years agoUpdate.
Julian Seward [Thu, 5 Feb 2015 16:22:43 +0000 (16:22 +0000)] 
Update.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14910

11 years agoUpdate to track v4l2 API for kernel version 3.19 changes. Patch from
Julian Seward [Thu, 5 Feb 2015 15:59:01 +0000 (15:59 +0000)] 
Update to track v4l2 API for kernel version 3.19 changes.  Patch from
Hans Verkuil (hverkuil@xs4all.nl).  Fixes #343069.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14909

11 years agoAdd wrapper support for I2C_SMBUS ioctls. Patch from
Julian Seward [Thu, 5 Feb 2015 15:52:46 +0000 (15:52 +0000)] 
Add wrapper support for I2C_SMBUS ioctls.  Patch from
super.firetwister@gmail.com.  Fixes #342603.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14908

11 years agoEnable sys_mbind, sys_get_mempolicy, sys_set_mempolicy on arm64-linux.
Julian Seward [Thu, 5 Feb 2015 15:28:28 +0000 (15:28 +0000)] 
Enable sys_mbind, sys_get_mempolicy, sys_set_mempolicy on arm64-linux.
Patch from Hideaki Kimura (hideaki.kimura@gmail.com).  Fixes #342038.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14907

11 years agoEnable FCVTMU Xd,Sn. Fixes #343332.
Julian Seward [Thu, 5 Feb 2015 15:22:30 +0000 (15:22 +0000)] 
Enable FCVTMU Xd,Sn.  Fixes #343332.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3085

11 years agoAllow the user to specify precise-exception behaviour for translations
Julian Seward [Thu, 5 Feb 2015 12:59:46 +0000 (12:59 +0000)] 
Allow the user to specify precise-exception behaviour for translations
made from file-backed mappings (AOT code, basically) that is different
from the default behaviour as specified by --vex-iropt-register-updates.

New flag is --px-file-backed=, with the same possible args as
--vex-iropt-register-updates has.

Add a new flag --px-default, which is a short alias for
--vex-iropt-register-updates.

Add one line of stats output when --stats=yes, showing counts of how
many translations have been made under each of the 4 different PX
optimisation settings.

No user-visible change if you don't use the new flags.

Relies on VEX API change in r3084.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14906

11 years agoMake a very minor change to the LibVEX_Translate interface (sub-arg of
Julian Seward [Thu, 5 Feb 2015 12:53:20 +0000 (12:53 +0000)] 
Make a very minor change to the LibVEX_Translate interface (sub-arg of
needs_self_check) which allows VEX's user to selectively override, on
a per-translation basis, the default precise-exception control setting
that is specified in VexControl::iropt_register_updates.  Fix up
plumbing inside iropt so as to used passed-in values rather than the
default one.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3084

11 years agovalgrind part to VEX:3083 Fix bugzilla 343802, also extend testcase
Christian Borntraeger [Thu, 5 Feb 2015 11:05:53 +0000 (11:05 +0000)] 
valgrind part to VEX:3083 Fix bugzilla 343802, also extend testcase

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14905

11 years agoFix bug 343802. We need to handle one more special case in the spechelper
Christian Borntraeger [Thu, 5 Feb 2015 11:05:10 +0000 (11:05 +0000)] 
Fix bug 343802. We need to handle one more special case in the spechelper

git-svn-id: svn://svn.valgrind.org/vex/trunk@3083

11 years agoFix some inconsistent uses of the VG_XACT_CLO macro, by putting an
Julian Seward [Thu, 5 Feb 2015 10:05:43 +0000 (10:05 +0000)] 
Fix some inconsistent uses of the VG_XACT_CLO macro, by putting an
empty then-body after the condition rather than merely ";", which is
confusing and is inconsistent with the rest of the arg handling code.
No functional change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14904

11 years agoguest_amd64_spechelper:
Julian Seward [Wed, 4 Feb 2015 19:05:13 +0000 (19:05 +0000)] 
guest_amd64_spechelper:
* add spec rules for B and NB after SUBB
* number (in comments) some existing cases.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3082

11 years agoFollowup to r14901 (vectorising memcmp): use SizeT instead of Addr
Julian Seward [Wed, 4 Feb 2015 18:46:11 +0000 (18:46 +0000)] 
Followup to r14901 (vectorising memcmp): use SizeT instead of Addr
where appropriate.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14903

11 years agoRemove unneeded code.
Florian Krohm [Wed, 4 Feb 2015 18:01:19 +0000 (18:01 +0000)] 
Remove unneeded code.
VG_(extend_stack) checks whether the given address is covered by the
stack.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14902

11 years agoVectorise the memcmp template implementation. For scenarios requiring
Julian Seward [Wed, 4 Feb 2015 17:52:42 +0000 (17:52 +0000)] 
Vectorise the memcmp template implementation.  For scenarios requiring
a lot of memcmp-ing (firefox reftests) this is measurably faster.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14901

11 years agodis_VMASKMOV: create per-lane transfer/no-transfer guard expressions
Julian Seward [Tue, 3 Feb 2015 18:01:41 +0000 (18:01 +0000)] 
dis_VMASKMOV: create per-lane transfer/no-transfer guard expressions
that are more Memcheck-friendly.  No functional change.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3081

11 years agoUpdate list of open bugs, and classify them by area.
Julian Seward [Tue, 3 Feb 2015 12:27:30 +0000 (12:27 +0000)] 
Update list of open bugs, and classify them by area.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14900

11 years agoPTRACE_GETREGS might not be detected on some distro, due to a missing #include
Philippe Waroquiers [Mon, 2 Feb 2015 22:40:54 +0000 (22:40 +0000)] 
PTRACE_GETREGS might not be detected on some distro, due to a missing #include
in the configure test.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14899

11 years agoReplace the SegName array with a simple string table.
Florian Krohm [Sat, 31 Jan 2015 00:29:50 +0000 (00:29 +0000)] 
Replace the SegName array with a simple string table.
The validity of this change follows from the following observations:

(1) There is a single source for allocating and storing segment names,
    namely allocate_segname.
(2) For all invocations of allocate_segname the returned value (which
    represents the segmant name) is assigned to NSegment::fnIdx.
(3) All but one assignments to NSegment::fnIdx assign allocate_segname.
    The single exception assigns -1 in init_nsegment. That function is
    called whenever a new segment (named or unnamed) is allocated.

For a segment name to become unused there must be an assignment to
NSegment::fnIdx which was previously assigned a return value from
allocate_segname. There is no such assignment.
It follows that all segment names are in use at all times, hence
SegName::inUse == True for all SegNames. So we can constant fold it
and don't need to represent it.
Pass 3 in preen_nsegments is obsolete as there are no segment names to
garbage collect.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14898

11 years agoRemove confusing function attribute. The function is always used (on all platforms).
Florian Krohm [Fri, 30 Jan 2015 22:21:16 +0000 (22:21 +0000)] 
Remove confusing function attribute. The function is always used (on all platforms).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14897

11 years agoFix an incorrect comment. Add asserts.
Florian Krohm [Thu, 29 Jan 2015 23:01:14 +0000 (23:01 +0000)] 
Fix an incorrect comment. Add asserts.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14896

11 years agoFix hwcaps validity checking for x86.
Florian Krohm [Thu, 29 Jan 2015 15:21:47 +0000 (15:21 +0000)] 
Fix hwcaps validity checking for x86.
Capabilities  x86-mmxext-sse1-sse2-sse3-lzcnt were rejected as invalid.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3080