Commit Graph

10827 Commits

Author SHA1 Message Date
Mark Wielaard
93ad03c5bb Omit frame pointer also for main in ppc ldst_multiple test.
Other functions already explicitly omitted the frame pointer. Also
do that for main to prevent gcc 4.8.2 complaining:

 ldst_multiple.c: In function ‘main’:
 ldst_multiple.c:180:5: error: frame pointer required, but reserved
  int main(void)
      ^
 ldst_multiple.c:31:18: note: for ‘r31’
  register HWord_t r31 asm("r31");

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14173
2014-07-17 13:29:43 +00:00
Mark Wielaard
c07cc50ab1 ppc64 ifunc_wrapper add casts suggested by gcc warning.
vg_preloaded.c: In function ‘_vgnU_ifunc_wrapper’:
vg_preloaded.c:91:13: warning: assignment makes integer from pointer without a cast [enabled by default]

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14172
2014-07-17 10:56:26 +00:00
Philippe Waroquiers
e8fa6306ad Unbreak ppc32 compilation (remove last usage of host_ppc32_regalign_int64_args)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14171
2014-07-17 05:22:06 +00:00
Philippe Waroquiers
44cc7cb053 Fix name of the file in the header comment
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14170
2014-07-16 21:16:10 +00:00
Florian Krohm
a3989a1fd9 Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14169
2014-07-16 08:20:54 +00:00
Florian Krohm
53785bf372 Add testcase from BZ #324149 which was forgotten in r13641.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14168
2014-07-16 08:18:17 +00:00
Mark Wielaard
c8e8680376 Fix pointer qualifier discard warnings in memcheck/tests/varinforestrict.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14167
2014-07-15 21:55:53 +00:00
Philippe Waroquiers
a6ffc04b1c produce cfsi and str dedup pa at the same verbosity level
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14166
2014-07-15 19:46:15 +00:00
Mark Wielaard
91c93d3896 Bug 336619 valgrind --read-var-info=yes doesn't handle DW_TAG_restrict_type.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14165
2014-07-15 15:47:25 +00:00
Julian Seward
b8805a006b arm64: get_Dwarf_Reg: at least handle the case of requesting XSP
instead of failing.  This makes some of the memcheck/tests/varinfo*
tests work somewhat correctly on arm64-linux.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14164
2014-07-15 15:22:41 +00:00
Mark Wielaard
03eb8f43a7 Bug 337094 ifunc wrapper is broken on ppc64.
ppc64 uses function descriptors, so we need to get the actual function
entry address for the VG_USERREQ__ADD_IFUNC_TARGET client request, but
we need to return the function descriptor itself from the ifunc_wrapper.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14163
2014-07-15 15:07:01 +00:00
Julian Seward
c7447dcad0 add test cases for "LD1/ST1 (multiple 1-elem structs to/from 2 regs,
post index)" (16b only)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14162
2014-07-15 11:09:51 +00:00
Philippe Waroquiers
2a49250682 Small fixes in 'getting started' section of user manual
* Mention --read-inline-info=yes as an alternative to compile without inlining.

* Mention that stabs debuginfo reader is not working anymore since 3.9.0



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14160
2014-07-14 22:04:17 +00:00
Philippe Waroquiers
2b1ae38fe1 Slightly refined the NEWS entry for silly/fishy args
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14159
2014-07-14 21:39:11 +00:00
Philippe Waroquiers
c99e3af927 This patch decreases significantly the memory needed to store the lineloc info.
On a big executable, the trunk needs:
dinfo: 134873088/71438336  max/curr mmap'd, 134607808/66717872 max/curr

With the patch, we have:
dinfo: 99065856/56836096  max/curr mmap'd,   97883776/51663656 max/curr

So, peak dinfo memory decreases by about 36Mb, and final by 15Mb.

(for info, valgrind 3.9.0 uses
dinfo: 158941184/109666304  max/curr mmap'd, 156775944/107590656 max/curr
So, compared to 3.9.0, dinfo peak decreases by about 40%, and the final
memory is divided by more than 2).

The memory decrease is obtained by:

