Valgrind's dependency on the dynamic linker for getting started, and
instead takes things into its own hands.
This checkin doesn't add much in the way of new functionality, but it
is the basis for all future work on Valgrind. It allows us much more
flexibility in implementation, and well as increasing the reliability
of Valgrind by protecting it more from its clients.
This patch requires some changes to tools to update them to the changes
in the tool API, but they are straightforward. See the posting "Heads
up: Full Virtualization" on valgrind-developers for a more complete
description of this change and its effects on you.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2118
"kludged" confusing. Even printing out brief explanations of why functions are
ignored/kludged, in some cases.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2054
with the aim of making it more robust, more correct and perhaps faster.
This patch removes the need to poll blocking syscalls, by adding a proxy
LWP for each application thread. This LWP is a kernel thread whose job
is to run all (potentially) blocking syscalls, and also to handle signals.
This allows the kernel to do more of the work of dealing with signals,
so on kernels which do this properly (2.6), Valgrind's behavious is a
lot more posix compliant. On base 2.4 kernels, we emulate some of the
missing 2.6 functionality.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1918
to inline. This is needed to get a warning-free compilation on 3.3.1.
It seems we had "inline" on some pretty huge functions in places.
Also it appears gcc-3.3.1 won't inline a function call in a tail call
position, reasonably enough. I assume in that case it prefers to
create a tailcall to the callee, rather than inlining it.
MERGE TO STABLE
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1907
properly with POSIX, and not get assertion failures when the same
thread makes nested calls to pthread_once with different once_control
pointers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1746
- Change various incorrect direct references to errno into
*(__errno_location()).
- In __errno_location and __h_errno_location, treat the tid==1 case
(root thread) specially, as with __res_state().
This seems to fix a bug in threaded handling of errno on R H 9 and SuSE8.2,
and almost makes OpenOffice work again on R H 9.
MERGE TO STABLE, if it doesn't break anything.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1625
because there was no point exposing them to clients, as they don't know the
ThreadState type.
Also, removed the LOGMESSAGE request type, replaced it with calls to
VG_(message) via the generic VALGRIND_NON_SIMD_CALL2.
In fact, almost every single pthread client request could be removed in this
same way. That would result in less code, which would be nice... yeah, real
nice.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1584
NPTL support.
The behaviour of weak vs strong symbols seems to have changed in
glibc-2.3.2. This caused problems in coregrind/vg_intercept.c,
wherein strong symbols in vg_libpthread.c were intended to
override weak symbols in vg_intercept.c, in order to give alternative
thread-safe implementations of some functions, poll(), select(), etc.
The change involves moving the nonblocking implementations of poll, etc
into vg_intercept.c, renaming them to (eg) VGR_(poll), and routing
all calls to poll to VGR_(poll) [dually for other such fns]. This
means even single-threaded programs now use these functions, but
that doesn't strike me as harmful.
MERGE TO STABLE, if it doesn't break anything
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1559
The veneers for msgrcv in vg_intercept.c and vg_libpthread.c are not
returning the number of bytes read correctly - they always return zero
for any non-error case, which causes programs using msgrcv to behave
somewhat non-optimally when running under valgrind ;-)
Attached is a patch against 1.9.3 which fixes this.
Tom
--
Tom Hughes (thh@cyberscience.com)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1424
46-fix-writeable_or_erring-proto
Prototype fix for wait_for_fd_to_be_writable_or_erring(). (bugfix for
43-nonblock-readwritev)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1337
22-mutex-destroy-unlock:
It seems that glibc assumes in its internal use of pthreads that
destroying a lock implicity unlocks it. This patch handles this case
so that lock ownership tracking is accurate.
Also handles the case of the dyanmic linker wanting to do locking
before Valgrind has started up. vg_libpthread now implements toy
lock/unlock functions to keep it happy and leave the locks in a
sensible state. Implements some untested code to handle the case where
a lock is taken before Valgrind is running but released afterwards.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1297
03a-open-nonblock
Implement open of FIFOs for threaded programs, so that everything
doesn't block when we try to open a FIFO file in a non-blocking way.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1296
all commentary from our libpthread.so through to the valgrind core and
hence to the selected logging sink.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1274
16-function-intercept
Implement a more reliable for vg_libpthread to intercept libc
calls. Since the only reliable way of making sure that our code
defines the symbol is by making sure that valgrind.so itself does it,
this patch adds a new file, vg_intercept.so, which defines those
symbols. They are then passed off to a weak local function if
libpthread isn't present, or to the libpthread version if it is.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1265
Create __ versions of the select and poll symbols, so that all
references are caught (Jeremy Fitzhardinge)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1241
vg_libpthread.c 1.90.2.9
vg_libpthread_unimp.c 1.30.2.4
Add sem_timedwait(). From Scott Smith <sls@cs.unt.edu>.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1238
the appearance of libc_internal_tsd_address requires a redesign, since
the existing scheme doesn't make it sensible to take the address of a
specific-data value.
New scheme is that the ThreadState structure carries not the table of
specifics, but merely a pointer to such. This is allocated from the
client-side library, thus residing in client-visible memory and so
addresses can validlyh be taken.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1208
- autoconf stuff for detecting glibc-2.3
- vg_libpthread_unimp.c: hack for __pthread_clock_[gs]ettime
- vg_libpthread.c: initialise thread's default locale by calling
__uselocale(LC_GLOBAL_LOCALE) at the right time. Gruesome.
Also need to do this for new other threads - not yet done.
- cleanups -- don't use write() to write messages when bombing out,
instead go direct to the syscalls. Avoids nasty circularities
with glibc initialisations.
MERGE TO STABLE
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1207
vg_libpthread.c:1550: warning: weak declaration of `write' after
first use results in unspecified behavior
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1149