- 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
the root thread (tid 1) always uses _res as exported from libc.so as its
state. This fixes the name lookup problems in KAtlantik.
MERGE TO STABLE
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@551
exposed by scheduling changes caused by commit vg_scheduler.c rev 1.70.
We cannot simply pass the __attr pointer to the child, since it could
point to stuff on the parent's stack, which might not exist by the time
the child looked at it. Prior to scheduler.c rev 1.70 the child would
have been scheduled as soon as created, so the access was made before the
parent could clear the stuff from its stack. From rev 1.70 and after
the parent continues after creating the child, causing invalid stack
accesses when the child finally runs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@455
signal, cause the nanoslep to return with EINTR. Then, in the user-space
nonblocking select() implementation, notice this and correspondingly return
with EINTR. This appears to fix the MySQL hang-at-exit problem.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@391