* using a dedup pool to store filename/dirname pair for the loctab source/line
  information.
  As typically, there is not a lot of such pairs, typically a UShort is
  good enough to identify a fn/dn pair in a dedup pool.
  To avoid losing memory due to alignment, the fndn indexes are stored
  in a "parallel" array to the DiLoc loctab array, with entries having
  1, or 2 or 4 bytes according to the nr of fn/dn pairs in the dedup pool.
  See priv_storage.h comments for details.

  (there was a extensible WordArray local implementation in readdwarf.c.
   As with this change, we use an xarray, the local implementation was
   removed).

* the memory needed for --read-inline-info is slightly decreased (-2Mb)
  by removing the (unused) dirname from the DiInlLoc struct.
  Handling dirname for inlined function caller implies to rework
  the dwarf3 parser read_filename_table common to the var and inlinfo parser.
  Waiting for this to be done, the dirname component is removed from DiInlLoc.

* the stabs reader (readstabs.c) is broken since 3.9.0. 
  For this change, the code has been updated to make it compile with the new
  DiLoc/FnDn dedup pool. As the code is completely broken, a vg_assert(0)
  has been put at the begin of the stabs reader.

* the pdb reader (readpdb.c) has been trivially updated and should still work.
  It has not been tested (how do we test this ?).
  A follow-up patch will be done to avoid doing too many calls to
  ML_(addFnDn) : instead of having one call per ML_(addLineInfo), one
  should have a single call done when reading the filename table.

This has also be tested in an outer/inner setup, to verify no
memory leak/bugs.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14158
2014-07-14 21:20:57 +00:00
Florian Krohm
0e951964ef Provide a back trace when a function argument of a known allocation
function is presumably negative. Fixes BZ 79311.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14157
2014-07-13 14:41:55 +00:00
Bart Van Assche
a7401620ad drd/tests/std_thread*: Add a workaround for an Ubuntu 14.04 gcc bug
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14156
2014-07-12 09:30:14 +00:00
Florian Krohm
e54abd4ed8 Track vex r2891 (add Iop_Reverse1sIn8_x16). Unbreak build.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14155
2014-07-11 21:54:33 +00:00
Florian Krohm
aef15e280d Announce fix for BZ #336957
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14154
2014-07-11 21:32:23 +00:00
Florian Krohm
6df4131600 Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14153
2014-07-11 20:48:30 +00:00
Julian Seward
5a254c7950 arm64: enable test cases for:
{sli,sri} (vector & scalar), sqabs (vector & scalar)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14152
2014-07-11 12:06:24 +00:00
Tom Hughes
90f471b945 Move DRM ioctl handlers to the right places. Fixes r13486 breakage.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14151
2014-07-10 14:56:48 +00:00
Tom Hughes
ceb1ad640a Add support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
commands. BZ#337285.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14150
2014-07-10 14:50:06 +00:00
Tom Hughes
82ec0b5d43 Add support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
commands. BZ#337285.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14149
2014-07-10 14:48:00 +00:00
Julian Seward
26296e07c9 Enable test cases for: shll #imm, shrn #imm, rshrn #imm,
{smlal,umlal,smlsl,umlsl,smull,umull} (elem)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14148
2014-07-10 14:23:16 +00:00
Philippe Waroquiers
0f410627f6 Rollback the (functional) effect of 13944 and 14134
Re-opening the FIFO before closing it gives (difficult to understand)
problems => rollback the change that keeps the FIFO opened.
Rather handle the race condition by retrying at vgdb side.
See extensive comments in remote-utils.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14147
2014-07-08 22:28:26 +00:00
Philippe Waroquiers
076f1c0157 Apply text_debug_bias to inline IP extracted from dwarf3
Without this biasing, inline info is not correct for shared objects.
Updated test varinfo5 to use --read-inline-info=yes and added
an inline test case. 
Note: the varinfo reader does not understand the inlining info, and
so variables in inlined functions are not properly described.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14146
2014-07-08 18:56:47 +00:00
Julian Seward
9da76f2345 Add a 32-bit-process only suppression, for OSX 10.8. Equivalent to
that of r14142 for 10.9.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14145
2014-07-08 16:59:02 +00:00
Julian Seward
0e16747b71 Change the default setting --partial-loads-ok from "no" to "yes"
for Mac OS only.  All other targets remain at "no".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14144
2014-07-08 09:36:06 +00:00
Julian Seward
2a7a6345ba OSX 10.8/10.9: remove warning message.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14143
2014-07-08 08:18:55 +00:00
Julian Seward
7c9d322917 Add a 32-bit-process-only suppression.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14142
2014-07-08 08:10:14 +00:00
Julian Seward
c8e61f0aa4 Make sanity check errors before/after syscalls be fatal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14141
2014-07-08 08:05:02 +00:00
Julian Seward
6a142998c6 Accuracy improvements to syscall wrappers for OSX 10.8 and 10.9.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14140
2014-07-08 08:04:25 +00:00
Julian Seward
1ffd6d9b6e OSX 10.9/10.8: Debuginfo reading FSM: enable recording of r-- mappings
so as to enable arrival at acceptance states via calls to
VG_(di_notify_vm_protect).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14139
2014-07-08 07:55:44 +00:00
Julian Seward
ff80e8f74f Improve debug printing for the should-we-load-debuginfo-now? finite
state machine.  No functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14138
2014-07-08 07:50:19 +00:00
Julian Seward
79fc99191b Darwin only: don't tell aspacemgr about the kernel commpage -- only
tell the tool.  This is because telling the aspacemgr about it causes
the sync checker to fail entirely on Darwin.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14137
2014-07-08 07:44:07 +00:00
Julian Seward
e9fa7e1483 Add -Wno-tautological-compare to the standard compile flags, if that
is accepted.  With XCode 5.5.1 -Wtautological-compare appears to come
as standard, and it generates a lot of mostly useless noise.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14136
2014-07-08 07:40:56 +00:00
Philippe Waroquiers
4dac969352 Mark inline get function in image.c
(called very often, and has a fast/slow case)
This slightly improve the performance of reading the image.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14135
2014-07-06 18:35:18 +00:00
Philippe Waroquiers
be2e8b2a80 Follow up to rev 13944
13944 objective was to avoid having a vgdb that connects to a just forked child
that would have the FIFO still opened, while its parent would close it.

