16143 Commits

Author SHA1 Message Date
Philippe Waroquiers
66b5a4e9c4 Fix 399301 - Use inlined frames in Massif XTree output.
Author: Nicholas Nethercote <nnethercote@mozilla.com>

Use inlined frames in Massif XTree output.

    This makes Massif's output much easier to follow.

    The commit also removes a -1 used on all Massif stack frame addresses.
    There was a big comment questioning the presence of that -1, and with it
    gone the addresses now match those produced by DHAT.
2018-10-27 20:28:59 +02:00
Philippe Waroquiers
d00dd9c2dd Update configure.ac to next version 3.15.GIT ...
As pointed out by Rhys, we need a .GIT postfix waiting
for the release ...
2018-10-20 16:54:19 +02:00
Philippe Waroquiers
e8eda462e9 Update configure.ac to next version 3.15 ... 2018-10-20 11:44:00 +02:00
Philippe Waroquiers
4c80082c36 Prepare for the next 3.15 release
* Create the 3.15 section in the NEWS file
  (the idea is that this section is maintained during the development,
   i.e. document user visible changes and/or the fixed bugs, as part of
   the commit).

* start the fixed bug list with 399322  Improve callgrind_annotate output

* update vg-entities.xml for 3.15 next release.
2018-10-20 11:37:26 +02:00
Nicholas Nethercote
8b689c66d9 Implement VG_(apply_ExeContext)().
It's been declared for a long time, but was lacking a definition.
2018-10-19 16:30:42 +11:00
Nicholas Nethercote
331949c1c5 Improve callgrind_annotate output.
This commit makes two changes:

- it adds commas to call counts (e.g. `65658x` becomes `65,658x`);

- it sorts callers/callees in the tree by the --sort order.

An example, old output:
```
72,142,945  < /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:_dl_lookup_symbol_x (65658x)
68,977,760  *  /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:do_lookup_x
       340  >   /build/glibc-OTsEL5/glibc-2.27/malloc/malloc.c:free (3x)
     4,564  >   /build/glibc-OTsEL5/glibc-2.27/nptl/pthread_mutex_unlock.c:pthread_mutex_unlock (163x)
 1,282,381  >   /build/glibc-OTsEL5/glibc-2.27/string/../sysdeps/x86_64/strcmp.S:strcmp (12893x)
    13,310  >   /build/glibc-OTsEL5/glibc-2.27/malloc/malloc.c:calloc (4x)
       223  >   /build/glibc-OTsEL5/glibc-2.27/elf/dl-misc.c:_dl_higher_prime_number (3x)
 1,741,689  >   /build/glibc-OTsEL5/glibc-2.27/elf/dl-misc.c:_dl_name_match_p (16842x)
     5,705  >   /build/glibc-OTsEL5/glibc-2.27/nptl/../nptl/pthread_mutex_lock.c:pthread_mutex_lock (163x)

    51,454  < /build/glibc-OTsEL5/glibc-2.27/elf/../elf/dl-runtime.c:_dl_fixup (33x)
     2,456  < /build/glibc-OTsEL5/glibc-2.27/elf/dl-sym.c:_dl_sym (2x)
100,313,502  < /build/glibc-OTsEL5/glibc-2.27/elf/../sysdeps/x86_64/dl-machine.h:_dl_relocate_object (39094x)
28,224,467  *  /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:_dl_lookup_symbol_x
72,142,945  >   /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:do_lookup_x (65658x)

[...]

  567        setLastUser(LastPMUses, P->getResolver()->getPMDataManager().getAsPass());
   18  => /home/njn/moz/rust0/src/llvm/include/llvm/IR/LegacyPassManagers.h:non-virtual thunk to llvm::FPPassManager::getAsPass() (9x)
1,971  => /home/njn/moz/rust0/src/llvm/lib/IR/LegacyPassManager.cpp:llvm::PMTopLevelManager::setLastUser(llvm::ArrayRef<llvm::Pass*>, llvm::Pass*)'2 (63x)
  108  => ???:non-virtual thunk to (anonymous namespace)::MPPassManager::getAsPass() (54x)
```

