Commit Graph

50 Commits

Author SHA1 Message Date
Julian Seward
6678ad2bc2 Implement __NR_mlock (Marc Mutz <mutz@kde.org>)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@356
2002-06-02 00:10:41 +00:00
Julian Seward
cd1a2b7541 Add ioctl BLKGETSIZE.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@351
2002-06-01 23:53:10 +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
22028c5569 Avoid make_readable ( NULL, ... ) in ioctl SIOCGIFCONF.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@324
2002-05-24 11:57:36 +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
2039995c09 Don't complain the second arg of __NR_setitimer
(const struct itimerval *value) is NULL.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@317
2002-05-23 17:14:54 +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
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
a0c162928a ioctl TCXONC (Peter A Jonsson)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@307
2002-05-22 12:03:54 +00:00
Julian Seward
8aae7441fe - Fix __NR_poll printing
- Invert the sense of IOC_READ / IOC_WRITE in generic ioctl handler
  (Simon Hausmann)
- TIOCSPGRP (Peter A Jonsson); also add a missing break in the ioctl stuff


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@302
2002-05-21 00:44:02 +00:00
Julian Seward
12f3df8548 Add getpmsg/putpmsg (Rick Watson)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@292
2002-05-18 13:24:24 +00:00
Julian Seward
96b04d4f30 Fix fork/exec stuff so it works again. We have to mangle LD_LIBRARY_PATH
as well as LD_PRELOAD, so as to make our libpthread.so go out of scope
when a child which we don't want to trace, is exec'd.  Otherwise the
child can wind up being connected to our libpthread.so but not to
valgrind.so, which is an unworkable combination; you have to be connected
to both or neither.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@291
2002-05-18 13:14:17 +00:00
Julian Seward
a3f80dfc46 Add getitimer (Pascal Massimino)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@288
2002-05-18 11:01:06 +00:00
Julian Seward
6610ca19b3 Remove existing non-working support for self-modifying code, and instead
add a simple compromise, in which the client can notify valgrind
that certain code address ranges are invalid and should be retranslated.
This is done using the VALGRIND_DISCARD_TRANSLATIONS macro in valgrind.h.

At the same time take the opportunity to close the potentially fatal
loophole that translations for executable segments were not being
discarded when those segments were munmapped.  They are now.

Documentation updated.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@274
2002-05-16 11:06:21 +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
0cb1ae9c86 Implement syslog() (Bill Nottingham)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@261
2002-05-10 22:58:14 +00:00
Julian Seward
77de734612 Even more shmctl fixings from Reuben.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@260
2002-05-10 22:51:26 +00:00
Julian Seward
0bfec75bda Implement __NR_personality.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@256
2002-05-10 21:01:34 +00:00
Julian Seward
6a123a63ea Build fixes for Red Hat 6.2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@248
2002-05-10 00:46:59 +00:00
Julian Seward
d71098cf53 More IOCTL futzing from Reuben Thomas.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@247
2002-05-09 18:40:45 +00:00
Julian Seward
ba6a5f6242 Minor ioctl fixes from Reuben Thomas.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@246
2002-05-09 17:56:57 +00:00
Julian Seward
11f71832b9 Make sense of, and clean up, shmctl wrapper. (Reuben Thomas).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@245
2002-05-09 17:45:06 +00:00
Julian Seward
fc18649d8a Reinstate a condition in the IPCOP_shmctl wrapper without which the
system dies to the recently-rejuvenated
first-and-last-secondaries-look-plausible assertions around syscalls.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@242
2002-05-09 12:01:14 +00:00
Julian Seward
9bcb60e01a Complain about NVidia's libGL.so also when an 0x8C opcode is encountered.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@235
2002-05-08 01:58:18 +00:00
Julian Seward
f1ce22b738 More shmctl() fixes. (Helge Deller)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@232
2002-05-08 01:31:15 +00:00
Julian Seward
b9c76f1080 Actually call VG_(first_and_last_secondaries_look_plausible) and make
assertions about the return value, rather than asserting the
non-NULL-ness of the function's address :) Classic beginner's mistake,
compounded by C's crappy (non-existent) type system, which allows me
to silently confuse Bool with Pointer-to-Function.  What a great
programming language.  Come back Haskell, all is forgiven.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@228
2002-05-07 23:45:03 +00:00
Julian Seward
a472d679d9 glibc 2.1.3 compile fixes (Lionel Ulmer).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@211
2002-05-04 10:28:17 +00:00
Julian Seward
78073f1e74 Implement sched_setparam(), sched_getparam() and sched_yield()
(Helge Deller)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@208
2002-05-03 21:18:11 +00:00
Julian Seward
8dd0233bec Implement chroot(). (Paul Fox)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@207
2002-05-03 21:07:55 +00:00
Julian Seward
a2e6a01f5c From: Tom Hughes <thh@i'm sure he doesn't want to be spammed.com>
The attached patch improves the validation done on sockaddr structures
passed to systems calls by extending the existing code for AF_UNIX to
cover AF_INET and AF_INET6 as well so that errors are not raised when
an unused part of the sockaddr structure is not filled in.

