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)
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.
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.
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.
* 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.
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
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
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
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
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
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
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
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
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
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
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
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
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