902 Commits

Author SHA1 Message Date
Ivo Raisr
4e6b94f570 Fix expected error output of drd/tests/bar_bad* on Solaris.
On Solaris, we still do get error reports about destroying
a barrier which was never initialized even after SVN r15962.
We also get an error report about destroying barrier bar3
which is still waited upon by a thread.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15979
2016-09-23 17:23:47 +00:00
Mark Wielaard
5f37e4dcde Workaround bar_bad testcase hanging with newer glibc in helgrind/drd tests.
This is a workaround for bug #358213 helgrind/drd pthread_barrier tests
hangs with new glibc pthread barrier implementation. This makes sure that
the tests don't hang anymore. It does this by creating new threads that
sleep and kill the other threads after some time. But this introduces
some non-determinism that might cause the tests to occassionally fail
(both against old and new glibc implementations).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15962
2016-09-19 14:16:35 +00:00
Mark Wielaard
f2369cbf31 drd/tests/std_thread[2].cpp rename execute_native_thread_routine.
Both tests define a execute_native_thread_routine function that we
took from libstdc++. Unfortunately because of a bug this function
is not local in some versions of libstdc++ and so our similar named
function will clash when trying to link.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70476#c2

Simply rename our version to work around this.

Since we don't build this part of the test code for gcc >= 6, this
issue only happens if the buggy libstdc++ thread code is used together
with gcc 5. This is the case with for example devtoolset-4-gcc-5.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15842
2016-04-02 22:07:59 +00:00
Philippe Waroquiers
f2e1687cb8 Fix misplaced closing parenthesis in various VG_(....) calls
At many places, we have:
   VG_(fun(a,b,c))
instead of
   VG_(fun)(a,b,c)
