Commit Graph

70 Commits

Author SHA1 Message Date
Julian Seward
a75be28f6f Failed attempt to make JDK 1.4.0 work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@361
2002-06-03 00:58:18 +00:00
Julian Seward
501f08d781 Do pthread_atter_{set,get}scope.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@360
2002-06-02 09:29:31 +00:00
Julian Seward
bf9c8be609 Remove old rwlock implementation and replace with home-grown one.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@346
2002-06-01 14:14:19 +00:00
Julian Seward
89ff2f0b24 Implement __pthread_kill_other_threads_np properly. It does seem to
be needed after all.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@342
2002-05-30 00:40:03 +00:00
Julian Seward
38fce3d542 Make __pthread_kill_other_threads_np be UNIMPLEMENTED. If it turns out
to be needed, I'll fix it properly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@335
2002-05-29 20:22:17 +00:00
Julian Seward
320e2adc3f pthread_cond_timedwait: be robust to timeout points in the past
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@334
2002-05-29 20:13:53 +00:00
Julian Seward
0943acb8fd As per POSIX, nuke all threads other than me
- just before __NR_exec()
- just after __NR_fork() when I am the child
This makes OpenOffice 1.0 not have mutex-related assertion failures


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@333
2002-05-29 19:26:32 +00:00
Julian Seward
d253821d62 Check for pending cancellation requests at syscalls which POSIX
defines to be cancellation points.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@331
2002-05-29 01:21:19 +00:00
Julian Seward
6471fc14ca When a thread exits, run the destructors for the thread's specific data.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@330
2002-05-29 01:06:47 +00:00
Julian Seward
951c703b58 Implement thread cleanup stacks.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@329
2002-05-29 00:10:20 +00:00
Julian Seward
6b9ba9848a Fix various problems with new thread start / stop / detach stuff.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@327
2002-05-28 11:00:01 +00:00
Julian Seward
fbd9d9f778 DO NOT UPDATE! COMPILES BUT DOESN'T WORK.
Major overhaul to the way thread startup and exit is done.  Removes some
ugly gunk in the scheduler, and adds support for thread detaching and
cancellation.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@326
2002-05-28 01:36:45 +00:00
Julian Seward
dbd505a061 Support for POSIX reader-writer locks (preliminary).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@325
2002-05-27 13:00:05 +00:00
Julian Seward
ba1fae8ba5 Comment out debug printing.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@323
2002-05-24 02:12:52 +00:00
Julian Seward
09846794fc More minor fixes to make OpenOffice 1.0 work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@321
2002-05-24 02:11:32 +00:00
Julian Seward
aad98221b9 Make accept() be nonblocking.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@313
2002-05-23 13:13:12 +00:00
Julian Seward
cce8a3ebd3 Implement pthread_yield.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@308
2002-05-22 13:17:31 +00:00
Julian Seward
8d2d128371 Don't mask libc's vfork / __vfork:
$ nm /lib/libc-2.2.4.so | grep vfork
   000b4220 T __vfork
   000b4220 W vfork

There's no __libc_vfork, so there's nothing we can do here.
Just don't supply our own version.

