Florian Krohm [Sat, 18 Oct 2014 10:58:05 +0000 (10:58 +0000)]
Change the definition of VgHashTable to not have pointer type.
This is (a) consistent with how the other containers are defined
and, more importantly, (b) allows the constification of the hash table API.
Julian Seward [Fri, 17 Oct 2014 15:05:01 +0000 (15:05 +0000)]
-Wmissing-enum seems to have arrived at the MacOS builds for some
reason, and complains about missing cases in sr_isError, sr_Res,
sr_ResHI, sr_Err. Add cases to keep it happy.
Julian Seward [Wed, 15 Oct 2014 16:12:11 +0000 (16:12 +0000)]
di_notify_ACHIEVE_ACCEPT_STATE: before starting to parse the ELF file,
truncate overlaps in the DebugInfoMappings that have been collected by
the DebugInfo's FSM. Not doing so can confuse ML_(read_elf_debug_info)'s
computation of bias values. Observed to be a problem when reading EDIDX
sections for objects mangled by Mike Hommey's elfhack program.
See http://bugzilla.mozilla.org/show_bug.cgi?id=788974
Florian Krohm [Tue, 14 Oct 2014 21:01:33 +0000 (21:01 +0000)]
Merge revisions 14210 and 14626 from the BUF_REMOVAL branch to trunk.
Change VG_(resolve_filename) to not truncate the result which is returned
in a static buffer now. Fix callsites.
Simplify VG_(di_notify_pdb_debuginfo) to use VG_(resolve_filename).
Fix VG_(readlink) prototype.
Julian Seward [Mon, 13 Oct 2014 13:03:50 +0000 (13:03 +0000)]
Modify the compiler detection test so as to accept "Apple LLVM version
5.1" (etc) and identify it as a Clang variant. Without that, it gets
misidentified as a gcc variant, which causes problems with Makefile.am's
that use the derived COMPILER_IS_CLANG conditional.
follow up to fix for 339721 assertion 'check_sibling == sibling' failed in readdwarf3.c ...
The fix committed in revision 14603 is properly fixing the bug 339721.
However, when enabling the dwarf tracing, the DW_FORM_ref_sig8 causes
a segmentation violation, as the tracing code is shared with the
reading code. But the DW_FORM_ref_sig8 reading code is dereferencing
some data structure that is only initialised when --read-var-info=yes.
So, in case DW_FORM_ref_sig8 form reading is done and --read-var-info=no,
then check that we are tracing, and avoid dereferencing the (not initialised)
signature hash table.
Florian Krohm [Tue, 7 Oct 2014 18:36:28 +0000 (18:36 +0000)]
Merge revisions 14372 and 14607 from the BUF_REMOVAL branch to trunk.
This change makes VG_(clo_suppressions), VG_(clo_fullpath_after),
and VG_(clo_req_tsyms) XArrays. They used to be arrays of fixed size.
Florian Krohm [Tue, 7 Oct 2014 14:28:52 +0000 (14:28 +0000)]
Merge revisions 14230, 14602, and 14604 from the BUF_REMOVAL branch to trunk.
The change eliminates the fixed size buffers in gen_suppression and
show_used_suppressions. This is achieved by changing the return type from
VG_TDICT_CALL(tool_get_extra_suppression_info and
VG_TDICT_CALL(tool_print_extra_suppression_use from Bool to SizeT.
A return value of 0 indicates that nothing (except the terminating '\0'
which is always inserted) was written to the buffer. This corresponds to the
previous False return value. A return value which is equal to the buffer
size (that was passed in as function argument) indicates that the buffer was
not large enough. The caller then resizes the buffer and retries.
Otherwise, the buffer was large enough.
Regtested with a resize value of 1.
fix 339721 assertion 'check_sibling == sibling' failed in readdwarf3.c ...
The skip code was wrongly skipping 16 bytes, while only 8 are read
for a DW_FORM_ref_sig8.
Note that the problem is made visible by an assert when using
--trace-symtab=yes but in fact this is a real bug in the dwarf reader,
that was introduced in one of the optimisations done for the inline info.
It can manifest itself with other symptoms:
One of the 2 following assertions can fail:
vg_assert (check_sibling == sibling);
vg_assert (get_position_of_Cursor (&check_skip)
== get_position_of_Cursor (&c));
Or the following error can be given:
--29973-- WARNING: Serious error when reading debug info
--29973-- When reading debug info from /home/philippe/valgrind/trunk_untouched/memcheck/tests/dw4:
--29973-- Overrun whilst reading .debug_info section
Florian Krohm [Mon, 6 Oct 2014 21:04:14 +0000 (21:04 +0000)]
Followup to r14600. Copy the contents of pub_core_guest.h to pub_tool_guest.h
to make it available to tools. This allows to remove quite a bit of
ifdeffery from memcheck's mc_machine.c
Florian Krohm [Mon, 6 Oct 2014 16:41:14 +0000 (16:41 +0000)]
Entangle header files a bit. Specifically, pub_core_basics.h no longer
includes libvex.h. It isn't needed to successfully compile pub_core_basics.h
standalone and the declarations libvex.h provides aren't used as broadly as
the comment in the code implied.
Move the guest-specific includes and some ifdeffery to the new file
pub_core_guest.h
For the curious reader: The change above avoids a problem when linking the
linux-launcher which previously included libvex.h indirectly. libvex.h also
defines the inline function LibVEX_Alloc which, when emitted, causes the
link step to fail due to unresoled references (as the launcher does not link
against libvex.a). See also BZ #339542.
Florian Krohm [Wed, 1 Oct 2014 14:16:05 +0000 (14:16 +0000)]
Merge revisions 14337, 14596 from the BUF_REMOVAL branch to trunk.
Change callgrind's init_cmdbuf function to allocate a large enough
buffer for the command line.
Merge six easy pieces from the BUF_REMOVAL branch:
r14271 Audit a few buffer sizes, increase one.
r14280 Audit buffer size.
r14296 Remove a few unneeded header files.
r14310 Replace fixed size buffers with a large enough buffers.
r14338 Remove a dead assignment in print_bbcs and make global variable
print_fd a local variable.
r14359 Remove a benign macro redefinition in cachegrind.
Merge revisions 14216,14591,14593 from the BUF_REMOVAL branch to trunk.
Chang the semantics of VG_(getgroups) to support querying the number
of supplementary group IDs which simplifies obtaining them and gets
rid of fixed size buffers.
Merge revisions 14212 and 14586 from the BUF_REMOVAL branch to trunk.
The change eliminates the use of fixed size buffers for path names.
There was a comment in the code that dynamic memory allocation could
not be used. But that is no longer true.
Clean up #includes.
Merge r14229 from the BUF_REMOVAL branch to trunk.
Function MC_(snprintf_delta) requires a buffer of size 31 or larger to
avoid overflow.Add an assert, change and document the buffer size and
fix all call sites. Remove magic constants along the way.
Merge r14208 from BUF_REMOVAL branch to trunk.
In function read_dot_valgrindrc use a large enough buffer
allocated on the stack.
Also assert that the passed in directory is not NULL. This is
true at all call sites. The old code would have attempted to read
/.valgrindrc for dir == NULL and I don't think we want that.
Merge 14206,14207,14261,14577,14578 from BUF_REMOVAL branch to trunk.
This changes VG_(record_startup_wd) to dynamically allocate a large
enough buffer for the directory name. As the dynamic memory manager has
started up a while ago, this is quite safe. Also rewrite VG_(get_startup_wd)
to simply return the directory name. No more messing with copying it
around. Adapt call sites.
Merge revisions 14203,14574,14575 from the BUF_REMOVAL
branch to trunk.
This change eliminates the fixed size buffers in VG_(basename)
and VG_(dirname).
Remove unneeded header file which does not exist on Darwin.
Disable test for darwin as pthread_setname_np is not implemented.
But setting and observing the threadname is what this test is all about.
Petar Jovanovic [Sat, 27 Sep 2014 05:18:21 +0000 (05:18 +0000)]
mips: extend mips_features with a check for FPU
Extend mips_features with "hard-float" query to which mips_features will
respond whether or not the platform is meant to have a floating point unit.
The query is not a runtime check, but a built-time check.
The testbuckets none/tests/ppc{32,64} did not build in case the
toolchain did not support -maltivec -mabi=altivec.
This should work now. Fixes BZ #338731
Handle explicitely all enum values in 'switch' on AddrInfo tag
(reported by Florian)
Note that Addr_Undescribed will cause an assert if such
an undescribed addrinfo is pretty printed, as normally
such addrinfo should always be described before being pretty printed.
Mark Wielaard [Thu, 18 Sep 2014 12:24:53 +0000 (12:24 +0000)]
Old STABS code is still being compiled, but never used. Remove it.
Since valgrind 3.9.0 the STABS support was already disabled completely.
But the code was still there being compiled and we were still searching
for stabs sections in binaries. Completely remove all sources, tests and
references. Add a note to coregrind/m_debuginfo/README.txt to mention
the old code can be found in the subversion repository.
Prepare NEWS sections for the next release 3.11.0
+ add fixed bug
339020 - ppc64: memcheck/tests/ppc64/power_ISA2_05 failing in nightly build
in the fixed bugs section.
Carl Love [Wed, 17 Sep 2014 17:43:08 +0000 (17:43 +0000)]
Valgrind regression test fix for stfdpx instruction.
There is a bug in the stfdpx instruction test for ppc32 and ppc64.
The inline assembly to move the arguments into the registers before
the store instruction were moving from the register not to the
register. The error has been fixed. This results in a change in
the expected output.
Additionally, it was noted that the inline assembly was using "f" rather
then "d" for the double arguments. Similarly, the prints should have
been %lf not %f for doubles. These changes were made but they did not
change the output of the tests.
coregrind files shall use vg_assert not tl_assert.
Tool files shall use tl_assert not vg_assert.
Fix code accordingly.
Adapted check_headers_and_includes to make sure the code
stays clean in that respect.
Remove a comment that is no longer valid. The real reason we (now)
don't provide strtoll etc is that we don't need the flexibility and
are too lazy to implement the general case :) But that does not
warrant a comment in the code.
Tidy up m_wordfm.
First, as the allocator function does not fail, there is no need
to assert its return value.
Second, remove commented out (since r8765) function VG_(isEmptyFM).
Third, remove VG_(getNodeSizeFM) from the API. The details of the
implementation do not need to be exposed.
Fourth, for consistency require that the copy functions for keys and
values in VG_(dopyFM) (which are essentially like allocators) return
non-NULL values for non-NULL arguments if they return.
Fifth, document NULL-ness of return values for VG_(newFM), VG_(dopyFM),
and VG_(newBag). Remove pointless asserts at call sites.
Six, change avl_dopy to assert that the node the function is
supposed to copy is not NULL. It is called that way anyhow. With
that change the function never returns NULL which allows us to
simplify the call sites. Checking the return value is no longer needed.
Tidy up m_oset.c
- Document that the allocation function must ot return NULL.
- As a conequence of the previous requirement the various Create and AllocNode
functions cannot return NULL. Remove pointless asserts at call sites.
- Remove documentation of undefined function CreateWithCmp.
- Names of library functions (such as 'free') are reserved as a are names
beginning with underscores. Don't use those.