So, fix these cases, found using:
grep -n -i -e 'VG_([a-z][a-z0-9_]*[^a-z0-9_)]' *.c */*.c */*/*.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15776
2016-01-27 22:35:14 +00:00
Bart Van Assche
85cbffe27b configure.ac: Port to gcc 5
Apparently gcc 5 behaves as follows:
$ gcc -dumpversion
5



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15773
2016-01-25 04:27:25 +00:00
Bart Van Assche
08dcf38562 drd: Improve thread startup code for non-Linux platforms
Ivo Raisr had reported that thread startup was slow on Solaris.
This patch reduces the thread startup time on Solaris.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15687
2015-09-29 05:39:00 +00:00
Florian Krohm
d0cf6ac4fa Suppress unwanted clang 3.7 warnings.
Fix undefined behaviour in perf/tinycc.c


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15616
2015-09-02 15:47:33 +00:00
Julian Seward
adc2dafee9 Update copyright dates, to include 2015. No functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15577
2015-08-21 11:32:26 +00:00
Mark Wielaard
9b322bb026 Also install sigsegv handler in safe-pthread tests wrapper.
In case we do recognize the xend, but detect it is invalid
(used outside a transaction) we generate a segsegv instead
of a sigill. Handle that in the same way in the test case.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15570
2015-08-19 13:26:28 +00:00
Rhys Kidd
b9389efb87 Follow-up fix for r15565: sa_restorer should not be used. n-i-bz.
It is obsolete and not specified by POSIX. See man sigaction on Linux.
No regressions reported.

The following error may be seen on platforms that don't implement this extension:

depbase=`echo tc12_rwl_trivial.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
    gcc -DHAVE_CONFIG_H -I. -I../..  -I../.. -I../../include -I../../coregrind -I../../include -I../../VEX/pub -I../../VEX/pub -DVGA_amd64=1 -DVGO_darwin=1 -DVGP_amd64_darwin=1 -DVGPV_amd64_darwin_vanilla=1 -DVGA_SEC_x86=1 -DVGP_SEC_amd64_darwin=1  -Winline -Wall -Wshadow -Wno-long-long -g -fno-stack-protector  -Wno-format-extra-args -Wno-literal-range -Wno-tautological-constant-out-of-range-compare -Wno-self-assign -Wno-string-plus-int -Wno-uninitialized -Wno-unused-value  -arch x86_64  -MT tc12_rwl_trivial.o -MD -MP -MF $depbase.Tpo -c -o tc12_rwl_trivial.o tc12_rwl_trivial.c &&\
    mv -f $depbase.Tpo $depbase.Po
In file included from tc12_rwl_trivial.c:8:
./safe-pthread.h:37:7: error: no member named 'sa_restorer' in 'struct sigaction'
   sa.sa_restorer = NULL;
   ~~ ^
1 error generated.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15569
2015-08-19 12:18:31 +00:00
Tom Hughes
7678f91cd1 Install the SIGILL handler everywhere so we get consistent
stacks and don't have to worry about __GLIBC_PREREQ not being
defined on all platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15567
2015-08-19 08:27:06 +00:00
Tom Hughes
b22d60778f Attempt to work around issues with xend being executed unconditionally
when a pthread_rwlock is used in an invalid way.

Recent glibcs use transactional memory instructions to do lock ellision
but will sometimes, when locks are used in an invalid way, may calls to
xend on systems which don't support it, on the grounds that the program
is invalid anyway.

So we try and catch and ignore the resulting SIGILL in our tests that
deliberately work with invalid locks.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15565
2015-08-18 10:29:20 +00:00
Florian Krohm
b790e08474 Fix printf format inconsistencies as pointed out by gcc -Wformat-signedness.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15495
2015-08-05 14:38:57 +00:00
Julian Seward
ac60633d65 Bug 345248 - add support for Solaris OS in valgrind
Authors of this port:
    Petr Pavlu         setup@dagobah.cz
    Ivo Raisr          ivosh@ivosh.net
    Theo Schlossnagle  theo@omniti.com
            


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15426
2015-07-21 14:44:28 +00:00
Florian Krohm
7a474c9455 Fix typos in source code. Patch by Dmitriy (olshevskiy87@bk.ru).
Fixes BZ #349874


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15394
2015-07-05 21:53:33 +00:00
Florian Krohm
a727bec9cb Remove configury bits for -Wno-empty-body. It is not needed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15318
2015-06-05 16:03:31 +00:00
Florian Krohm
d655852d69 Remove dependency on bash. Fixes BZ #347978.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15291
2015-05-26 11:52:45 +00:00
Philippe Waroquiers
00ef870633 When process dies due to a signal, show the signal and the stacktrace
at default verbosity


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15251
2015-05-17 18:31:55 +00:00
Carl Love
48814f20f1 Patch 3 in a series of cleanup patches from Will Schmidt
Update the pth_create_chain vgtest prereq to handle the ppc64le architecture
in the same way as ppc64 (BE).
   
This patch fixes Vagrind bugzilla 347322.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15185
2015-05-06 20:16:04 +00:00
Rhys Kidd
d92ece08a3 Properly guard drd/tests/thread_name with HAVE_PTHREAD_BARRIER. Partial fix for BZ#344416 (at least reduces required hacks).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15172
2015-05-01 10:19:22 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Florian Krohm
d47181fd7d Add command line flag --max-threads=<integer> to increase the number of
threads that valgrind can handle. No recompile is needed. 
Part of fixing BZ #337869.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14932
2015-02-13 19:08:26 +00:00
Julian Seward
9dbe973b16 Add some parentheses to keep gcc 5 (prerelease) from complaining.
No functional change.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14877
2015-01-20 00:12:18 +00:00
Florian Krohm
d4828f7d30 Fix a compiler warning about an incompatible format.
Shows up on 32-bit builds only.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14848
2015-01-04 22:47:32 +00:00
Florian Krohm
f1fde81e7d Fix a few VG_(message) invocations. The function does not add a
newline character under the covers.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14796
2014-11-29 17:50:10 +00:00
Bart Van Assche
99a8d401fc drd: Add a consistency check
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14790
2014-11-26 12:47:19 +00:00
Florian Krohm
ac3b22e6af Merge revisions 14445 and 14446 from the BUF_REMOVAL branch to trunk.
Two things:
- remove the buffer argument from VG_(DebugInfo_sect_kind)
- allocate AddrInfo::SectKind::objname dynamically


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14719
2014-11-13 21:41:28 +00:00
Florian Krohm
9d16aabb17 Constify the tool interface.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14642
2014-10-20 19:02:38 +00:00
Florian Krohm
f5e2bdbddc 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14639
2014-10-18 10:58:05 +00:00
Florian Krohm
5929994d48 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14606
2014-10-07 14:28:52 +00:00
Florian Krohm
cd357d71b4 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14595
2014-09-30 22:15:05 +00:00
Bart Van Assche
0b849cee4d drd/tests/std_thread2.supp: Add a suppression pattern
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14585
2014-09-28 18:28:18 +00:00
Florian Krohm
e383c673dd Ripple from constifying parameters of instrumentation functions and
callbacks from VexTranslateArgs. See VEX r2958.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14564
2014-09-24 12:06:55 +00:00
Bart Van Assche
5f0ec345eb DRD: Handle Imbe_CancelReservation properly (clrex on ARM)
This was reported by Florian and was detected by analyzing the
compiler output with -Wswitch-enum enabled.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14549
2014-09-18 07:11:24 +00:00
Bart Van Assche
4187fcf384 drd/Makefile.am: Add -Wswitch-enum
Hopefully one day this compiler flag can be enabled for the entire Valgrind
code base.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14548
2014-09-18 06:54:52 +00:00
Florian Krohm
c88dc7f039 Tidy up m_xarray.c.
VG_(newXA) and VG_(cloneXA) never return NULL. Remove pointless asserts.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14539
2014-09-15 18:50:17 +00:00
Florian Krohm
a51a7bb1db Document the NULL-ness of the return values of HT_construct and HT_to_array.
Audit call sites.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14532
2014-09-13 22:31:13 +00:00
Florian Krohm
2aa67544d6 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14531
2014-09-13 22:04:33 +00:00
Florian Krohm
33f32780a5 VG_(malloc/calloc/strdup) never return NULL (and never will).
So it's pointless to test or assert their return values.
Remove code doing so.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14528
2014-09-12 22:24:51 +00:00
Florian Krohm
bfb5d3fc36 Remove some unneded checks as identified by IBM's BEAM checker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14518
2014-09-11 22:15:39 +00:00
Bart Van Assche
72ce61d241 drd/tests: Follow-up for r14478 - make regression test output independent of --read-inline-info
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14491
2014-09-08 08:04:40 +00:00
Bart Van Assche
e8d6ec699f drd: Make regression test output independent of --read-inline-info
There are plans to enable --read-inline-info=yes for all Valgrind
tools. Hence make the DRD regression test output independent of how
--read-inline-info has been set.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14478
2014-09-06 12:19:23 +00:00
Bart Van Assche
2a8993440e drd/docs/drd-manual.xml: Remove a redundant phrase.
This was reported by Dilyan Palauzov


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14477
2014-09-06 06:23:15 +00:00
Julian Seward
26f0bb05e7 Be more careful to separate build flags for the preload shared objects
as opposed to the valgrind code proper.  In particular, make sure that
-mpreferred-stack-boundary=2 does not get used for the preload shared
objects, since that can cause the stack to become misaligned and leads
to segfaults.  Modified version of a patch from Matthias Schwarzott
(zzam@gentoo.org).  Fixes #324050.

Also, fix the configure check in configure.ac for
-mpreferred-stack-boundary=2 so that it checks whether this is
allowable for 32-bit code generation even on 64-bit (x86) hosts.  This
check was wrong before now and led to 32-bit builds on 64-bit hosts
generating poorer code for speed critical helper functions (eg
helperc_LOADV32le) than on 32-bit builds on 32-bit hosts.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14471
2014-09-05 20:00:22 +00:00
Florian Krohm
ed872a7014 Fix most clang warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14467
2014-09-05 18:30:05 +00:00
Florian Krohm
e65638e8f1 Add std_thread2.supp to the tarball.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14442
2014-09-03 16:59:43 +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
Bart Van Assche
2abde2195e drd/tests/tls_threads: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14314
2014-08-20 06:48:22 +00:00
Florian Krohm
ea9d4bbbeb Make suppression more flexible.
Needed for s390 running Fedora 20.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14276
2014-08-14 14:12:38 +00:00
Bart Van Assche
c907d5f5a1 drd/tests/free_is_write: Reduce stack usage
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14254
2014-08-10 08:14:55 +00:00