13 Commits

Author SHA1 Message Date
Julian Seward
297db5c10c Implement sigaltstack. Most of the logic is copied more-or-less
verbatim from the Linux kernel sources, which has to be a good thing.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@309
2002-05-22 23:34:20 +00:00
Julian Seward
30199fec47 In accordance with "build one to throw away, you will anyway (tm)",
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
2002-05-15 21:13:39 +00:00
Julian Seward
0ba6f33e4f Add support for pthread_sigmask() and sigwait(). All absolutely
horrible, especially the latter.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@266
2002-05-13 00:16:03 +00:00
Julian Seward
46111c06e3 Kernel 2.4 / glibc 2.2.X build fixes for recent startup changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@259
2002-05-10 22:31:40 +00:00
Julian Seward
5bf4e3319d Remove valgrind's use of libc-supplied stat() and sbrk(). Now the only
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
2002-05-09 17:38:13 +00:00
Julian Seward
2a1e3ffbf1 Define VKI_SIGUSR1.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@146
2002-04-25 01:29:35 +00:00
Julian Seward
cb33f92ef2 Get rid of incomprehensible special-case treatment of SIGABRT.
Might have made sense once but it doesn't any more.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@141
2002-04-24 21:25:46 +00:00
Julian Seward
93b2c2ed95 Get rid of the muraroa.demon.co.uk references since that account is
soon to disappear.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@83
2002-04-16 02:51:05 +00:00
Julian Seward
d8e7eaed15 Take notice of SA_RESTART flags on signals, so as to deal (at least
partially properly) with blocking system calls interrupted by signals.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@62
2002-04-14 02:29:29 +00:00
Julian Seward
7a36f60133 Mega-merge of my last 2 weeks hacking. This basically does the groundwork
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
2002-04-12 11:12:52 +00:00
Julian Seward
232f2a3c57 (VG_(do__NR_sigaction)): Don't allow setting of
handlers for SIGKILL or SIGSTOP.  This fixes
valgrind: vg_signals.c:723 (vgPlain_do__NR_sigaction):
Assertion `our_old_handler == ((void *)0)' failed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@40
2002-03-29 14:02:34 +00:00
Julian Seward
66c4d5263b (merge from 20020320)
Syscalls/ioctls added between 0317 and 0320.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15
2002-03-24 10:17:25 +00:00
Julian Seward
72a784f3b1 Initial revision
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2
2002-03-22 01:27:54 +00:00