Commit Graph

11552 Commits

Author SHA1 Message Date
Florian Krohm
b8c19b3f67 Change the minimum allowable value of aspacem_minAddr to
be VKI_PAGE_SIZE. That follows from the requirement that
the address ought to be page aligned and > 0. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15042
2015-03-27 08:47:22 +00:00
Philippe Waroquiers
06b9624009 Improve --stats=yes:
* give the avg nr of IPs per execontext
 * use the newly introduced %f in m_transtab.c ratio
   and in the avg nr of execontext per list



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15041
2015-03-26 22:12:40 +00:00
Florian Krohm
913972366f Add function VG_(am_is_valid_for_aspacem_minAddr) so that the parser
for command line options does not need to know what addresses are valid
for aspacem_minAddr.
That information should be hidden in the address space manager.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15040
2015-03-26 21:55:00 +00:00
Philippe Waroquiers
69088f9df3 Have the very detailed gdbsrv debuglog (e.g. exchange of packets
between GDB and V gdbsrv, fetching/setting registers, ...) done
at debuglog level 3 instead of 1.
This allows to do gdbsrv commands at debuglog level 2
without seeing too much trace.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15039
2015-03-26 21:32:03 +00:00
Rhys Kidd
d442b97795 Further fixes for bz#345394 specifically for OS X 10.10
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15038
2015-03-26 10:14:25 +00:00
Philippe Waroquiers
e83c164c0a * Add in helgrind stats the nr of live/exit/joined/exit and joined threads
* avoid division by 0 in m_transtab.c stats before anything was done



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15037
2015-03-24 14:02:44 +00:00
Philippe Waroquiers
fe51430d6c This patch further reduces the memory used by TT/TC (by about 15Mb
on 32 bits memcheck default nr of sectors).

Memory is reduced by using UShort typedef-s for Sector no and TTE no.
Note that for TTE no, we had a mixture of UShort, UInt and Int used
depending on the place (a TTE no was in any case constrained to be an UShort).

The bss memory/startup space is also reduced by allocating the htt on demand
(like tt and tc), using mmap the first time a sector is initialised.

Changes:
* pub_core_transtab.h :
   * 2 typedef to identify a sector and a tt entry (these 2 types are UShort)
   * add 2 #define 'invalid values' for these types
   * change the interface to use these types rather than UInt
* m_transtab.c
   * use wherever relevant these 2 new types rather than UInt or UShort
   * replace the use of -1 by INV_SNO or INV_TTE
   * remove now useless typecast from Int/UInt to UShort for tte
* schedule.c: use the new types






git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15036
2015-03-23 21:49:32 +00:00
Florian Krohm
2055aa80cf Simplify expression.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15035
2015-03-23 20:04:14 +00:00
Florian Krohm
e7674cfdbb Add VG_(am_is_bogus_client_stack_pointer)(Addr).
The function is used in VG_(client_syscall) to avoid extending the stack
when it is clear that the current value of the stack pointer does not
point into a segment that looks like a stack segment.
See the comments in the code there.
As a side effect of this we can now revert r15018 which increased
the stack size of the alternate stack in memcheck/tests/sigaltstack.c.
The reason is that the belief at the time: "alternate stack is too small"
was not correct. What instead happened was that VG_(client_syscall) called
VG_(extend_stack) without need (the syscall was tgkill) and the new stack
pointer happened to be in a file segment. 
In other words: the current stack pointer was still within the alternate
stack, i.e. the alternate stack was (barely) large enough.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15034
2015-03-23 17:13:04 +00:00
Tom Hughes
88e1a7587c Include the platform name in the unhandled system call message
We often get bug reports for an unhandled system call which don't
make it clear what platform is in use, which makes it impossible
to know which system call it is.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15033
2015-03-22 11:01:58 +00:00
Philippe Waroquiers
33269ed30a Fix leak : only strdup in SectKind.objname if a SectKind address is returned
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15032
2015-03-21 20:55:36 +00:00
Philippe Waroquiers
9e35d13f3b 343902 --vgdb=yes doesn't break when --xml=yes is used
Changes ensures that gdbserver is called also when xml is yes.
When gdbserver is set to yes, we have to temporarily reset 
xml output to no, as gdbserver output (e.g. print the last error)
has to be printed to gdb.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15031
2015-03-21 16:13:08 +00:00
Rhys Kidd
4669a61228 Fix memcheck/tests/strchr on OS X
bz#345394
- Support the required index and _platform_strchr alias

