10569 Commits

Author SHA1 Message Date
Philippe Waroquiers
dc21443635 Filter lines such as:
+38     ../sysdeps/unix/sysv/linux/_exit.c: No such file or directory.

This should make nlgone_exit work on s390 suse and x86_64 suse


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13913
2014-04-26 20:40:41 +00:00
Philippe Waroquiers
38471445e1 Make the test (more) deterministic by having send_signal using
a guardcmd before sending the signal.
This allows to be sure that the signal are emitted when vgdb
is attached.
We still have one 'sleep' in the test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13912
2014-04-26 20:23:47 +00:00
Philippe Waroquiers
5bdc88da20 Improve the comments in the test
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13911
2014-04-26 20:01:28 +00:00
Philippe Waroquiers
922a8c4f8d Due to timing problem, test was not properly testing.
What needs to be ensured is:
   vgdb is attached (i.e. is ptracing valgrind)
   2 sigusr1 signals are sent while vgdb is ptracing
     vgdb will queue these signals
   when continuing, the queued signals are delivered.

With 3.9.0, the above causes an internal error in valgrind:
valgrind: m_syswrap/syswrap-main.c:1436 (vgPlain_client_syscall): Assertion 'sci->status.what == SsIdle' failed.

It would be better to have explicit synchronisation in the test
rather than counting on 'sleep xxx' to have things done in the
order that tests the signal queueing.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13910
2014-04-26 19:55:33 +00:00
Julian Seward
58fb3e424c For the ld.so redirections for arm32-linux, allow the soname
ld-linux-armhf.so.3 in addition to the existing name, ld-linux.so.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13909
2014-04-24 23:47:16 +00:00
Julian Seward
2320d23f1f Enable sys_sendmmsg() on arm32.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13908
2014-04-24 23:45:18 +00:00
Philippe Waroquiers
887231c654 Remove the 2 sed expressions that were trying to massage the
stacktrace for the last program instruction encountered with
  --vgdb-stop-at=exit
These are not needed anymore, as these lines are now removed


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13907
2014-04-24 21:56:21 +00:00
Philippe Waroquiers
ac230f7fcb Too difficult to match the stacktrace of the last instruction
of a program => let's remove these (uninteresting) lines
rather than trying to 'sed' them to make them look the same
on different OS/platform/....


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13906
2014-04-24 21:52:02 +00:00
Philippe Waroquiers
e548d704c3 * Modify nlgone_exit so that it tests --vgdb-stop-at=startup,exit
* remove empty lines from nlgone_*.stdinB.gdb, as these empty
  lines are (surprisingly) repeating the previous gdb command.
  Empty lines should be be put in the *gdb files.
* And add yet another sed expression in filter_gdb to cope with
  the different place where a thread exits.
  (this filter technique is now *really* arriving in a dead end
   e.g. the link between the comment and the sed expression is very
   poor).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13905
2014-04-23 21:27:07 +00:00
Philippe Waroquiers
e2286363d9 * Implement optimisation in storev8/16/64 similar to optimisations in storev32
See comments in MC_(helperc_STOREV8) for a detailed explanation.

On modern cpu, this gives a few percent speed improvement for
some perf tests, and reduces the nr of undistinguished secondary
map.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13904
2014-04-22 22:07:01 +00:00
Philippe Waroquiers
b8735981a0 * Factorise code between is_valid_for_client and is_valid_for_valgrind.
* Implement VG_(am_is_valid_for_valgrind)
* Use it in gdbsrv to check accessibility when hostvisibility is activated



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13903
2014-04-20 22:10:24 +00:00
Philippe Waroquiers
a05f43f011 Cleanup some old leftover of AIX port + fix a comment
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13902
2014-04-20 19:50:13 +00:00
Philippe Waroquiers
9ba256ffb0 * New option --aspace-minaddr=<address> allows to (possibly) make
use of some more memory by decreasing the default value
  or solve some conflicts with system libraries by increasing the value.
  See user manual for details.

Note that the lowest accepted possible value is 0x1000, which is
the current value used by Macos in 32bits.
On linux, 0x10000 (64KB) seems to cause not much conflicts.

