292 Commits

Author SHA1 Message Date
Julian Seward
e8dd1efe84 Implement --weird-hacks=truncate-writes to limit the size of write syscalls
to 4096, to possibly avoid deadlocks under very rare circumstances.
Is fully documented and commented.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@479
2002-06-30 12:44:54 +00:00
Julian Seward
5bf10a3618 cleanup_after_thread_exited: also clean up the waiting_fds table on thread
disappearance.  This fixes an assertion failure to do with thread nukage
on fork():
   vg_scheduler.c:936 (poll_for_ready_fds):
   Assertion `vgPlain_is_valid_tid(tid)' failed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@478
2002-06-30 10:57:30 +00:00
Julian Seward
c3c3b1e909 Make --stop-after= work again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@475
2002-06-28 02:08:28 +00:00
Julian Seward
ac5e011028 Finally get around to implementing pthread_atfork.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@473
2002-06-28 01:46:26 +00:00
Nicholas Nethercote
e95cef5f3c Removed line about Cachegrind being experimental.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@472
2002-06-27 15:45:09 +00:00
Julian Seward
2ccd1ed4e9 Partial implementation of mallinfo() (Ilpo Ruotsalainen)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@470
2002-06-26 17:08:01 +00:00
Julian Seward
0a530cb06c parse_cache_opt: Move free() of opt past last use.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@469
2002-06-26 17:02:57 +00:00
Nicholas Nethercote
7857877374 Forgot to VG_(free) a VG_(strdup)'d string.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@468
2002-06-26 10:06:26 +00:00
Julian Seward
a077c2c8ac Make __pthread_clock_gettime and __pthread_clock_settime appear for
GLIBC_2.2.3.  I dunno what this means, if anything, but someone
reports it helps.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@467
2002-06-26 00:50:36 +00:00
Julian Seward
827b3d2565 select() and poll(): change order of events in main timing loop
so that very short selects/polls don't just cause a timeout with
no real test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@466
2002-06-26 00:47:17 +00:00
Julian Seward
52f9eb2462 wait_for_fd_to_be_readable_or_erring: return immediately if fd is
nonblocking anyway.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@465
2002-06-26 00:13:36 +00:00
Julian Seward
07beb19900 vg_push_signal_frame: make the siginfo and ucontext fields readable too.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@464
2002-06-25 23:18:16 +00:00
Julian Seward
7bcbe59c1f Fix subtle bug in the interaction between pthread_create and thread_wrapper,
exposed by scheduling changes caused by commit vg_scheduler.c rev 1.70.
We cannot simply pass the __attr pointer to the child, since it could
point to stuff on the parent's stack, which might not exist by the time
the child looked at it.  Prior to scheduler.c rev 1.70 the child would
have been scheduled as soon as created, so the access was made before the
parent could clear the stuff from its stack.  From rev 1.70 and after
the parent continues after creating the child, causing invalid stack
accesses when the child finally runs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@455
2002-06-20 10:25:37 +00:00
Julian Seward
711baa5d1c Rationalise client-request handling a bit, by merging the two switches
into one.  This can change the scheduling a bit since the policy of
running the same thread after the request if it is possible now applies
to _all_ requests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@454
2002-06-20 10:19:38 +00:00
Julian Seward
c489fb0318 Make recv block only the calling thread, not the entire process.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@451
2002-06-20 07:58:33 +00:00
Julian Seward
b264e50980 Implement sigpending(). All absolutely horrible. Sigh.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@443
2002-06-19 17:35:45 +00:00
Julian Seward
2bdcd29d63 Implement pause().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@442
2002-06-19 10:17:40 +00:00
Julian Seward
b05ceff761 Do pthread_rwlockattr_init.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@440
2002-06-18 09:24:34 +00:00
Julian Seward
7351752815 Do siglongjmp, although without running cleanup handlers in the section
of stack which it skips over.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@438
2002-06-18 09:07:54 +00:00
Julian Seward
54661408ff - Check DWARF2 reader against spec. Add some clarifications and
fix a minor error, but basically no significant changes.

- Disable debug info printing entirely in addLineInfo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@433
2002-06-18 01:04:57 +00:00
Julian Seward
fca23eae18 Increase thread limits a bit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@432
2002-06-17 14:25:00 +00:00
Julian Seward
f34cee7b2f Add pthread_attr_setschedpolicy / pthread_attr_getschedpolicy.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@431
2002-06-17 12:19:44 +00:00
Julian Seward
d8cc5306ac Formatting cleanups in the dwarf2 reader, and some debug printing hooks.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@430
2002-06-17 02:21:20 +00:00
Julian Seward
31d365049a Fix bug in and simply parameter access checks for pthread_sigmask.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@429
2002-06-16 11:37:06 +00:00
Julian Seward
f18008337f Patrick Ohly's --alignment= patch, to increase alignment of malloc'd
blocks if needed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@422
2002-06-14 10:17:05 +00:00
Julian Seward
123b75b6a5 Rename event-horizon to error-limit; the former may have trendy black-hole
associations, but the latter actually cues one to what it might achieve.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@418
2002-06-13 20:44:00 +00:00
Julian Seward
c797c7e5f9 First round of manual update for 1.0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@417
2002-06-13 20:37:25 +00:00
Julian Seward
66492d7e14 Be more robust to the situation where a signal arrives, and there is a
handler, but in the interval between the signal arriving and it being
delivered to the client, the handler is removed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@416
2002-06-13 17:47:05 +00:00
Julian Seward
3244f2ca64 Make recvfrom() block only the calling thread, not the whole system
( same trick as used for accept() ).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@415
2002-06-13 17:29:53 +00:00
Julian Seward
1f5d408d60 Add --event-horizon=yes|no [yes] so that the limit on errors shown
can be disabled if desired.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@414
2002-06-13 17:23:38 +00:00
Julian Seward
8417ae82b5 Remove inclusion of <linux/module.h> and <asm/atomic.h> since that
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
2002-06-13 16:07:51 +00:00
Julian Seward
6cdad44934 Remove bogus assertion.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@412
2002-06-13 13:56:15 +00:00
Julian Seward
87e4cb98b4 Allow detected CPU clock rates down to 50 MHz -- slower than the slowest
Pentium, which is the oldest processor supported.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@411
2002-06-13 11:37:41 +00:00
Julian Seward
cf4a890c45 Inconsequential cleanups to recent cachesim hacking.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@407
2002-06-13 10:25:56 +00:00
Nicholas Nethercote
f598db43e4 A few minor improvements.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@402
2002-06-10 10:24:05 +00:00
Nicholas Nethercote
9e8a864df1 Updated Cachegrind section for the CPUID-addition/vg_cachegen-removal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@401
2002-06-08 14:06:37 +00:00
Nicholas Nethercote
b859182c44 Removed the need for the user to generate a cache simulation -- now do
automatic cache configuration detection using the CPUID instruction.
This can be overridden from the command-line if necessary.

vg_include.h:
    - added the cache_t type and UNDEFINED_CACHE macro

    - added command line args (of type cache_t) allowing manual override of
      I1/D1/L2 configuration

    - added log2(), which is generally useful

vg_main.c, valgrind.in, cachegrind.in:
    - added handling of the new --{I1,D1,L2}=<size>,<assoc>,<line_size>
      options

vg_cachesim.c:
    - lots of stuff for auto-detecting cache configuration with CPUID.
      Only handles Intel and AMD chips at the moment, and possibly not all of
      them.  Falls back onto defaults if anything goes wrong, and the configs
      can be manually overridden from the command line anyway.

    - now not printing cache summary stats if verbosity == 0.  Still writing
      cachegrind.out, though.

vg_cachesim_gen.c:
    - new file containing stuff shared by the I1/D1/L2 simulations

vg_cachesim_{I1,D1,L2}:
    - removed most of it;  each now just calls a macro defined in
      vg_cachesim_gen.c

vg_cachegen:
    - has been cvs removed as it is no longer needed.

Makefile.am:
    - added vg_cachesim_gen.c

    - removed vg_cachegen

configure.in:
    - removed vg_cachegen


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@400
2002-06-08 13:36:03 +00:00
Nicholas Nethercote
0ef6084729 Converted some stab-reading assertions into warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@399
2002-06-08 13:34:17 +00:00
Julian Seward
e6f8b8949a Cancellation wrapper for recvmsg.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@392
2002-06-06 08:33:54 +00:00
Julian Seward
37a139e555 When a thread in a nanosleep() wait is interrupted by a non-restartable
signal, cause the nanoslep to return with EINTR.  Then, in the user-space
nonblocking select() implementation, notice this and correspondingly return
with EINTR.  This appears to fix the MySQL hang-at-exit problem.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@391
2002-06-06 01:27:39 +00:00
Julian Seward
d71801987c Only terminate stack traces when the %ebp trail goes cold, and not
just because some addresses cannot be mapped to anything.
Needed to give sensible stack traces on Red Hat 7.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@390
2002-06-05 21:22:04 +00:00
Julian Seward
46e09a22f6 Minor mods to stop make the leak detector behave properly for the
following kind of stupid test program
   int main (void) { char* a = malloc(100); return 0; }
which many people seem fond of trying for some reason.
In general the leak detector works fine.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@387
2002-06-05 20:28:33 +00:00
Nicholas Nethercote
aa03b94261 Small improvement to stabs reader to avoid warnings of this form:
--14081-- warning: function CloseSocket__Fi:F(0,20) missing closing N_FUN stab at entry 10052

which were common when compiling with GCC's -gstabs option.

Instead of relying on an end-of-function N_FUN entry to handle the final
N_SLINE of a function, it can now handle it by finding the difference between
the start of the previous function and the start of the next.

Not extensively tested, but I think it works ok.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@386
2002-06-05 15:30:30 +00:00
Nicholas Nethercote
77dca1afe5 Cache simulator now handles basic block discards correctly. When
VG_(cachesim_discard_notify) is called, the cost centre array for the basic
block is removed from the table, and its counts are aggregated into a single
"discard" cost centre, and the cost centre array is free'd.

The aggregate discard cost centre is given the filename:function_name
"(discarded):(discarded)".  Mentioned this in the manual.

Only tested with tests/discard.c.  Seems to work well for that case though :)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@385
2002-06-05 14:41:10 +00:00
Nicholas Nethercote
703acc24b7 Tiny documentation wibbles
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@383
2002-06-05 09:21:51 +00:00
Julian Seward
af4042b1fb Check addressibility of client-space addresses passed to pthread_*
fns, which are to be written by valgrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@380
2002-06-04 23:24:22 +00:00
Julian Seward
a487ef1ce7 A new kind of error: PThread errors. Used to report detected misuse in
the pthread_* API.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@379
2002-06-04 22:54:20 +00:00
Julian Seward
91ccd289f4 - report the size requested size in pthread_attr_setstacksize() when
the size is bigger then the hardcoded value in valgrind.  This
   makes it easier to find out which value to use for
   VG_PTHREAD_STACK_SIZE.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@378
2002-06-04 20:59:16 +00:00
Julian Seward
35ae79b60b More assertion-failure avoidance in the stabs reader.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@377
2002-06-04 17:11:03 +00:00
Julian Seward
92ffcd0618 malloc_aligned: allow 262144
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@376
2002-06-04 16:48:29 +00:00