Commit Graph

253 Commits

Author SHA1 Message Date
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
d53ff8366a Add some more recent tests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@277
2002-05-16 11:18:05 +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
962660eadd ---> 20020515
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@273
2002-05-15 22:26:37 +00:00
Julian Seward
930d862210 More new-signal-hacks fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@272
2002-05-15 22:25:47 +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
Nicholas Nethercote
ab8de9f4f7 Fix incredibly stupid bug.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@270
2002-05-15 14:30:55 +00:00
Nicholas Nethercote
8cbe9082c5 Expanded --sort option to take threshold args with the event names. Lets you
do things like "show functions covering 99% of all D2mr events *and* 99% of all
D2mw events" - before you could only choose the threshold for one.

Useful for me, but probably no-one else.  Still mentioned it in the docs,
though.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@269
2002-05-13 20:27:54 +00:00
Frédéric Gobry
460d2313d2 Use $(srcdir) to specify the location of the linker script
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@268
2002-05-13 07:50:45 +00:00
Julian Seward
c738e7407c Add another threads+signals test case along with the fix to make it work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@267
2002-05-13 00:38:52 +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
d6920d2b5c Fix spelling mistake: wierd*hacks --> weird*hacks
Also add a testcase.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@265
2002-05-12 10:52:16 +00:00
Julian Seward
2943666eb5 In order to catch timeout events on fds which are readable and which
have been ioctl(TCSETA)'d with a VTIMEout, we appear to need to ask if
the fd is writable, for some reason.  Ask me not why.  Since this is
strange and potentially troublesome we only do it if the user asks
specially, by specifying --wierd-hacks=ioctl-VTIME.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@264
2002-05-12 03:00:17 +00:00
Julian Seward
79409e4eeb ---> 20020511
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@263
2002-05-10 23:21:25 +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
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
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
06e9ee22df New and hopefully more reliable method for finding argc/argv/envp at
startup, by looking for the ELF frame created on the process' stack
at startup.  This avoids having to deal with problems caused by glibc
magic offsets.

WARNING: only works for 2.2 kernels right now.  2.4 is broken.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@258
2002-05-10 21:07:22 +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
0bfec75bda Implement __NR_personality.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@256
2002-05-10 21:01:34 +00:00
Julian Seward
2ca413983c Support _m_kind == PTHREAD_MUTEX_FAST_NP for mutexes. This was stopping
mutexes working properly on Red Hat 6.2.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@255
2002-05-10 21:00:19 +00:00
Julian Seward
44b07e005d Fix confusing bug in printing of trace info for mutex_{try}lock.
Add a couple of other handy debug printings.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@254
2002-05-10 20:26:37 +00:00
Julian Seward
59ff40a36c Insert hacks, only partially successful, to make 'make distcheck' work
with the new vg_libpthread.vs linker script.  Problem is that builds
where builddir != srcdir don't work now.  Don't know how to fix.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@253
2002-05-10 03:03:57 +00:00
Julian Seward
8121434f46 ---> 20020510
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@252
2002-05-10 02:36:18 +00:00
Julian Seward
8564298306 Return zero to the *parent* thread when pthread_create succeeds.
Only showed up on Red Hat 6.2.  Dunno how pth_create ever worked before.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@251
2002-05-10 02:16:19 +00:00
Julian Seward
aa02efa1a0 More symbol versioning stuff
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@250
2002-05-10 01:52:58 +00:00
Julian Seward
ee775d8b61 Add a version script so as to create the right versioned symbols for
libpthread.so.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@249
2002-05-10 01:42:33 +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
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
Nicholas Nethercote
74bb5ef434 Minor corrections about cache profiling cost centres.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@243
2002-05-09 15:43:33 +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
564a510b88 Fix assertions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@241
2002-05-09 11:03:57 +00:00
Julian Seward
5c7db51c11 ---> 20020509
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@240
2002-05-09 02:38:18 +00:00
Julian Seward
d8d97d9e36 Fix off-by-one error in definition of MAX_LINENO and MAX_LOC_SIZE.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@239
2002-05-09 01:32:57 +00:00
Julian Seward
44f0d41089 Yesterday's push/pop merging optimisations break the cache profiler:
vg_cachesim.c:536 (vgPlain_cachesim_instrument):
    Assertion `instr_size >= 1 && instr_size <= 16' failed.
so disable them when cache profiling.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@238
2002-05-08 21:26:01 +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
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
257b64c505 Implement SBB Ib, AL.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@234
2002-05-08 01:44:03 +00:00
Julian Seward
4ce9c33335 Do LODSW / LODSL. (Sami Farin)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@233
2002-05-08 01:38:43 +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
9a320a2d83 --> 20020508
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@231
2002-05-08 01:29:53 +00:00
Julian Seward
68a929a7ca Only show the giant-basic-block message at verbosity >= 2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@230
2002-05-08 00:42:25 +00:00
Julian Seward
ef33a1672e Improvements to the error-collecting machinery:
- Don't waste a potentially huge amount of time calling describe_addr
  on addresses in errors we aren't going to show.

- If an invalid address is just below %ESP, say that it might be due
  to a gcc bug.  Increase the window in which this is allowed to
  1024 bytes below %ESP.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@229
2002-05-08 00:32:50 +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