However, in case a previous vgdb closed the FIFO, the read FIFO in the parent
is put in 'eof status' by the kernel. So, readchar will then return eof
in the parent unless another vgdb re-opens the FIFO in write.
So, gdbsrv does not stop anymore on error if needed, due to this readchar
giving eof.

The only way to reset this eof condition is to close the fd.
But we must always have the FIFO open (to avoid the race condition that
rev 13944 fixed) 
=> in case of error, first re-open the FIFO, before closing the (previous)
FIFO fd (which is in eof state and cannot be properly used anymore).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14134
2014-07-05 18:43:24 +00:00
Philippe Waroquiers
2c502a3da6 Replace copy/pasted loop of the "range search" by doing a -1 in the loop
for the "equal" case.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14133
2014-07-05 18:37:38 +00:00
Philippe Waroquiers
e37b530896 Small fixes/improvements post-cfsi_m improvement
* Avoid printing the size of a null dedup pool
* Avoid warnings of 2 unused variables on some platforms


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14132
2014-07-05 14:07:43 +00:00
Bart Van Assche
947b85111a NEWS: Mention #336772, --default-suppressions and the std::thread update in the drd manual
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14131
2014-07-05 06:52:48 +00:00
Philippe Waroquiers
4a3b52c13c Small comment fix for the UInt* cfsi_m index : 4 instead of 3
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14130
2014-07-04 22:52:01 +00:00
Philippe Waroquiers
09073639b5 This patch decreases significantly the memory needed to store the cfsi info.
On a big executable, the trunk needs:
dinfo: 155844608/106737664  max/curr mmap'd 155572624/102276760 max/curr

With the patch, we have:
dinfo: 134873088/70389760  max/curr mmap'd 134607808/66717512 max/curr

