interim. All hats off to Graydon Hoare for this, plus to whoever
devised the LD_ASSUME_KERNEL trapdoor.
This does not provide NPTL support. Instead it turns out we can ask
for the old LinuxThreads interface to be used (wonderful!)
Other than that we have to deal with kernels with SYSINFO pages at the
top of memory. No big deal, apparently.
MERGE TO STABLE
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1508
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
LDTs and __NR_modify_ldt.
- Each thread has its own LDT. Usually NULL, but if we need to
change an entry, it is allocated. LDTs are inherited from parents
as one would expect.
- We intercept __NR_modify_ldt and update the calling thread's LDT
accordingly. This is done in coregrind/vg_ldt.c. The kernel
never sees these syscalls.
- New architectural state for %cs, %ss, %ds, %es, %fs and %gs.
Probably overkill including %cs and %ss. These are saved and
restored in the usual way, _except_ at syscalls -- there's no
point, since we are hiding all LDT operations from the kernel now.
This does assume that no syscall implicitly looks at the
segment registers, but I think that's safe.
Still only halfway there. JITter is still unaware of seg regs
and override prefixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1133
seems to lead to a portability swamp. As a result, remove autoconf
check for <asm/atomic.h>. Replace all this junk with
VKI_SIZEOF_STRUCT_MODULE (== 96) since that's all I ever wanted to
know in the first place.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@413
throw away the old signals simulation and more or less start again
from scratch. vg_signals.c is nearly a complete rewrite. In fact
this is now the third generation of the signals simulation.
The purpose of this is to properly support signals in threads -- a
nightmare combination. pthread_sigmask, pthread_kill and sigwait
are now alledged to work as POSIX requires.
In the process, throw away confusing and conceptually muddled old
implementation and replace with something which is more verbose but
conceptually cleaner, simpler and easier to argue is correct.
* When the client does sigaction/sigprocmask et al, the resulting
changes are stored verbatim in SCSS -- the Static Client Signal State.
So SCSS is the state the client believes the kernel is in.
* Every time SCSS changes, we recalculate the state the kernel
*should* be in so that our signal simulation works. This is the
SKSS -- Static Kernel Signal State. The kernel state is then
updated accordingly. By diffing the new and old SKSSs, the
number of real system calls made is minimised.
* The dynamic state of the client's signals is stored in DCSS
-- Dynamic Client Signal State. This just records which signals
are pending for which threads.
The big advantage of this scheme over the previous is that the SCSS ->
SKSS mapping is made explicit and gathered all in one place, rather
than spread out in a confusing way and done implicitly. That makes it
all lot easier to decide if the mapping, which is really the heart of
the signals simulation, is correct or not.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@271
sysbols we need from libc are __umoddi3 and __udivdi3 ; other than that
valgrind.so is completely self-contained.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@244
for pthread_* support. Major changes:
* Valgrind now contains a (skeletal!) user-space pthreads
implementation. The exciting bits are in new file vg_scheduler.c.
This contains thread management and scheduling, including nasty crud
to do with making some syscalls (read,write,nanosleep) nonblocking.
Also implementation of pthread_ functions: create join
mutex_{create,destroy,lock,unlock} and cancel.
* As a side effect of the above, major improvements to signal handling
and to the client-request machinery. This is now used to intercept
malloc/free etc too; the hacky way this is done before is gone.
Another side effect is that vg_dispatch.S is greatly simplified.
Also, the horrible hacks to do with delivering signals to threads
blocked in syscalls are gone, since the new mechanisms cover this case
easily.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@52