New output:
```
72,142,945  < /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:_dl_lookup_symbol_x (65,658x)
68,977,760  *  /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:do_lookup_x
 1,741,689  >   /build/glibc-OTsEL5/glibc-2.27/elf/dl-misc.c:_dl_name_match_p (16,842x)
 1,282,381  >   /build/glibc-OTsEL5/glibc-2.27/string/../sysdeps/x86_64/strcmp.S:strcmp (12,893x)
    13,310  >   /build/glibc-OTsEL5/glibc-2.27/malloc/malloc.c:calloc (4x)
     5,705  >   /build/glibc-OTsEL5/glibc-2.27/nptl/../nptl/pthread_mutex_lock.c:pthread_mutex_lock (163x)
     4,564  >   /build/glibc-OTsEL5/glibc-2.27/nptl/pthread_mutex_unlock.c:pthread_mutex_unlock (163x)
       340  >   /build/glibc-OTsEL5/glibc-2.27/malloc/malloc.c:free (3x)
       223  >   /build/glibc-OTsEL5/glibc-2.27/elf/dl-misc.c:_dl_higher_prime_number (3x)

100,313,502  < /build/glibc-OTsEL5/glibc-2.27/elf/../sysdeps/x86_64/dl-machine.h:_dl_relocate_object (39,094x)
    51,454  < /build/glibc-OTsEL5/glibc-2.27/elf/../elf/dl-runtime.c:_dl_fixup (33x)
     2,456  < /build/glibc-OTsEL5/glibc-2.27/elf/dl-sym.c:_dl_sym (2x)
28,224,467  *  /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:_dl_lookup_symbol_x
72,142,945  >   /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:do_lookup_x (65,658x)

[...]

  567        setLastUser(LastPMUses, P->getResolver()->getPMDataManager().getAsPass());
1,971  => /home/njn/moz/rust0/src/llvm/lib/IR/LegacyPassManager.cpp:llvm::PMTopLevelManager::setLastUser(llvm::ArrayRef<llvm::Pass*>, llvm::Pass*)'2 (63x)
  108  => ???:non-virtual thunk to (anonymous namespace)::MPPassManager::getAsPass() (54x)
   18  => /home/njn/moz/rust0/src/llvm/include/llvm/IR/LegacyPassManagers.h:non-virtual thunk to llvm::FPPassManager::getAsPass() (9x)
```
2018-10-12 21:35:53 +11:00
Andreas Arnez
ca2f73592e Bug 399444 s390x: Drop unnecessary check in s390_irgen_VSLDB
In s390_irgen_VSLDB there was special handling for the case that the
immediate operand i4 has the value 16, which would mean that the result v1
were a full copy of the third operand v3.  However, this is impossible
because i4 can only assume values from 0 to 15; thus the special handling
can be removed.
2018-10-10 14:19:36 +02:00
Julian Seward
3a3000290b --> 3.14.0 final 2018-10-09 13:52:05 +02:00
Rhys Kidd
353a3587bb Fix macOS 10.13 building from tarball
Fixes: 1ce04c3 ("Preliminary support for Darwin 17.x (macOS 10.13)")
2018-10-07 21:26:35 -04:00
Julian Seward
d2af42d826 --> 3.14.0.RC2 2018-10-03 15:37:06 +02:00
Julian Seward
3e214c4858 sigframe construction for x86-linux: ensure that ESP is correctly aligned before entering the handler. n-i-bz.
Without this, a signal handler compiled by Clang 6, which uses movdqa to load/store
relative to ESP, segfaults because the resulting address isn't 16-aligned.
2018-10-03 15:29:42 +02:00
Julian Seward
617e673e9b x86 front end: handle UD2 as an officially recognised, unimplemented instruction, like the amd64 front end does. n-i-bz.
This doesn't change anything downstream -- a SIGILL is still raised -- but
there's a bit less debug printing now.
2018-10-03 15:26:48 +02:00
Julian Seward
7669f536ee --> 3.14.0.RC1 2018-09-30 10:21:27 +02:00
Julian Seward
c2aeea2d28 Memcheck on amd64; fix false positive associated with spec cases {Z,NZ} after {LOGICB,LOGICW}. n-i-bz.
For the spec cases {Z,NZ} after {LOGICB,LOGICW}, which are simply comparisons
of the result against zero, use Cmp{EQ,NE}32 rather than their 64-bit
counterparts.  This is because Memcheck on amd64 instruments the 32 bit
versions exactly, at the default --expensive-definedness-checks=auto setting.
The alternative would have been to make Memcheck also do exact instrumentation
of the 64 bit versions, but that would also burden all other 64 bit eq/ne
comparisons with that cost for no purpose.  So this is a cheaper solution.
2018-09-30 09:29:43 +02:00
Mark Wielaard
28b6496ee4 Fix s390x_dirtyhelper_vec_op signature for non-s390x case.
The definition of s390x_dirtyhelper_vec_op in guest_s390_helpers.c
didn't match the one from guest_s390_defs.h for the non-s390x case.
Causing a compiler warning/error.
2018-09-27 05:10:07 +02:00
Andreas Arnez
0a1d523a87 s390x: Vector integer and string insn support -- tests
This adds test cases and some internal stuff to the z/Architecture vector
integer and string instruction support.

