Mark Wielaard [Tue, 6 Dec 2016 09:50:47 +0000 (09:50 +0000)]
Adjust line number in mcblocklistsearch.stderrB.exp.
valgrind svn r16173 "Add CLEAR_CALLER_SAVED_REGS in leak-tree test"
added one extra line to memcheck/tests/leak-tree.c which is used in
gdbserver_tests/mcblocklistsearch.vgtest. Adjust the line numbers in
the exp file to match.
Petar Jovanovic [Mon, 5 Dec 2016 16:29:24 +0000 (16:29 +0000)]
Add CLEAR_CALLER_SAVED_REGS in leak-tree test
Motivation for this change is similar to what has already been done in other
leak-* tests. That is, call CLEAR_CALLER_SAVED_REGS (currently used only on
PPC and MIPS arches) to clear temporary registers that might be holding
pointers lost in a previously called function.
This fixes memcheck/tests/leak-tree failure on some MIPS platforms.
Petar Jovanovic [Mon, 5 Dec 2016 16:03:21 +0000 (16:03 +0000)]
mips: implement CLEAR_CALLER_SAVED_REGS for memcheck tests
Implement CLEAR_CALLER_SAVED_REGS macro that is used for some memcheck
tests. This is done in order to clear temporary registers that still
might be holding pointers to lost memory regions.
Similar change has been made for PPC.
Petar Jovanovic [Thu, 1 Dec 2016 16:01:45 +0000 (16:01 +0000)]
mips: fix call_on_new_stack_0_1 code
MIPS32 implementation missed to set up a correct (zero) return address.
This led to incorrect execution of get_StackTrace_wrk as it was not
able to unwind stack correctly.
This change fixes memcheck/tests/leak-autofreepool-5.
MIPS64 implementation missed clearing all integer registers before
entering the function.
Petar Jovanovic [Tue, 29 Nov 2016 14:57:51 +0000 (14:57 +0000)]
mips64: fix fadvise64 syscall wrappers
Use platform specific pre-wrapper for fadvise64 system call and respect
size of parameters, instead of using generic wrapper written for 32bit
architectures.
Petar Jovanovic [Tue, 29 Nov 2016 14:27:25 +0000 (14:27 +0000)]
mips32: fix fadvise64 system call
For fadvise64 system call, 7th 32-bit argument slot (third on the stack)
will also be used due to MIPS O32 calling convention in passing 64-bit
values.
sys_fadvise64(int fd, loff_t offset, loff_t len, int advice);
Petar Jovanovic [Wed, 23 Nov 2016 17:38:29 +0000 (17:38 +0000)]
make bar_bad tests more deterministic
Canceling the thread slp2 before the case 5 makes behaviour of this test
more deterministic.
Also, as Philippe W. pointed out, adding --fair-sched=try seems to avoid
variable and sometimes very long run time for these tests.
Ivo Raisr [Sun, 20 Nov 2016 15:06:08 +0000 (15:06 +0000)]
Fix test none/tests/pth_2sig on Solaris.
When signal SIGINT was used, it got propagated to the parent shell
and therefore the regression test suite was terminated.
With SIGTERM only the parent exits, as is supposed.
Verified that this changed test case still reproduces the original problem
on Linux and Solaris, when r16140 is temporarily undone.
Follow up to r16140 and r16143 and BZ#372600.
Ivo Raisr [Sat, 19 Nov 2016 15:15:10 +0000 (15:15 +0000)]
Fix the configure test for presense of __xpg[4,6] symbols
on Solaris so that only shared library is considered.
Previously a binary was checked which now started to produce
incorrect results with regards to vg_preload.
n-i-bz
Note that it is unclear if the PRE syscall for rt_sigsuspend
is properly setting up a temporary mask in the thread state
tmp_sig_mask: if an handler is called while a thread is
calling sigsuspend, the mask during the handler run must be
the temporary mask set by sigsuspend.
It is not clear if/where the valgrind sigframe builder/handler
sets the tmp_sig_mask to the value as expected by the user
(i.e. the value of the temporary mask which was given to
the sigsuspend syscall)
Improve the outer/inner setup: have the outer reporting the inner guest stacktrace
Note: the outer now unconditionally report the inner guest stacktrace.
If that would be a problem, we might add a sim-hint no-inner-guest-stacktrace
to optionally disable such outer behaviour.
Fix sym name cache: handles the difference between text and data, + match in symbol
* sym name cache to cache the 'isText' characteristic of the cached sym_name
* implement the match anywhere also in the cache
Not handling matchAnywhere has bad performance effect on callgrind, as almost many
IPs were considered as a fn entry, while they were not.
* use the same convention to name the findText argument
When --show-below-main=no, search main from the outermost stackframe
* main is more likely to be an outermost frame rather than an innermost
frame. So, searching from the outermost frame will more quickly find it.
* Also, in case the stacktrace contains twice the main functionn, this
ensures we only removes the functions below the outermost main.
Having 2 mains in a stacktrace does not happen normally.
However, this prepares for some future commit that improves
the outer/inner setup: the outer will append the inner guest stack trace.
The inner stack trace sometimes already contains main.
Searching from outermost frame main allows to keep the interesting
part of the stacktrace.
Mark Wielaard [Sat, 12 Nov 2016 19:51:51 +0000 (19:51 +0000)]
Cleanup none/tests/nocwd.vgtest tmp dirs.
The none/tests/nocwd creates a really deep temporary directory structure
that is also inaccessible after the test. This causes issues with some
build wrappers like koji which fail to cleanup such deep subdirectories.
So explicitly cleanup the directory after the test.
Outer/inner setup : allow append to outer args, use a bigger --num-callers
* Similarly to what was done in revision r16104 for vg_perf, have a way
to append to predefined vg_regtest outer args, rather than only be able
to replace them.
* increase the num callers for outer tool to 40.
(This is in preparation of a future commit, that will allow outer tool
to append the inner guest stack trace to reported errors in the inner)
Final patch of the xtree serie, which provides the documentation.
The xtree concept was committed in the revisions
16120 : Support pool of unique string in pub_tool_deduppoolalloc.h
16121 : Implement a cache 'address -> symbol name' in m_debuginfo.c
16122 : Add VG_(strIsMemberXA) in pub_tool_xarray.h
16123 : Addition of the pub_tool_xtree.h and pub_tool_xtmemory.h modules, and of the --xtree-memory* options
16124 : Addition of the options --xtree-memory and --xtree-memory-file
16125 : Small changes in callgrind_annotate and callgrind manual
16126 : Locally define vgPlain_scrcmp in 2 unit tests
16127 : Support for xtree memory profiling and xtmemory gdbsrv monitor command in helgrind
16128 : Support for xtree memory profiling and xtmemory gdbsrv monitor command in memcheck
16129 : Update massif implementation to xtree
Some smaller follow-up patches to be expected to add some regtests,
and refine documentation.
Thanks to Ivo, Julian and Josef for the review comments.
Update massif implementation to xtree
* update massif code so as to replace the massif specific XTree implementation
by calls to pub_tool_xtree.h
This improves the massif performance in CPU (a few percents to a factor
2 gained, depending on the implementation). The memory use is also
decreased.
With this patch, massif behaves similarly to the previous implementation.
The differences are:
* some massif stats output have changed, as the new implementation
differs completely from the previous one.
* when 2 'branches' of the call tree have consumed the same amount
of heap, the order in which the branches are output in the massif
output file can differ between the old and new implementation.
No other functional difference is expected, waiting for new bugs to
be discovered.
* Also add support for xtree memory profiling and xtmemory gdbsrv monitor
command in massif :
* massif will produce xtree memory profiling according to the options
--xtree-memory.
* addition of the xtmemory gdbserver monitor command.
Support for xtree memory profiling and xtmemory gdbsrv monitor command in memcheck
* memcheck will produce xtree memory profiling according to the options
--xtree-memory.
* addition of the xtmemory gdbserver monitor command.
(this is the second real xtree functional difference)
Support for xtree memory profiling and xtmemory gdbsrv monitor command in helgrind
* helgrind will produce xtree memory profiling according to the options
--xtree-memory.
* addition of the xtmemory gdbserver monitor command.
(this is the first real xtree functional difference)
Locally define vgPlain_scrcmp in 2 unit tests
Humph, this should have been part of :
16122 Add VG_(strIsMemberXA) in pub_tool_xarray.h
which means that between 16122 and this revision, these 2 unit tests
will (very probably) not compile.
That will make bissect not easy :(
Small changes in callgrind_annotate and callgrind manual
* callgrind_annotate: ignore the lines giving the long names of the
events: such lines are used by kcachegrind for the GUI, so are better
accepted (and ignored) by callgrind_annotate
* Document in callgrind_annotate manual that thresholds can be given
per event kind.
* Avoid a division by zero in callgrind_annotate, for 'special data'
such as produced by (some) xtrees.
Addition of the options --xtree-memory and --xtree-memory-file
Option is added, parsed, explained in --help
but is not used yet by any other code.
So, apart of the --help, no functional effect.
Addition of the pub_tool_xtree.h and pub_tool_xtmemory.h modules, and of the --xtree-memory* options
This commit is the bulk of the new code.
There is however no functional impact yet : the new modules are not used by anybody.
Implement a cache 'address -> symbol name' in m_debuginfo.c
Support work for xtree: as xtree implementation makes a high
nr of calls to get_sym_name, this cache improves the performance
as usually, stacktraces are repeatitively querying the same
addresses.
The cache follows the same principle as the cfsi_m_cache.
In particular, cache is cleared together with the cfsi_m cache.
Petar Jovanovic [Fri, 4 Nov 2016 18:21:22 +0000 (18:21 +0000)]
mips: Add redir for index function in ld.so.1
Redirect index function in ld.so.1.
Optimize the existing strlen function implementations.
This removes warnings coming from optimized index and strlen functions
in ld.so.1.
Some small optimisation+some code reformatting
* Use stack arrays instead of malloc/free
* ensure msghdr_foreachfield does one single call to foreach_func
for consecutive fields
* some small code reformatting or factorisation
perf/vg_perf --outer-args: either replace the predefined outer args, or append to it.
Currently, vg_perf predefines a set of standard outer tool args according to the tool.
These predefined args can be replaced by another set using "--outer-args=xxx yyy zzzz".
But often, we want to add (or override) only a few args.
So, modify vg_perf so that if the first letter of --outer-args is a + character, then
the provided args are appended to the predefined args
Mark Wielaard [Fri, 21 Oct 2016 00:02:10 +0000 (00:02 +0000)]
Add libc_test to workaround pth_cond_destroy_busy test hangs.
This is a workaround for bug #371396. It adds a new test program
that can be used skip tests given a specific libc implementation
and optionally a specific minimum version. Currently only glibc
is recognized. This is used for the drd and helgrind tests
pth_cond_destroy_busy to be skipped on glibc 2.24.90+.
Julian Seward [Tue, 18 Oct 2016 17:16:11 +0000 (17:16 +0000)]
Add to Memcheck a flag --ignore-range-below-sp=<offset>-<offset>, for
ignoring accesses on the stack below SP. Serves as a more modern
replacement for --workaround-gcc296-bugs, which is now deprecated.
Fixes #360571.
Carl Love [Tue, 18 Oct 2016 15:56:55 +0000 (15:56 +0000)]
Fix PPC BE in 32-bit mode.
The 64-bit compares are not supported in 32-bit mode. Change the 64-bit
compares to 32-bit compares when doing byte compares. Add routine for
doing V128 GT compare using 32-bit compares.
The clean caller support was missing for 32-bit mode
Update the expected output file jm_vec_isa_2_07.stdout.exp