Commit Graph

11020 Commits

Author SHA1 Message Date
Philippe Waroquiers
f00a9f2c0d Fix wrong operator = (instead of ==) in assertion
Assertion had a side effect (detected by Coverity)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14435
2014-09-02 19:26:40 +00:00
Philippe Waroquiers
a3ccc76b17 Fix wrong operator (detected by Coverity)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14434
2014-09-02 18:34:25 +00:00
Florian Krohm
d417ea90c2 Fix a few incorrect format strings. Spotted by the Coverity checker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14433
2014-09-02 14:21:25 +00:00
Tom Hughes
612c18619d Add support for some more tun/tap ioctls. BZ#315952.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14432
2014-09-02 12:54:29 +00:00
Florian Krohm
6cf18881c5 The 4th parameter of lzo1x_decompress_safe has lzo_uint * type
which, despite the name, is a pointer to an unsigned long.
So we should be passing arguments of matching type.
Spotted by the Coverity checker.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14431
2014-09-02 12:05:15 +00:00
Florian Krohm
8a8cc67ca0 Remove some unneeded checks. These were spotted by the Coverity checker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14430
2014-09-02 11:58:10 +00:00
Florian Krohm
3aa58402fa Avoid memory leak.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14429
2014-09-02 11:38:09 +00:00
Julian Seward
ac8a005dd4 --> 3.10.0.BETA1
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14428
2014-09-02 10:30:12 +00:00
Mark Wielaard
41e08a29eb Tweak gdbserver_tests/mcinfcallWSRU.stderrB.exp to match more gdb versions.
Some gdb versions don't show the source line:number after switching
threads in #0  0x........ in do_burn (). Filter "at line:number" out
and don't expect it.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14427
2014-09-02 10:16:42 +00:00
Florian Krohm
fca8f55ba0 Add a clarifying comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14426
2014-09-02 09:49:53 +00:00
Julian Seward
6342e2ef52 Tidy this up for the 3.10.0 beta.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14425
2014-09-02 09:38:27 +00:00
Julian Seward
a3d53e71d0 Add a ( that was missed in r14419 (Prepare to change the default for
--read-inline-info from =no to =yes)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14424
2014-09-01 22:37:57 +00:00
Julian Seward
5d48b6484c Make --read-inline-info=yes be the default on Memcheck and Helgrind
(just temporarily).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14423
2014-09-01 22:32:52 +00:00
Julian Seward
635ed73abb Followup to r14392 (fix up of stack bounds semantics) needed to keep
the darwin port from asserting at startup.  Patch from PhilippeW.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14422
2014-09-01 22:31:07 +00:00
Julian Seward
506af73036 VG_(getdents64) is only needed on Linux, and causes build problems
on Darwin, so make it exist only on Linux.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14421
2014-09-01 22:26:18 +00:00
Philippe Waroquiers
104e009d55 prepare for changing the default of --read-inline-info
suppvarinfo5 is using suppression entries that explicitely checks
for a stack trace without inline info.
So, indicate to not read the inline info.
This also means we will have (and keep) at least one test testing the
behaviour of --read-inline-info=no


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14420
2014-09-01 21:52:47 +00:00
Philippe Waroquiers
ad93992adc Prepare to change the default for --read-inline-info from =no to =yes
The interception/replacements functions should preferrably not
depend on the value of --read-inline-info.
The idea is to change the default from no to yes.
Depending on the no or yes, some intercept/replacement functions
that are inlined will be shown or not shown in stacktraces.

To have such stack traces not depending on the value of --read-inline-info,
such functions should either be marked as
  noinline
or be defined as macros.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14419
2014-09-01 21:46:52 +00:00
Florian Krohm
382a9fa5d3 Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14418
2014-09-01 21:27:06 +00:00
Julian Seward
fd963d5022 Add a missing VKI_ prefix. No functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14417
2014-09-01 21:25:03 +00:00
Julian Seward
975b0b31fe EM_PPC64 isn't defined by some older Android NDKs. Define it
if necessary.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14416
2014-09-01 21:17:01 +00:00
Julian Seward
da1b98f5fd Tidying up (no functional change)
* add indentation to functions AC_GCC_WARNING_SUBST_NO and
  AC_GCC_WARNING_COND

* remove an extraneous (I hope) "-CFLAGS=$safe_CFLAGS"



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14415
2014-09-01 21:16:02 +00:00
Julian Seward
d3be13ad6c Fix bogus bracketing. No functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14414
2014-09-01 21:12:44 +00:00
Florian Krohm
5f03bb301d Followup to r13469. lineno has already been asserted to be != NULL.
No need to check it again.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14413
2014-09-01 21:03:54 +00:00
Julian Seward
0b41710542 Rename a bunch of __unused fields to __unused0, since some Android
NDK's appear to #define __unused to __attribute__((__unused__)),
causing the build to fail in bizarre ways.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14412
2014-09-01 20:50:56 +00:00
Philippe Waroquiers
950ce7e9d0 Fix typo in deprecate msg + reformat to 80 char max
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14411
2014-09-01 20:47:55 +00:00
Julian Seward
8189d0c129 Remove two extraneous Ls introduced by mistake in r14319, which had
the effect of causing CFLAGS environment variable settings to be
ignored for certain parts of the build (genoffsets.c, for one).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14410
2014-09-01 19:32:07 +00:00
Petar Jovanovic
27823080d3 mips64: add missing system call numbers
r14384 introduced use of getdents64 syscall and we missed a system call
value for MIPS64, so it broke the build for it. Add missing values now.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14409
2014-09-01 16:47:34 +00:00
Florian Krohm
10e841dbaa Fix a comment. No functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14408
2014-09-01 15:56:05 +00:00
Mark Wielaard
a93b787140 Bug 338703 helgrind on arm-linux gets false positives in dynamic loader.
There are a couple of issues with helgrind on arm-linux with glibc:

- Thread creation stack traces cannot unwind through clone
  (cfi ends right after syscall)
- ld.so has a special "hard float" name that isn't recognized as special
  (ld-linux-armhf.so.3)
- Races are found when manipulating GOT sections.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14407
2014-09-01 15:29:55 +00:00
Mark Wielaard
3f47256593 Adjust cmdline expected test output after r14401 BZ#337871.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14405
2014-09-01 14:16:49 +00:00
Julian Seward
76aa4710d8 Track vex r2939 (renaming and arg-order change for Iop_Extract{64,V128}).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14404
2014-09-01 11:34:32 +00:00
Julian Seward
e4e8111405 Remove memory (load/store) tests from integer.c and move them
into their own file, memory.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14403
2014-09-01 09:35:42 +00:00
Julian Seward
cd529fcc23 Remove unused variable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14402
2014-09-01 08:41:43 +00:00
Florian Krohm
be54c05513 Deprecate --db-attach Fixes BZ #337871
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14401
2014-09-01 06:37:07 +00:00
Florian Krohm
da636e0ae2 Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14400
2014-09-01 06:30:34 +00:00
Philippe Waroquiers
3159bc49c8 Improve description of an address that is on a stack but below sp.
An address below the sp will be described as being on a stack, but below sp.

The stack for such an address is found in the registered stacks.

Also, if there is a guard page at the end of the stack (lowest address)
an address in this page will be described as being in thread guard page.
A guard page is recognised as being a page not readable/writable/executable.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14399
2014-08-31 22:27:19 +00:00
Mark Wielaard
8d4524f6a1 Bug 338681 Enable clone backtrace hack for i386-linux in helgrind.
glibc doesn't provide CFI unwind information right after the clone call
(because it would be invalid in the child). Enable the same workaround
for i386-linux that is already used for amd64-linux (subtract 3 from ip).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14398
2014-08-30 20:37:40 +00:00
Julian Seward
ffdff34aef Fix (kludge) stack unwinding through clone on arm64-linux. This is
the same problem as shown in #338681, except for arm64-linux instead
of x86-linux.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14397
2014-08-30 19:24:05 +00:00
Julian Seward
24b6d8ea1f Helgrind needs to know the soname of ld.so, and on arm64-linux
it is different (ld-linux-aarch64.so.1) from all other targets.
(Why?)  This makes Helgrind at least somewhat usable on arm64-linux.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14396
2014-08-30 19:21:48 +00:00
Julian Seward
917e8e40f8 Initial triage pass for all remaining newly opened bugs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14395
2014-08-30 10:09:30 +00:00
Bart Van Assche
ed8d0edf04 drd/tests/pth_create_chain: Reduce stack usage
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14394
2014-08-30 06:48:01 +00:00
Philippe Waroquiers
23ced45c48 document in NEWS the fact that stack registration start/end boundaries
are the lowest/highest addressable bytes


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14393
2014-08-29 23:24:20 +00:00
Philippe Waroquiers
51c6c85e22 The semantic of the stack bounds is not consistent or is not described.
At various places, there were either some assumption that the 'end'
boundary (highest address) was either not included, included,
or was the highest addressable word, or the highest addressable byte.
This e.g. was very visible when doing:
  ./vg-in-place -d -d ./helgrind/tests/tc01_simple_race|&grep regi
giving
  --24040:2:stacks     register 0xBEDB4000-0xBEDB4FFF as stack 0
  --24040:2:stacks     register 0x402C000-0x4A2C000 as stack 1
showing that the main stack end was (on x86) not the highest word
but the highest byte, while for the thread 1, the registered end
was a byte not part of the stack.

The attached patch ensures that stack bounds semantic are documented and
consistent. Also, some of the stack handling code is factorised.

The convention that the patch ensures and documents is:
start is the lowest addressable byte, end is the highest addressable byte.
(the words 'min' and 'max' have been kept when already used, as this wording is 
consistent with the new semantic of start/end).

In various debug log, used brackets [ and ] to make clear that
both bounds are included.

The code to guess and register the client stack was duplicated
in all the platform specific syswrap-<plat>-<os>.c files.
Code has been factorised in syswrap-generic.c

The patch has been regression tested on
   x86, amd64, ppc32/64, s390x.
It has been compiled and one test run on arm64.
Not compiled/not tested on darwin, android, mips32/64, arm


More in details, the patch does the following:

coregrind/pub_core_aspacemgr.h
include/valgrind.h
include/pub_tool_machine.h
coregrind/pub_core_scheduler.h
coregrind/pub_core_stacks.h
  - document start/end semantic in various functions
 also in pub_tool_machine.h:
  - replaces unclear 'bottommost address' by 'lowest address'
    (unclear as stack bottom is or at least can be interpreted as
     the 'functional' bottom of the stack, which is the highest
      address for 'stack growing downwards').
coregrind/pub_core_initimg.h
  replace unclear clstack_top by clstack_end
coregrind/m_main.c
  updated to clstack_end

coregrind/pub_core_threadstate.h
  renamed client_stack_highest_word to client_stack_highest_byte
coregrind/m_scheduler/scheduler.c
  computes client_stack_highest_byte as the highest addressable byte
  Update comments in call to VG_(show_sched_status)
coregrind/m_machine.c
coregrind/m_stacktrace.c
  updated to client_stack_highest_byte, and switched 
    stack_lowest/highest_word to stack_lowest/highest_byte accordingly

coregrind/m_stacks.c
  clarify semantic of start/end,
  added a comment to indicate why we invert start/end in register call
  (note that the code find_stack_by_addr was already assuming that
  end was included as the checks were doing e.g.
    sp >= i->start && sp <= i->end

coregrind/pub_core_clientstate.h
coregrind/m_clientstate.c
  renames Addr  VG_(clstk_base) to Addr  VG_(clstk_start_base)
    (start to indicate it is the lowest address, base suffix kept
     to indicate it is the initial lowest address).

coregrind/m_initimg/initimg-darwin.c
   updated to  VG_(clstk_start_base)
   replace unclear iicii.clstack_top by iicii.clstack_end
   updated clstack_max_size computation according to both bounds included.

coregrind/m_initimg/initimg-linux.c
   updated to  VG_(clstk_start_base)
   updated VG_(clstk_end) computation according to both bounds included.
   replace unclear iicii.clstack_top by iicii.clstack_end

coregrind/pub_core_aspacemgr.h
  extern Addr VG_(am_startup) : clarify semantic of the returned value
coregrind/m_aspacemgr/aspacemgr-linux.c
   removed a copy of a comment that was already in pub_core_aspacemgr.h
     (avoid double maintenance)
   renamed unclear suggested_clstack_top to suggested_clstack_end
    (note that here, it looks like suggested_clstack_top was already
     the last addressable byte)

* factorisation of the stack guessing and registration causes
  mechanical changes in the following files:
      coregrind/m_syswrap/syswrap-ppc64-linux.c
      coregrind/m_syswrap/syswrap-x86-darwin.c
      coregrind/m_syswrap/syswrap-amd64-linux.c
      coregrind/m_syswrap/syswrap-arm-linux.c
      coregrind/m_syswrap/syswrap-generic.c
      coregrind/m_syswrap/syswrap-mips64-linux.c
      coregrind/m_syswrap/syswrap-ppc32-linux.c
      coregrind/m_syswrap/syswrap-amd64-darwin.c
      coregrind/m_syswrap/syswrap-mips32-linux.c
      coregrind/m_syswrap/priv_syswrap-generic.h
      coregrind/m_syswrap/syswrap-x86-linux.c
      coregrind/m_syswrap/syswrap-s390x-linux.c
      coregrind/m_syswrap/syswrap-darwin.c
      coregrind/m_syswrap/syswrap-arm64-linux.c
 Some files to look at more in details:
  syswrap-darwin.c : the handling of sysctl(kern.usrstack) looked
    buggy to me, and has probably be made correct by the fact that
     VG_(clstk_end) is now the last addressable byte. However,unsure
    about this, as I could not find any documentation about 
    sysctl(kern.usrstack). I only find several occurences on the web,
    showing that the result of this is page aligned, which I guess
    means it must be 1+ the last addressable byte.
  syswrap-x86-darwin.c and syswrap-amd64-darwin.c
   I suspect the code that was computing client_stack_highest_word
   was wrong, and the patch makes it correct.
  syswrap-mips64-linux.c
    not sure what to do for this code. This is the only code
    that was guessing the stack differently from others.
    Kept (almost) untouched. To be discussed with mips maintainers.

coregrind/pub_core_libcassert.h
coregrind/m_libcassert.c
  * void VG_(show_sched_status):
     renamed Bool valgrind_stack_usage to Bool stack_usage
     if stack_usage, shows both the valgrind stack usage and
     the client stack boundaries
coregrind/m_scheduler/scheduler.c
coregrind/m_gdbserver/server.c
coregrind/m_gdbserver/remote-utils.c
   Updated comments in callers to VG_(show_sched_status)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14392
2014-08-29 22:53:19 +00:00
Philippe Waroquiers
6375fdd9cc make prereq fail with 1 if host command not installed
as prereq must return 0 or 1. Any other return value aborts the regtests.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14391
2014-08-29 22:49:21 +00:00
Philippe Waroquiers
ac73d50e9c Add missing file in EXTRA_DIST
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14390
2014-08-29 22:48:27 +00:00
Julian Seward
fd1166d11d arm64: record the use of x8 as of vex r2938.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14389
2014-08-29 22:02:56 +00:00
Mark Wielaard
e5ce1c9b68 With gcc 4.9.1 exp-sgcheck/tests/globalerr sees array "a", not unknown.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14388
2014-08-29 21:18:17 +00:00
Julian Seward
db85fec898 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14387
2014-08-29 19:34:45 +00:00
Julian Seward
7cdd4e056e run_thread_for_a_while: Make the computation of done_this_time less
bogus, and in particular ensure that it can't be zero if in fact the
thread did do some useful work.  Fix up a couple of associated
assertions.  Fixes #336435.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14386
2014-08-29 19:12:38 +00:00
Mark Wielaard
a909919fee none/tests/res_search.vgtest: Add prereq that domain can be resolved.
Some autobuilders/testers don't allow network access.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14385
2014-08-29 18:35:54 +00:00