Not at all sure if this is correct.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@303
2002-05-21 00:51:21 +00:00
Julian Seward
53c56fd4d1 Implement semaphore functions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@295
2002-05-19 00:13:34 +00:00
Julian Seward
2560fc9e47 Cancellation wrappers for pread/pwrite (Philip Martin).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@287
2002-05-18 10:56:27 +00:00
Julian Seward
a57b808f60 Cancellation wrapper for __pwrite64 (Adam Zell(?))
Be more paranoid in pthread_attr_setstacksize


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@285
2002-05-18 10:43:22 +00:00
Julian Seward
a1b75f8383 Cancellation wrapper for pread64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@283
2002-05-16 23:39:10 +00:00
Julian Seward
f3067ffa5d Minimal impl of pthread_attr_setstacksize.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@279
2002-05-16 20:51:15 +00:00
Julian Seward
9360e0621c Cancellation wrapper for sendmsg(), wierd wrapper for raise().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@278
2002-05-16 16:57:25 +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
9945834acc Hook libpthread.so's .init section to start up Valgrind too.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@262
2002-05-10 23:20:58 +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
67b0b0e404 Modify the startup mechanism so that any call into valgrind's libpthread.so
will start up valgrind if it is not already running.  This more or less
sidesteps the problem that sometimes valgrind.so isn't init'd first by
the dynamic linker.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@257
2002-05-10 21:03:56 +00:00
Julian Seward
8b15df18c2 Change _pthread_cleanup_push and _pthread_cleanup_pop into no-ops
rather than aborts.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@237
2002-05-08 14:08:22 +00:00
Julian Seward
9518212384 Do __pthread_initialize.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@236
2002-05-08 02:01:14 +00:00
Julian Seward
15f93fef49 Fix from Lionel Ulmer to not have an infinite loop/stack overflow
with sigaction on glibc 2.1.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@214
2002-05-04 19:49:21 +00:00
Julian Seward
be21872520 Various cleanups following earlier exit fixes. Also add boilerplate
copyright notices.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@204
2002-05-03 20:43:10 +00:00
Julian Seward
b0d319d98a Fix typo to do with rwlock aliasing.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@177
2002-05-01 00:03:16 +00:00
Julian Seward
a3c231031a Make pthread_mutexattr_setkind_np be an alias of__pthread_mutexattr_settype.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@172
2002-04-30 10:20:10 +00:00
Julian Seward
feaee3ac3a Fix really stupid error in computation of timeout point in nonblocking
poll().  After this change, Mozilla-0.9.2.1 and Galeon 0.11.3 finally
behave reasonably on my box.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@165
2002-04-29 12:20:34 +00:00
Julian Seward
acf082b7d7 Allow apparently invalid keys in libc_internal_tsd_{get,set}. This
allows koffice-1.2beta1 to work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@158
2002-04-27 01:35:38 +00:00
Julian Seward
c082a81f8f Fix more stuff broken by recent exported-symbol hackery.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@156
2002-04-26 21:01:13 +00:00
Julian Seward
205ec6efd2 Finish first pass of the symbols cleanup. Only versioned symbols remain
to do.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@155
2002-04-26 14:31:40 +00:00
Julian Seward
66b4d0b7ca Mess around with aliases to make the exported T/D/W syms look like those
of the real libpthread.so.  This is a Good Thing, despite the fact it
temporarily breaks some threaded programs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@153
2002-04-26 13:25:00 +00:00
Julian Seward
edf9ed279b Fix many holes and bugs in an attempt to get my libpthread.so to export
the same set of symbols as the real one, which I now realise is crucial
for it to work at all.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@151
2002-04-26 03:28:18 +00:00
Julian Seward
a70e548ee7 Fix various bugs getting in the way of licq starting up.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@150
2002-04-26 00:27:53 +00:00
Julian Seward
c107508a0f Try and give at least some minimal binding for all functions exported
by the real libpthread.so.  In the process fix a bunch of stuff, including
adding thread-specific h_errno and resolver state storage.  This fixes
licq crashing at startup.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@149
2002-04-25 20:17:29 +00:00
Julian Seward
6f9fc98a96 Jiggle timing delays yet again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@148
2002-04-25 01:33:50 +00:00
Julian Seward
3b6da6b7a3 Wrappers for open64/lseek64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@137
2002-04-24 20:29:58 +00:00
Julian Seward
8060ad5525 Add wait() wrapper.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@134
2002-04-24 19:26:47 +00:00
Julian Seward
6fde2066d9 Add a simplistic implementation of pthread_once().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@132
2002-04-24 19:21:39 +00:00
Julian Seward
9247bfce1f Add wrapper for system().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@130
2002-04-24 13:28:15 +00:00
Julian Seward
8c5467fdb1 Add wrapper for sendto().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@125
2002-04-24 02:28:34 +00:00
Julian Seward
26934d5615 More glibc-2.1.X compiler fixes (Lionel Ulmer).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@123
2002-04-24 02:20:20 +00:00