So, peak dinfo memory decreases by 21Mb, and final by 36Mb.

The memory decrease is obtained by:

* using a dedup pool to store the machine dependent part (cfsi_m)
  of the cfsi information as this information is highly duplicated.
  For x86 and arm64, the duplication factor of cfsi machine dependent
  part is very high (up to a factor 60).
  For arm64, it is more like a factor 3.
  A 'variable size' (1, 2 or 4 bytes) is automatically used to identify
  the cfsi_m, if there is less than or more than 255/64K different cfsi_m.

* not storing explicitely the length of a range for which a cfsi_m
  is to be used: in a large majority of the cases, ranges are
  consecutive, and so the end of a range is just one byte before
  the start of the next range.
  So, we do not store the length of the ranges.
  If there is a hole between 2 ranges, the hole is stored explicitely
  as a range in which we have no cfsi_m information.
  On x86 and amd64, we have quite some holes (something like one hole
  every 7 cfsi). On arm64, we have very few holes (less than one hole
  every 50 cfsi).
  Even with the nr of holes on x86/amd64, it is more memory efficient
  to store the holes rather than to store the length of each cfsi.

* Merging consecutive ranges that have the same cfsi_m info:
  Many cfsi are "mergeable": there is no hole between 2 cfsi, and their
  machine dependent part is identical
  (I guess the unwind info needed by valgrind is subset of the full
   unwind info, and so, the cfsi entries are not merged by the compiler,
   but can be merged for simple unwind). Depending on the platform
   (x86, amd64, arm64) and of the library/object file, we can have a
   significant nr of mergeable entries. 


The patch is not very small, but a lot is mechanical changes.

The patch has been compiled and tested on x86/amd64/ppc32/ppc64
(but ppc does not use cfsi so that just verifies it compiles).
It has been compiled on arm64, and "tested" by launching valgrind on
one executable.
It has not been compiled on s390 and mips.
With some luck, maybe it will compile on these platforms.
And if that uses the whole provision of luck for 2014, it might even work
on these platforms :).
If it does not compile, the fix should be straightforward.
Runtime problems might be more tricky (but arm64 "worked out of the box"
once x86/amd64 were ok).

This has also be tested in an outer/inner setup, to verify no memory leak/bugs.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14129
2014-07-04 22:36:38 +00:00
Philippe Waroquiers
33f246ee58 Shadow registers wronly shown by gdb on avx machine
For an unclear reason, the orig_rax register and its shadows are described in the
xml file using a register number.
This register number is correct on non avx machine, but is wrong on
avx machine, as these have more registers, which means that orig_raxs1 and s2
should have different numbers.

As no reason was found to have a register number explicitely give, remove this
regnnr from the xml file, and let gdb calculate it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14128
2014-07-04 21:53:29 +00:00
Philippe Waroquiers
cae97b0c66 Fix a bug in the "numbering" dedup pool: as indicated in
pub_tool_deduppoolalloc.h, for "numbering" pool, there is no guarantee
that the address of an element is stable if a new element is inserted.
But m_deduppoolalloc.c was itself not taking this 'no guarantee' into account.
So, when the addresses of the elements are changed due to reallocation
of the only pool, apply an offset to the element addresses stored in
the dedup hash table.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14127
2014-07-04 20:40:02 +00:00
Florian Krohm
9ab8999e43 Silence a compiler warning as issued by certain versions of GCC.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14126
2014-07-03 08:23:23 +00:00
Florian Krohm
d126209ba4 Add forgotten .exp file. Should have been prt of r14124.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14125
2014-07-01 08:03:16 +00:00
Florian Krohm
c40d351f36 Update the C++ demangler by importing files from GCC trunk @ 212125.
Add a smoke test for the demangler and update the helper script.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14124
2014-06-30 21:04:16 +00:00
Philippe Waroquiers
4b8dc1d805 Add 'numbering identification' to the dedup pool.
The dedup pool can now be used to allocate elements and identify
them with a number rather than an address.

This new feature is not used (yet) but is intended to be used to
decrease the memory needed to store the CFSI information.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14123
2014-06-30 20:58:32 +00:00