Before:

== 589 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 589 tests, 238 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15030
2015-03-21 14:25:02 +00:00
Florian Krohm
23c60d2567 Change the GCC demangler to not use VLA. The rationale is that these VLAs
are allocated on the stack and they can become quite large - in particular
when the client is a C++ application using the Boost library.
In combination with the demanglers recursive nature this can quickly lead
to exhaustion of valgrind's per-thread stack (which cannot be dynamically
grown). Additionally, due to the large VLAs (I've seen a 32k array) we
could run out of stack space without issuing a prior warning and instead
just segfault. 
Therefore this patch allocates these arrays on the heap and frees them
later. Basically this is a respin of Joseph's r10385.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15029
2015-03-21 10:58:37 +00:00
Rhys Kidd
b5681aa70c Address darwin compile issue introduced in r15013, due to _IOC_NONE
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15028
2015-03-21 06:35:32 +00:00
Florian Krohm
9246ef1635 Fix parsing the %z format specifier. Need to advance to next character.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15027
2015-03-20 16:45:02 +00:00
Florian Krohm
3e52a2215d Add ecag.stdout.exp-z13.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15026
2015-03-20 09:40:23 +00:00
Florian Krohm
100f719c9c Do not reuse Creg_IA_* for s390. Add dedicated entries Creg_S390_...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15025
2015-03-20 09:38:58 +00:00
Florian Krohm
940a2b3b29 Remove config files for no-longer-existing s390 builds.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15024
2015-03-20 08:17:28 +00:00
Philippe Waroquiers
da576a5d65 Change TT/TC hashing data structure (decreases memory by 50MB for memcheck 32bits)
This patch changes the way the transtab entries hash table is done.
Currently, the hash table is an open hash table considered full at 65%.
This means that in average, 1 entry on 3 is unused.
(all the hash table memory will be 'active' for big applications,
as the active entries are normally reasonably distributed over the hash table).
The size of a transtab entry is significant (about 150 Bytes).

To avoid having 35% of the entries unused, the translation table
is split in 2:
An hash table, that will contain an index pointing at the transtab entries.
With this technique, we are adding a small hash table,
but we spare 35% of the translation table.

Performance measurements have shown no degradation,
and some platforms have better performance. Not too clear why,
probably this helps platforms with small caches ?).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15023
2015-03-19 22:17:08 +00:00
Mark Wielaard
4644dd952e Add nightly script for wildebeest[32] (debian x86), lfedora1 (fedora s390x)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15022
2015-03-19 11:27:46 +00:00
Christian Borntraeger
46f45e99db add cache info for z13
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15021
2015-03-17 15:48:11 +00:00
Florian Krohm
a42eafde1e Minimal update to recognise z13 (s390).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15020
2015-03-17 13:45:29 +00:00
Florian Krohm
544aa45a0f Merge the contents of docs/internals/howto_build_documentation
into docs/README.
Remove the section about the XML Toolchain as it is outdated.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15019
2015-03-16 22:42:13 +00:00
Florian Krohm
8a9117b3d7 Increase the size of the alternate stack. It was too small.
This was found by accident and there is no known way to detect
an overflow of an alternate stack in the general case.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15018
2015-03-16 22:03:42 +00:00
Florian Krohm
df2bfc8447 Add a howto for building documentation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15017
2015-03-16 12:22:35 +00:00
Philippe Waroquiers
162d69c37f New Option --avg-transtab-entry-size=<number> can be used to tune
the size of the translation table sectors, either to gain memory
  or to avoid too many retranslations.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15016