It also applies this new code to bind and sendto as well as connect.

Tom


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@206
2002-05-03 21:01:35 +00:00
Julian Seward
3a27858aea Change the way Valgrind exits.
Until now, valgrind waited for ld.so to call the .fini code in
valgrind.so, and took this as its cue to switch back to the real CPU
for the rest of the journey.

This is a problem if ld.so subsequently calls other .so's .fini code
and threading is in use, because they do pthread_* calls which cannot
be handled by valgrind's libpthread.so without valgrind actually being
active.

So we ignore the call to valgrind's .fini code, and run the program
all the way up to the point where it calls syscall exit() to
disappear.  This makes the order in which the .fini sections are run
irrelevant, since Valgrind has control during all of them, and so
threading facilities are still available for all of them.

This change means Mozilla 1.0RC1 now exits a lot more cleanly than it
did.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@201
2002-05-03 19:09:05 +00:00
Julian Seward
26207e6d5a CDROM ioctls. (Lionel Ulmer)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@163
2002-04-27 02:28:19 +00:00
Julian Seward
e1341b79ec ioctls for /dev/rtc (Fredrik Kuivinen)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@162
2002-04-27 02:20:14 +00:00
Julian Seward
64aa64a2a9 Add __NR_getpriority (Richard Boulton).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@161
2002-04-27 02:13:24 +00:00
Julian Seward
f941ad21fd Use safe_dereference in IPCOP_msgrcv. (Tom Hughes)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@160
2002-04-27 02:06:15 +00:00
Julian Seward
61525a77d6 Do __NR_sched_get_priority_min and __NR_setpriority (Cody Russell).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@159
2002-04-27 01:56:30 +00:00
Julian Seward
f3634c179c Add __NR_madvise.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@124
2002-04-24 02:24:44 +00:00
Julian Seward
8f0229881b Add more pthread wrappers in a failed attempt to get Opera 6.0TP2
to run.  Now it creates some threads but segfaults.  Also add
wrapper for syscall __NR_mremap; it is way wrong, but finding
a decent description of what mremap() really does is nearly
impossible.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@89
2002-04-16 04:40:49 +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
e294b0448e Update the message on clone() failure to reflect new pthreads work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@82
2002-04-16 02:09:31 +00:00
Julian Seward
095fc58c48 Don't refer to IPC_64 if it doesn't exist. Was breaking builds on older
systems.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@80
2002-04-16 01:58:19 +00:00
Julian Seward
8138f264e0 Plumb the right %EIP and %EBP values through to VG_(get_ExeContext)
now that we have the additional complication of multiple threads.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@64
2002-04-14 04:16:48 +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
c8e7d16b40 wrappers for ioctl TIOCSCTTY and for syscall __NR_nice.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@41
2002-03-29 14:22:46 +00:00
Julian Seward
c712005a75 Add wrapper for ioctl TIOCGPGRP (Alexandre Duret-Lutz <duret_g@epita.fr>)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@39
2002-03-29 04:39:00 +00:00
Julian Seward
df8253eda3 Significantly improved SYSV IPC call handling. Unfortunately some of
this stuff doesn't use safe_dereference when it should.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@38
2002-03-29 04:35:08 +00:00
Julian Seward
e53f9abd92 #ifdef SNDCTL_DSP_GETCHANNELMASK and SNDCTL_DSP_BIND_CHANNEL; not available
on all Linuxes, it seems.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@21
2002-03-24 11:43:56 +00:00
Julian Seward
b58e0e3042 Add syscall setresgid32
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@17
2002-03-24 10:49:46 +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