Contributed by Vadim Barkov <vbrkov@gmail.com>.
2018-09-26 19:31:02 +02:00
Andreas Arnez
1cc1d564f4 s390x: Vector integer and string instruction support
This adds z/Architecture vector integer and string instruction support.

The main author of this patch is Vadim Barkov <vbrkov@gmail.com>.  Some
fixes were provided by Andreas Arnez <arnez@linux.ibm.com>.
2018-09-26 19:30:56 +02:00
Philippe Waroquiers
9dd4af5c78 Fix 398028 Assertion cfsi_fits failing in simple C program
At least with libopenblas, we can have several rx mappings
with some holes between mappings.
Change the invariant (2) checking so that such holes are ok,
as long as no cfsi refers to such an hole.
2018-09-26 18:04:43 +02:00
Andreas Arnez
f31fb32455 Update bug status for s390x conditional trap insn support
This updates the bug status for git commit 20976f432, "s390x: Implement
conditional trap instructions".
2018-09-24 18:09:51 +02:00
Andreas Arnez
20976f432d s390x: Implement conditional trap instructions
This implements various z/Architecture instructions that conditionally
yield a data exception ("trap").  The condition is either based on a
comparison being true ("compare and trap") or on a loaded value being
zero ("load and trap").  These instructions haven't been widely used in
the past, but may now be emitted by newer compilers.  Note that the
resulting signal for a data exception is SIGFPE, not SIGTRAP.  Thus this
patch also adds a new jump kind Ijk_SigFPE.
2018-09-24 16:06:19 +02:00
Mark Wielaard
fdc275808c Hook up statx syscall for s390x-linux
Fixes memcheck/tests/linux/sys-statx.vgtest on s390x-linux.
2018-09-22 11:08:12 +02:00
Mark Wielaard
4692f675b2 Hook up linux membarrier syscall for s390x-linux
Fixes none/tests/linux/membarrier on s390x-linux.
2018-09-22 11:02:08 +02:00
Mark Wielaard
8e891c5ad8 Fix arm64-linux/scalar clone test argument check order.
When the clone syscall was refactored to work across all linux arches
the arguments were checked in a different order. Fix the arm64-linux
scalar.stderr.exp to match the same order for the (invalid) clone
arguments.

This makes memcheck/tests/arm64-linux/scalar.vgtest pass again.
2018-09-19 21:27:02 +02:00
Mark Wielaard
6ee4d476c6 Run power_ISA2_0[57] tests with -q
memcheck/tests/ppc64/power_ISA2_0[57] could spuriously fail when
some internal glibc function would allocate and free some memory.
To get the expected output run the tests with -q and clear stderr.exp.
2018-09-18 22:55:57 +02:00
Mark Wielaard
dee4914e6f Hook up linux membarrier syscall for x86-linux
Fixes none/tests/linux/membarrier on x86-linux.
2018-09-18 21:55:45 +02:00
Mark Wielaard
fbefb81c3c Hook up linux membarrier syscall for ppc64[le]
Fixes none/tests/linux/membarrier on ppc64[le] platforms.
2018-09-18 18:22:41 +02:00
Julian Seward
66a462415e Update. 2018-09-18 09:58:11 +02:00
Julian Seward
43115c8058 Bug 395991 - wine's unit tests enter a signal delivery loop under valgrind on armv7l when SIGSEGV is used.
On signal handler return, restore r0 .. r15 inclusive from the sigcontext that we
gave to the handler, so that any changes the handler has made to those values
will take effect on return.
2018-09-18 09:53:38 +02:00
Julian Seward
3c89fada21 A bit of whitespace and guard changes relating to VGABI_N32. No functional change. n-i-bz.
* coregrind/m_redir.c: whitespace changes only