Default values are unchanged (i.e. are the same as when there
was no clo option).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13901
2014-04-20 14:20:37 +00:00
Philippe Waroquiers
8b7a52c4cb - The option "--vgdb-stop-at=event1,event2,..." allows the user
to ask GDB server to stop before program execution, at the end
  of the program execution and on Valgrind internal errors.

- A new monitor command "v.set hostvisibility" that allows GDB server
  to provide access to Valgrind internal host status/memory.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13900
2014-04-20 13:41:10 +00:00
Philippe Waroquiers
c23409d4e8 Reword/clarify the VG_(parse_enum_set) comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13899
2014-04-19 10:27:28 +00:00
Philippe Waroquiers
d17935e604 Factorise enum set parsing code
* add a function Bool VG_(parse_enum_set) in pub_tool_libcbase.h/m_libcbase.c
  (close to Bool VG_(parse_Addr)
* Implement Bool MC_(parse_leak_heuristics) and MC_(parse_leak_kinds)
  as a call to VG_(parse_enum_set)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13898
2014-04-19 09:52:32 +00:00
Philippe Waroquiers
9cbab7ee2c Several improvements to (internal) statistics reporting about memory usage,
making it easier to understand the memory and/or oom situation.
No functional (user level) change.

* For --profile-heap=yes, sort the cost centers by decreasing size,
  so that the most relevant cost centers are closed to the arena
  total.

* factorise duplicated code calling a series of print stat functions

* VG_(show_sched_status)
    optionally show the host stacktrace
               the amount of valgrind stack used by each thread
               the exited threads

* various functions: update to add VG_(show_sched_status) new
  args, keeping the same info production as before.
 
* In case of out of memory situation detected by m_mallocfree.c,
  reports more information:
    valgrind and tool stats
    scheduler status (full information)

* gdbserver v.info scheduler :
    show full information.

The oom behaviour/reporting was tested using a small
program causing an OOM, and having several threads
(some terminated, some still active).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13897
2014-04-19 00:25:54 +00:00
Philippe Waroquiers
74fb3e1c3e vgdb must not transmit signals when gdbserver has been ptrace-invoked.
Most of the time, Valgrind masks async signals, and polls for such
signals at regular interval.
There is a very narrow range of code (around client syscall logic)
where such signals are unmasked (as they must be able to interrupt
syscalls).
This is the only range of code where Valgrind is expecting to
receive such a signal.

When gdbserver is ptraced invoked, Valgrind is artificially made
to jump out of this code portion. Signals are not masked.
When ptraceing valgrind, vgdb will get these signals but cannot
transmit them immediately, otherwise they arrive in range
of code where they are not expected (causing internal error
in syscall logic) and/or causing gdbserver syscalls to be
interrupted.

3 solutions to solve that were looked at:
1. have the gdbserver code masking signals "as quickly as possible".
 Easy to implement, but this leaves still a small window
 of code where signals are not masked and would cause a problem.
2. have vgdb setting the SIGMASK of valgrind before invoking
  gdbserver.
  This would be easy to implement, but changing the SIGMASK
  of the ptrace-d process is only available on very recent kernels.
3. have vgdb queuing signals, and only transmitting them once
   gdbserver invocation is finished.
This 3rd solution has been implemented.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13896
2014-04-15 22:35:23 +00:00
Dejan Jevtic
958717766b mips64: Add an extra case for mips64 in ML_(get_CFA).
This patch resolves the issue with the memcheck/tests/dw4 on mips64 platform.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13895
2014-04-14 11:54:36 +00:00
Dejan Jevtic
a383b110f9 mips32: According to the glibc bug 5044 (https://sourceware.org/bugzilla/show_bug.cgi?id=5044)
until the glibc version 2.17 printf hadn't respected the rounding mode for decimal
output. Because of change in glibc printf function we need to change our
expected output file for none/tests/mips32/FPUarithmetic test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13894
2014-04-11 11:59:11 +00:00
Julian Seward
9be796fe75 Make origin tracking work on arm64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13893
2014-04-08 15:26:12 +00:00
Julian Seward
20f47d4181 Enable syscalls:
sys_readv sys_signalfd4 sys_utimensat sys_timerfd_create
sys_timerfd_settime sys_timerfd_gettime sys_capget sys_syslog
sys_sched_yield sys_sigaltstack sys_rt_sigqueueinfo
sys_mq_timedsend sys_mq_timedreceive sys_mq_notify
sys_mq_getsetattr sys_mremap



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13892
2014-04-07 14:47:23 +00:00
Dejan Jevtic
6cb9b78f0d mips32/64: According to DWARF version 4 in DW_TAG_structure_type we can
have DW_AT_signature attribute. That wasn't the case in DWARF version 3.

From DWARF version 4:
If the complete declaration of a type has been placed in a separate type unit, 
an incomplete declaration of that type in the compilation unit may provide the
unique 64-bit signature of the type using a DW_AT_signature attribute.

This patch adds an extra field in TyStOrUn structure (typeR). This field is 
reference to other TyEnt that is placed in separate type unit. Because of the new
field in TyStOrUn structure we need to add an extra case in parse_type_DIE
that will put the right reference to other TyEnt and an extra case in
ML_(describe_type) that will describe type when the ty->Te.TyStOrUn.typeR field
is used.

This patch is resolving the problem with memcheck/tests/dw4 test when it's 
compiled with compiler that will emit DW_AT_signature under the DW_TAG_structure_type.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13891
2014-04-04 10:20:03 +00:00
Dejan Jevtic
eb40633b9b mips32: Add an extra case for mips32 in ML_(get_CFA) in witch Valgrind will call
compute_cfa to get the call frame address.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13890
2014-04-04 10:02:03 +00:00
Julian Seward
00cbf4454f Add tests for some variants of LD{1,2}/ST{1,2} that load or
store two registers.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13889
2014-04-03 23:01:24 +00:00
Julian Seward
4330b24498 Add tests for FCMEQ, FCMGE, FCMGT, FACGE, FACGT
(reg-vs-reg variants only)

Add tests for all TBL and TBX variants.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13888
2014-04-03 23:00:45 +00:00
Philippe Waroquiers
e122b8d637 Fix a small typo in drd EXTRADIST Makefile.am file list for mips32
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13887
2014-03-29 00:37:51 +00:00
Dejan Jevtic
4f9a9ceb7a mips32: Additional .exp files for mips32.
Add a regression tests output file variants.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13886
2014-03-27 13:35:56 +00:00
Dejan Jevtic
8b49c93465 mips32: Additional .exp file for mips32.
memcheck/tests/origin5-bz2: Add a regression test output file variant.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13885
2014-03-26 16:05:16 +00:00
Julian Seward
d410da3564 Add client requests
VALGRIND_DISABLE_ADDR_ERROR_REPORTING_IN_RANGE and
   VALGRIND_ENABLE_ADDR_ERROR_REPORTING_IN_RANGE
and supporting machinery for managing whole-address-space sparse
mappings.  n-i-bz.  In support of
https://bugzilla.mozilla.org/show_bug.cgi?id=970643



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13884
2014-03-20 23:00:09 +00:00
Dejan Jevtic
6107689cd8 mips32: When we are accessing elements via double pointer MIPS compiler can
generate two consecutive 32bit loads instead of one 64bit load. Because of that
in error log we have two conflict loads of size 4 instead of one conflict load
of size 8.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13883
2014-03-20 10:23:43 +00:00
Bart Van Assche
0c4bf8499e drd: Add post-rwlock_init and pre-rwlock_destroy client requests (#332265)
From: Ivo Raisr <ivosh@ivosh.net>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13882
2014-03-19 18:48:01 +00:00
Dejan Jevtic
b0917203d8 mips: Disable test on mips32/64 big-endian platforms.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13881
2014-03-19 15:44:19 +00:00
Dejan Jevtic
22b0f93413 VG_(strlen) ( const HChar* str ) does not count the null terminator '\0' at the
end of the string, so we need to add an extra element in string 's' for the null
terminator.
VG_(strcpy) ( HChar* dest, const HChar* src ) function copies the string pointed
to by src, including the null terminator ('\0'), to the buffer pointed to by dest.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13880
2014-03-19 11:58:35 +00:00
Julian Seward
8cb7b38c15 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13879
2014-03-18 23:03:38 +00:00
Julian Seward
fd0e5403b4 Make Helgrind test cases build on arm64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13878
2014-03-18 23:02:59 +00:00
Bart Van Assche
45ab272d19 drd: Fix pthread_rwlock_timed{rd,wr}lock intercepts (#332263)
From: Ivo Raisr <ivosh@ivosh.net>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13877
2014-03-18 17:53:56 +00:00
Bart Van Assche
4ce8144dee drd/tests/atomic_var: Avoid that platform-specific code can trigger a false negative
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13876
2014-03-18 08:45:51 +00:00
Julian Seward
5e83ae1346 For arm64, implement macros CALL_FN_W_5W to CALL_FN_W_12W.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13875
2014-03-16 14:21:41 +00:00
Bart Van Assche
ac9c8e1a37 strmem intercepts: Add mempcpy() intercepts for ld-linux on x86
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13874
2014-03-15 12:47:28 +00:00
Julian Seward
bd3e36e6a6 Update for ARM fe fixes for 332037 and n-i-bz LDRD .. [PC, ]
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13873
2014-03-15 08:35:15 +00:00
Bart Van Assche
b8bef5d9b9 NEWS: Mention recently fixed DRD issues
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13872
2014-03-13 08:40:56 +00:00
Bart Van Assche
87ff855f49 NEWS: Mention recently fixed DRD issues
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13871
2014-03-12 14:44:34 +00:00
Bart Van Assche
fc9651423d drd: Fix an assertion failure in the internal consistency check code (#332055)
When DRD is built with ENABLE_DRD_CONSISTENCY_CHECKS enabled it fails with an assert on platforms where VG_STACK_REDZONE_SZB is #define'd as 0 (for example on 32-bit x86). drd: drd_thread.h:299 (vgDrd_thread_set_stack_min): Assertion 'DRD_(g_threadinfo)[tid].stack_min < DRD_(g_threadinfo)[tid].stack_max || DRD_(g_threadinfo)[tid].stack_max == 0' failed. ==12392== at 0x380227CD: report_and_quit (m_libcassert.c:279) ==12392== by 0x38022979: vgPlain_assert_fail (m_libcassert.c:359) ==12392== by 0x38015B29: drd_post_thread_create (drd_thread.h:297) ==12392== by 0x380A5DDC: run_a_thread_NORETURN (syswrap-linux.c) This is because on drd_post_thread_create() call is made to: drd_start_using_mem_stack2(drd_created, stack_max, 0); and in drd_start_using_mem_stack2() calls is made to: DRD_(thread_set_stack_min)(tid, a - VG_STACK_REDZONE_SZB); For many platforms VG_STACK_REDZONE_SZB is #define'd as 0 so that stack_min == stack_max in DRD_(thread_set_stack_min)(). I think it is safe to change the assert from (stack_min < stack_max) to (stack_min <= stack_max).

From: Ivo Raisr <ivosh@ivosh.net>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13870
2014-03-12 14:27:49 +00:00
Mark Wielaard
571ffeabe1 Add vki/vki-*arm64-linux.h to include/Makefile.am nobase_pkginclude_HEADERS.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13869
2014-03-11 21:32:51 +00:00
Mark Wielaard
f68b1089a7 Make sure all files under the new shared dir are included in make dist.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13868
2014-03-11 19:30:32 +00:00
Mark Wielaard
948061357e Add vgdb.h to coregrind/Makefile.am noinst_HEADERS.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13867
2014-03-11 19:30:32 +00:00
Mark Wielaard
e951b42737 Add vki/vki-xen-tmem.h to include/Makefile.am nobase_pkginclude_HEADERS.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13866
2014-03-11 19:30:25 +00:00
Dejan Jevtic
d4308d8295 mips32/64: Fix some mips32 and mips64 definitions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13865
2014-03-11 13:08:47 +00:00
Bart Van Assche
1485694c3f coregrind/m_scheduler + drd: Rework r13862
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13864
2014-03-10 19:40:45 +00:00