933 Commits

Author SHA1 Message Date
Bart Van Assche
5b4029b8cc drd/tests/tsan_thread_wrappers_pthread.h: Fix MyThread::ThreadBody()
See also https://bugs.kde.org/show_bug.cgi?id=402341.
2018-12-19 18:13:31 -08:00
Petar Jovanovic
71be91d2dd make outputs of drd/tests/fork* deterministic
Wait for children to finish before terminating the main process.

This fixes occasional failures of the following tests:

drd/tests/fork-parallel                  (stderr)
drd/tests/fork-serial                    (stderr)
2018-12-12 17:53:43 +00:00
Andreas Arnez
43699f30f6 Add Emacs configuration files
This adds a configuration file ".dir-locals.el" for Emacs to the topmost
directory of the Valgrind source tree, and another such file to the
directory drd/tests.  These files contain per-directory local Emacs
variables.

The following settings are performed:

* The base C style is set to "Linux", indentation is set to 3 columns
  per level, the use of tabs for indentation is disabled, and the fill
  column is set to 80.

* The source files in drd/tests use 2 instead of 3 columns per indentation
  level.
2018-12-05 18:15:57 -08:00
Mark Wielaard
206e81e8ad Fix tsan_unittest.cpp compile error with older compilers.
Older compilers (g++ 4.8.5) don't like '>>':
  error: ‘>>’ should be ‘> >’ within a nested template argument list.
Add an extra space.
2018-12-02 12:39:27 +01:00
Bart Van Assche
65dcbc70db drd/tests: Fix remaining gcc 8 compiler warnings 2018-12-01 21:53:59 -08:00
Bart Van Assche
4b90a2e668 Add drd/tests/fork-serial and drd/tests/fork-parallel 2018-12-01 11:05:26 -08:00
Bart Van Assche
66a7a592c0 drd: Add fork test program 2018-12-01 10:45:51 -08:00
Bart Van Assche
df10905d33 drd: Fix fork() handling
The thread ID passed to DRD_(drd_thread_atfork_child)() is a Valgrind
thread ID instead of a DRD thread ID. This patch fixes bug 401578.
2018-12-01 10:45:51 -08:00
Bart Van Assche
bb7086d063 drd/test: Fix most gcc 8 compiler warnings 2018-12-01 10:45:51 -08:00
Julian Seward
5b7b6662f2 Add some initialisations that seemed to be required as a result of an LTO build with a gcc 8 prerelease. 2018-07-14 15:39:59 +02:00
Petar Jovanovic
925414b384 fix make distclean failure
commit 85cd72c0a80d64ddbfd3156743037925bb7f8f5f
"Add the drd/tests/bug322621 regression test"

introduced make distclean failure.
Fix it by using symlink instead of a relative path in
drd/tests/Makefile.

Also, revert "ignore .dirstamp file appearing in helgrind/tests directory"
This reverts commit 718b47e184bc090b9f2a5f22904f59a272c9018d.
2018-06-15 13:44:14 +00:00
Petar Jovanovic
9a6cf7a41c mips64: add N32 ABI support
Adding MIPS N32 ABI support.

BZ issue - #345763.

Contributed and maintained by mulitple people over the years:
  Crestez Dan Leonard, Maran Pakkirisamy, Dimitrije Nikolic,
  Aleksandar Rikalo, Tamara Vlahovic.
2018-06-14 17:40:08 +00:00
Philippe Waroquiers
ab773096df Fix 338252 - building valgrind with -flto (link time optimisation) fails
* Addition of a new configure option --enable-lto=yes or --enable-lto=no
  Default value is --enable-lto=no, as the build is significantly slower,
  so is not appropriate for valgrind development : this should be used
  only on buildbots and/or by packagers.

* Some files containins asm functions have to be compiled without lto:
    coregrind/m_libcsetjmp.c
    coregrind/m_main.c
  If these are compiled with lto, that gives undefined symbols at link time.
  The files to compile without lto are
    coregrind/m_libcsetjmp.c
    coregrind/m_main.c

  To compile these files with other options, a noinst target lib is defined.
  The objects of this library are then added to the libcoregrind.

* memcheck/mc_main.c : move the handwritten asm helpers to mc_main_asm.c.
  This avoids undefined symbols on some toolchains. Due to this,
  the preprocessor symbols that activate the fast or asm memcheck helpers
  are moved to mc_include.h
  Platforms with handwritten helpers will also have the memcheck primary
  map defined non static.

* In VEX, auxprogs/genoffsets.c also has to be compiled without lto,
  as the asm produced by the compiler is post-processed to produce
  pub/libvex_guest_offsets.h. lto not producing asm means the generation
  fails if we used -flto to compile this file.

* all the various Makefile*am are modified to use LTO_CFLAGS for
  (most) targets. LTO_CFLAGS is empty when --enable-lto=no,
  otherwise is set to the flags needed for gcc.
  If --enable-lto=no, LTO_AR and LTO_RANLIB are the standard AR and RANLIB,
  otherwise they are the lto capable versions (gcc-ar and gcc-ranlib).

* This has been tested on:
    debian 9.4/gcc 6.3.0/amd64+x86
    rhel 7.4/gcc 6.4.0/amd64
    ubuntu 17.10/gcc 7.2.0/amd64+x86
    fedora26/gcc 7.3.1/s390x

  No regressions on the above.
2018-03-18 13:53:38 +01:00
Bart Van Assche
85cd72c0a8 Add the drd/tests/bug322621 regression test 2018-03-17 22:12:42 -07:00
Bart Van Assche
6607590ef5 drd/tests/Makefile.am: Use -faligned-new for C++ code if supported 2018-03-17 21:31:53 -07:00
Mark Wielaard
ea1c229392 Remove all extra -std=c99 flags from Makefiles.
Configure now makes sure we build everything in c99 mode already.
No need to have extra special cases in the Makefiles.
2018-01-19 13:52:29 +01:00
Julian Seward
cceed053ce Bug 79362 - Debug info is lost for .so files when they are dlclose'd. Majorly reworked by Philippe Waroquiers. 2018-01-11 19:40:12 +01:00
Petar Jovanovic
da3987aa18 mips32: add BE-exp files for several tests
This fixes several tests on mips32 BE platforms:

memcheck/tests/mips32/fadvise64
drd/tests/tc19_shadowmem
helgrind/tests/tc19_shadowmem
2017-10-02 14:54:20 +02:00
Mark Wielaard
e9d907e1d8 Add dlopen_lib.h to drd/tests/Makefile.am noinst_HEADERS.
It is used in drd/tests/dlopen_lib.c and drd/tests/dlopen_main.c.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16388
2017-05-16 15:17:12 +00:00
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