* memcheck/mc_main.c:
  - change 6 guards of the form "defined (VGABI_N32)" to
    "defined(VGA_mips64) && defined(VGABI_N32)"
  - Fix up poor indentation
2018-09-18 09:24:01 +02:00
Philippe Waroquiers
97365bada6 Do not mention VALGRIND_DISABLE_ADDR_ERROR_REPORTING_IN_RANGE to bypass shared memory definedness false positive
as when the error is reported (e.g. conditional jump), it is not
known anymore that this originates from which memory range.
2018-09-15 18:00:57 +02:00
Philippe Waroquiers
20fe40ecc0 Update filter_gdb to make nlvgdbsigqueue work with gdb 8.2
gdb 8.2 now produces a message 'remote target killed',
so have filter_gdb delete it.

Tested on debian/amd64 with gdb 7.12/8.0/8.1/8.2
2018-09-15 11:26:52 +02:00
Philippe Waroquiers
a1ce55b1b9 Update filter_gdb to make nlcontrolc work with gdb 8.2
gdb 8.2 has changed the layout of the thread list headers.

Tested on debian/amd64 with gdb 7.12/8.0/8.1/8.2
2018-09-15 11:06:07 +02:00
Philippe Waroquiers
e7f3450869 Update test to make it work with gdb 8.2
Tested on debian/amd64 with gdb 7.12/8.0/8.1/8.2
2018-09-15 10:58:07 +02:00
Mark Wielaard
4f5e6168e7 Add noinst_HEADERS = vector.h to none/tests/s390x/Makefile.am.
The vector.h file should end up in the dist tar.
2018-09-15 00:00:20 +02:00
Mark Wielaard
5d41dadeb3 Update vg-entities.xml and valgrind.h for next version number. 2018-09-14 23:12:45 +02:00
Mark Wielaard
1ca0fe21ab Include suppsrc_lineno.supp and suppsrc_sanlineno.supp in EXTRA_DIST.
These are test file that are needed in the dist tar.
2018-09-14 22:56:13 +02:00
Julian Seward
36ca427809 Update somewhat more for 3.14 final. 2018-09-14 13:48:54 +02:00
Julian Seward
529436ff59 Bug 397089 - (TESTCASES FOR) Incorrect decoding of three-register vmovss/vmovsd opcode 11h.
Adds test cases, that check both the 10h and 11h decodings.  For some reason
the expected output diff is huge.  I don't know why.  It is the same as what
the hardware produces, though.
2018-09-14 13:23:19 +02:00
Julian Seward
27194eb985 Bug 397089 - Incorrect decoding of three-register vmovss/vmovsd opcode 11h.
This fixes the incorrect 11h decoding of three-register vmovss/vmovsd.
Patch from Tomas Trnka (tomastrnka@gmx.com).
2018-09-14 13:19:34 +02:00
Philippe Waroquiers
ee5464ce31 Improve doc to describe limitations discussed in 398445 (false positive on shared memory) 2018-09-13 21:13:51 +02:00
Philippe Waroquiers
c007cf5db9 Mention --keep-debuginfo=yes in the FAQ for unloaded shared objects. 2018-09-13 21:12:56 +02:00
Petar Jovanovic
097b207601 Update NEWS with bug fix for KDE #373069
KDE #373069 memcheck/tests/leak_cpp_interior fails with GCC 5.1+
was (partially) fixed in r16217.
2018-09-10 10:12:57 +00:00
Petar Jovanovic
a914015f7b Update NEWS with bug fix for KDE #396906
Fixed in the previous commit.
2018-09-04 21:23:03 +00:00
Petar Jovanovic
b99acd0ad8 mips32: fix broken inline asm in helgrind/tests/tc08_hbl2.c
Remove the duplicated L1xyzzy1main, and use local symbol to replace.

This fixes KDE #396906.

