Julian Seward [Thu, 13 Jun 2002 17:47:05 +0000 (17:47 +0000)]
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.
Julian Seward [Thu, 13 Jun 2002 16:07:51 +0000 (16:07 +0000)]
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.
vg_annotate.in:
- fixed a bug that was breaking the --threshold option.
vg_cachesim.c:
- fixed a bug that meant instructions that didn't have a line number in the
debug info were being written in cachegrind.out with whatever was the
last known line number. Now using 0.
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.
Julian Seward [Thu, 6 Jun 2002 01:27:39 +0000 (01:27 +0000)]
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.
Julian Seward [Wed, 5 Jun 2002 21:22:04 +0000 (21:22 +0000)]
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.
Julian Seward [Wed, 5 Jun 2002 20:28:33 +0000 (20:28 +0000)]
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.
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.
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 :)
Added compile-time option to print instruction addresses for each line in
cachegrind.out. Increases file size by a fair bit, but useful for debugging
stabs errors <sigh>
Julian Seward [Tue, 4 Jun 2002 20:59:16 +0000 (20:59 +0000)]
- 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.
Julian Seward [Tue, 4 Jun 2002 09:44:09 +0000 (09:44 +0000)]
Fix bug in signal handling in threads shown by Peter Gober:
A signal *specifically directed* to one thread cannot be used
to fulfill a sigwait() request by some other thread, reasonably
enough.
Julian Seward [Tue, 4 Jun 2002 08:38:04 +0000 (08:38 +0000)]
Inch towards JVM (Sun, 1.4.0) working.
- Thread stack size = 1 Meg
- Alias for __pthread_kill_other_threads_np
Now at least valgrind doesn't crash/assert. Still doesn't work tho.
Julian Seward [Wed, 29 May 2002 19:26:32 +0000 (19:26 +0000)]
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
Julian Seward [Tue, 28 May 2002 01:36:45 +0000 (01:36 +0000)]
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.