2015-03-15 12:24:19 +00:00
Philippe Waroquiers
83fefa7f05 Fix the following errors detected by makefile check
memcheck/tests/Makefile.am:1: error: wrap8.stderr.exp-ppc64 is missing in EXTRA_DIST
memcheck/tests/Makefile.am:1: error: wrap8.stdout.exp-ppc64 is missing in EXTRA_DIST
memcheck/tests/Makefile.am:1: error: wrap8.stdout.exp2 is in EXTRA_DIST but doesn't exist
memcheck/tests/Makefile.am:1: error: wrap8.stderr.exp2 is in EXTRA_DIST but doesn't exist



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15015
2015-03-15 12:22:43 +00:00
Philippe Waroquiers
913dcefe94 Add option --loop-till-fail to tests/vg_regtests
to make it easier to obtain failing trace or unfiltered output for
tests that fail from time to time


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15014
2015-03-14 18:29:35 +00:00
Florian Krohm
35b966c09e Fix the testcase so it works on platforms where _IOC_NONE != 0
Filtering script and expected output file adapted.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15013
2015-03-14 15:54:05 +00:00
Florian Krohm
d2b07b7178 Organise the expected output files for the wrap8 testcase.
There is special behaviout on ppc64 only. Let the filenames
reflect that. At the same time update the ppc specific
output to what it is. The important thing here is that the
stack overflow is detected. Everything else is effectively a
don't care. Should line numbers and such differ in the future
that should be filtered out.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15012
2015-03-14 10:15:23 +00:00
Florian Krohm
74cbfc6f04 Update the ppc64 specific results to what they are.
The difference of the expected results as compared to other
platforms is

- Location 0x........ is 2 bytes inside local var "budget"
- declared at varinfo6.c:3115, in frame #2 of thread 1
+ Address 0x........ is on thread 1's stack
+ in frame #2, created by BZ2_blockSort (varinfo6.c:3107)

Should the stderr output of this testcase in the future 
match the generic output (varinfo6.stderr.exp) then this is
another incarnation of 
https://bugs.kde.org/show_bug.cgi?id=345121


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15011
2015-03-14 09:44:04 +00:00
Florian Krohm
ac9506ad26 Disable testcase because the ptrace system call is not
supported on ppc64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15010
2015-03-14 09:30:36 +00:00
Florian Krohm
1a4ab21e56 Sort locks by their guestaddr to make the error output independent
of the dynamically allocated Lock addresses.
This restores helgrind/tests/locked_vs_unlocked2.stderr.exp
from r14931.

While regtesting the patch I've observed intermittent failures
of helgrind/tests/hg05_race2 like so:

--- ../../helgrind/tests/hg05_race2.stderr.exp  (revision 15001)
+++ ../../helgrind/tests/hg05_race2.stderr.exp  (working copy)
@@ -26,8 +26,7 @@
    at 0x........: th (hg05_race2.c:17)
    by 0x........: mythread_wrapper (hg_intercepts.c:...)
    ...
- Location 0x........ is 0 bytes inside foo.poot[5].plop[11],
- declared at hg05_race2.c:24, in frame #x of thread x
+ Address 0x........ is on thread #x's stack
 
 ----------------------------------------------------------------
 
@@ -42,8 +41,7 @@
    at 0x........: th (hg05_race2.c:17)
    by 0x........: mythread_wrapper (hg_intercepts.c:...)
    ...
- Location 0x........ is 0 bytes inside foo.poot[5].plop[11],
- declared at hg05_race2.c:24, in frame #x of thread x
+ Address 0x........ is on thread #x's stack