Patch by Hongxu Jia <hongxu.jia@windriver.com>
2018-09-04 21:20:39 +00:00
Julian Seward
b2cb69bb73 Complete first-pass triage of all reported bugs. 2018-09-04 10:07:58 +02:00
Julian Seward
a8ebc1bb06 Almost catch up with first-pass triaging of bugs. 2018-09-03 20:27:26 +02:00
Mark Wielaard
51736549e3 Bug 398066 s390x: cgijl dep1, 0 reports false uninitialised values warning.
This is similar to bug #387712 (about cgijnl), but a newer gcc uses cgijl
now. So use a similar fix when cc_dep2 is zero, only check whether the
most significant bit of cc_dep1 is set to 1.
2018-09-03 13:02:22 +02:00
Mark Wielaard
790f5f3018 Bug 397354 utimensat should ignore tv_sec if tv_nsec is UTIME_NOW/OMIT.
When code uses utimensat with UTIME_NOW or UTIME_OMIT valgrind memcheck
would generate a warning. But as the utimensat manpage says:

  If the tv_nsec field of one of the timespec structures has the  special
  value  UTIME_NOW,  then  the corresponding file timestamp is set to the
  current time.  If the tv_nsec field of one of the  timespec  structures
  has the special value UTIME_OMIT, then the corresponding file timestamp
  is left unchanged.  In both of these cases, the  value  of  the  corre‐
  sponding tv_sec field is ignored.

So ignore the timespec tv_sec when tv_nsec is set to UTIME_NOW or
UTIME_OMIT.
2018-09-03 11:54:38 +02:00
Philippe Waroquiers
0822ebca8f Fix Bug 397424 - glibc 2.27 and gdb_server tests
commit a214595daed7830a091dcd0f52c5b8073bfd04dd already handled some
of the new differences created by glib 2.27.

This commit should filter the new way gdb shows a select syscall
with glibc 2.27
2018-09-02 14:22:43 +02:00
Philippe Waroquiers
d457604d49 Fix 393146 failing assert "is_DebugInfo_active(di)"
Some applications are mapping an object ro, and then unmaps it directly.
In such a case, we have a di that contains obsolete fsm.maps (not matching
OS mappings). The di for this unmapped object is not active,
and has no dinfo (have_dinfo == False).
(more generally, fsm.maps can contain a whole bunch of obsolete mappings).

Later on, some other libs can be mapped with a mapping overlapping
this obsolete mapping.

A di that never had its debug info loaded can really be discarded,
even if CG_(clo_keep_debuginfo).
In such a case, it is normal to have to discard a not active di.

(it might be better to keep fsm.maps in sync with the real OS
mapping, but that is a much bigger change/fix).

The FSM debug tracing was static, it is now dynamic according
to debug loglevel >= 3.

The below is an extract of the trace showing what happens.

SYSCALL[4384,1](257) sys_openat ( 4294967196, 0x4244398(/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so), 524288 ) --> [async] ...
SYSCALL[4384,1](257) ... [async] --> Success(0x3)
SYSCALL[4384,1](72) sys_fcntl[ARG3=='arg'] ( 3, 2, 1 )[sync] --> Success(0x0)
SYSCALL[4384,1](5) sys_newfstat ( 3, 0x1ffefff8b0 )[sync] --> Success(0x0)
SYSCALL[4384,1](5) sys_newfstat ( 3, 0x1ffefff9c0 )[sync] --> Success(0x0)
SYSCALL[4384,1](9) sys_mmap ( 0x0, 10520, 1, 1, 3, 0 )--4384-- di_notify_mmap-0:
--4384-- di_notify_mmap-1: 0x4027000-0x4029fff r--
--4384-- di_notify_mmap-2: /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so
--4384-- di_notify_mmap-3: is_rx_map 0, is_rw_map 0, is_ro_map 1
--4384-- di_notify_mmap-4: noting details in DebugInfo* at 0x10024CEA10
--4384-- di_notify_mmap-6: no dinfo loaded /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so (no rx or no rw mapping)
 --> [pre-success] Success(0x4027000)
SYSCALL[4384,1](3) sys_close ( 3 )[sync] --> Success(0x0)
SYSCALL[4384,1](11) sys_munmap ( 0x4027000, 10520 )[sync] --> Success(0x0)
  ^^^^ the above munmap has not cleaned up or removed anything in DebugInfo* at 0x10024CEA10

Later on, /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so is mapped
overlapping the memory where libqeglfs.so was mapped ro.

Now, this cleans up the (useless) di that never had have_dinfo true, e.g.

------ start ELF OBJECT -------------------------------------------------------
------ name = /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so
...
--4384-- Discarding syms at 0x0-0x0 in /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so (have_dinfo 0)
(the 0x0-0x0 in the trace is because there was never any text mapping for libqeglfs.so).
2018-09-01 23:36:42 +02:00