914 Commits

Author SHA1 Message Date
Bart Van Assche
7064a05014 drd/tests/Makefile.am: Add dlopen.stdout.exp to EXTRA_DIST
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16344
2017-05-09 05:13:40 +00:00
Bart Van Assche
dca461cf60 drd/tests: Add the "dlopen" test program
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16343
2017-05-09 04:46:20 +00:00
Bart Van Assche
e3bc6c7dc7 drd: Add support for calling pthread_create() from inside a shared library - bug #356374
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16342
2017-05-09 04:45:30 +00:00
Bart Van Assche
06c6edda5e drd: Rename a function
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16341
2017-05-09 04:44:25 +00:00
Ivo Raisr
246bb0e25f Remove TileGX/Linux port.
Fixes BZ#379504.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16340
2017-05-08 17:21:59 +00:00
Ivo Raisr
d8f648486e Fix some spelling mistakes.
Fixes BZ#374719
Patch by: klemens <ka7@la-evento.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16336
2017-05-05 22:13:20 +00:00
Ivo Raisr
38edd50c0e Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16333
2017-05-04 15:09:39 +00:00
Petar Jovanovic
e44daf67e9 update drd/tests/tc23_bogus_condwait.stderr.exp files
Follow up to r16312. drd tests use the same file, so we need to update
its exp files too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16313
2017-04-26 10:15:45 +00:00
Petar Jovanovic
4b49c4ee66 make bar_bad tests more deterministic
Canceling the thread slp2 before the case 5 makes behaviour of this test
more deterministic.
Also, as Philippe W. pointed out, adding --fair-sched=try seems to avoid
variable and sometimes very long run time for these tests.

Related BZ #358213


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16154
2016-11-23 17:38:29 +00:00
Philippe Waroquiers
aa630a3169 Locally define vgPlain_scrcmp in 2 unit tests
Humph, this should have been part of :
   16122 Add VG_(strIsMemberXA) in pub_tool_xarray.h
which means that between 16122 and this revision, these 2 unit tests
will (very probably) not compile.
That will make bissect not easy :(


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16126
2016-11-11 14:26:54 +00:00
Mark Wielaard
ee8cfbc434 Add libc_test to workaround pth_cond_destroy_busy test hangs.
This is a workaround for bug #371396. It adds a new test program
that can be used skip tests given a specific libc implementation
and optionally a specific minimum version. Currently only glibc
is recognized. This is used for the drd and helgrind tests
pth_cond_destroy_busy to be skipped on glibc 2.24.90+.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16097
2016-10-21 00:02:10 +00:00
Mark Wielaard
be052139d6 Don't require the current working directory to exist. Bug #369209.
At startup valgrind fetches the current working directory and stashes
it away to be used later (in debug messages, read config files or create
log files). But if the current working directory didn't exist (or there
was some other error getting its path) then valgrind would go in an
endless loop. This was caused by assuming that any error meant a larger
buffer needed to be created to store the cwd path (ERANGE). However
there could be other reasons calling getcwd failed.

Fix this by only looping and resizing the buffer when the error is
ERANGE. Any other error just means we cannot fetch and store the current
working directory. Fix all callers to check get_startup_wd() returns
NULL. Only abort startup if a relative path needs to be used for
user supplied relative log files. Debug messages will just show
"<NO CWD>". And skip reading any config files from the startup_wd
if it doesn't exist.

Also add a new testcase that tests executing valgrind in a deep,
inaccessible and/or non-existing directory (none/tests/nocwd.vgtest).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15989
2016-10-01 11:54:38 +00:00
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