Surely, that's something else.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15009
2015-03-13 13:50:08 +00:00
Philippe Waroquiers
375f1b608e Fix a warnings introduced by rev 15005
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15008
2015-03-12 23:09:28 +00:00
Philippe Waroquiers
f5fafcaac2 Announce in NEWS the new option --valgrind-stacksize
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15007
2015-03-12 22:53:18 +00:00
Philippe Waroquiers
4b70c77ad7 Fix non portability spotted by Florian:
An array must have at least 1 element.
0 element is accepted by gcc but is not portable.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15006
2015-03-12 22:46:58 +00:00
Philippe Waroquiers
85c9a1430c m_transtab.c statistic/tracing
* common up the identical debug and clo_stat traces
* add in the stats the nr of sectors recycled
* add the avg translation size in each sector recycled
  and in the final statistics
(no functional change)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15005
2015-03-12 22:36:22 +00:00
Philippe Waroquiers
826502e89a Implement command line option --valgrind-stacksize=<number>
This allows to decrease memory usage when using many threads,
if no big stacksize is needed by Valgrind.
If needed (e.g. for demangling big c++ symbols), the V stacksize
can be increased.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15004
2015-03-12 20:43:46 +00:00
Florian Krohm
95d7b1d054 Fix two bugs:
(1) In r14664 VG_(get_fnname_if_entry) was changed to always
    return a function name, even if that function was *not* an
    entry. That broke callgrind and was also confusing because
    it contradicts what "get_fnname_if_entry" suggests.
(2) In r14189 a function call was removed because it was considered
    redundant which it was not.

Both bugs were hunted down by Joseph Weidendorfer.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15003
2015-03-12 18:56:21 +00:00
Florian Krohm
462d387e29 Announce fix for BZ #345079.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15002
2015-03-12 11:02:11 +00:00
Florian Krohm
30e4288907 Remove assertion. Unlikely as it may be, len may be huge
and therefore we cannot assert otherwise.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15001
2015-03-11 22:16:22 +00:00
Florian Krohm
1ecaaf9fa0 Update a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15000
2015-03-11 13:46:14 +00:00
Florian Krohm
20a1bb0d5b Update release notes with ICC contact.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14999
2015-03-10 21:31:06 +00:00
Florian Krohm
a4d7580b6d Announce support for Intel's ICC compiler. Fixes BZ #339542.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14998
2015-03-10 20:48:07 +00:00
Florian Krohm
f696bd863b Issue a warning if a function has more than 5 million bytes of
code. Previously functions exceeding that size were observed in the
field. Assert for 100x that amount.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14997
2015-03-10 20:46:58 +00:00
Carl Love
b7cbe0ff1f Updated the NEWS file
bugzilla  343597 - ppc64le: incorrect use of offseof macro  fixed 3/10/2015

Issue found by Florian Krohm who also suggested the fix.  The fix was 
made and tested by Carl Love.

VEX commit number 3100



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14996
2015-03-10 18:53:15 +00:00
Florian Krohm
6dce653240 Add support for building with -fsanitize=undefined.
- add configure option --enable-ubsan 
- add __ubsan helpers (by Julian)

This requires gcc 4.9.2 or later. Not all platforms are supported, though.
With this change and VEX r3099 regression tests pass on amd64
with a valgrind compiled with -fsanitize=undefined.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14995
2015-03-10 16:13:59 +00:00
Julian Seward
37f7ddaea7 PRE(sys_prctl): handle PR_SET_SECCOMP.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14994
2015-03-10 11:05:10 +00:00
Florian Krohm
a016e927bb New function VG_(am_mmap_client_heap) which swallows
VG_(am_set_segment_isCH_if_SkAnonC).
Rename VG_(am_set_segment_hasT_if_client_segment) to
VG_(am_set_segment_hasT) passing in an address (because that function
cannot possible take a pointer to a *const* segment). Also assert that
the segment containing the address is a client segment. Everything else
is a bug.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14993
2015-03-07 23:01:14 +00:00