Commit Graph

327 Commits

Author SHA1 Message Date
Julian Seward
c7f7a85487 merge rev 1.29.2.3:
Fix stupid bug in which vg_push_signal_frame/vg_pop_signal_frame assumed
that the handler wouldn't change the signal-number parameter it was passed.

Fixes this:
   vg_signals.c:1065 (vgPlain_signal_returns):
   Assertion `sigNo >= 1 && sigNo <= 64' failed.
and possibly arbitrary other mutancy in the signal handling too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1111
2002-09-27 00:46:59 +00:00
Nicholas Nethercote
2a3d19ae28 Added Makefile.am for tests/unused.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1102
2002-09-23 16:32:40 +00:00
Nicholas Nethercote
d8dcbbc58a Changed name of core/ to coregrind/, since 'core' files/dirs have a habit
of being removed with extreme prejudice.

Also added a couple of necessary Makefile.am files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1100
2002-09-23 16:24:41 +00:00
Nicholas Nethercote
ae9433672d Removed cachegrind docs (now in cachegrind/docs/)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1097
2002-09-23 13:13:45 +00:00
Nicholas Nethercote
a766333b67 Added .cvsignore file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1092
2002-09-23 11:36:39 +00:00
Nicholas Nethercote
f1689b96db Changed lots of files for the new core/ + skin/ directory structure:
- changed lots of Makefile.am files
   - changed configure.in
   - changed lots of #include lines for changed file names
   - changed lots of file headers n footers for changed file names
   - changed vg_regtest to handle new directory structure -- recursively
     traverses subdirectories for .vgtest test files
   - changed lots of paths in memcheck/ regression test expected outputs


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1090
2002-09-23 11:21:57 +00:00
Nicholas Nethercote
afebe61b37 Files updated, added and removed in order to turn the ERASER branch into HEAD
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1086
2002-09-23 09:36:25 +00:00
Nicholas Nethercote
911c953371 vg_from_ucode.c:
- Improves the code generation for arithmetic instructions.  Some arith
    instructions (ADC, SBB, RCR, RCL, some FPU) read EFLAGS -- integer ops for
    the carry flag, and FPU for ZCP (sometimes).  But the rest don't.

    Previously, the EFLAGS register was always being read before any arith
    instruction, even those for which it wasn't needed.  Now it's only done if
    needed.  This was done by splitting the anyFlagUse test used into
    readFlagUse and writeFlagUse.

    This results in reasonable decreases in time (3--5% for Valgrind, 12--14%
    with no instrumentation) and size of translations (2%, 5%).

vg_translate.c:
  - added CCALL_{1,2}_0 to a comment they were missing from.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@554
2002-08-06 20:56:40 +00:00
Julian Seward
fbaff8e524 Simulate resolver-specific state as per the real libpthread.so, wherein
the root thread (tid 1) always uses _res as exported from libc.so as its
state.  This fixes the name lookup problems in KAtlantik.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@551
2002-08-06 09:02:53 +00:00
Dirk Mueller
cf0dafe8ef Trying to support the new C++ ABI of gcc 3.x
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@549
2002-07-29 20:42:39 +00:00
Nicholas Nethercote
252fb3fba9 This commit introduces two new UInstructions: CCALL_1_0, CCALL_2_0.
These are the first of a generic family for calling C functions.  CCALL_M_N
calls a function with M word-sized arguments and N word-sized return values
(N == 0 or 1, of course).  All stack management is done automatically --
register saving, argument pushing, register restoring.  Rough timings show it's
marginally faster (~3%), probably because the instrumentation phase is slightly
simpler and translations are slighly more compact.

It was introduced because the way Cachegrind was calling its helper functions
was not really legitimate -- it involved pushing RealRegs at a point where
RealRegs shouldn't have been used.  This flukily worked for Cachegrind, but
caused obscure seg faults when I tried using the same technique for the DIDUCE
stuff.  Hence this more general approach.

CCALL_M_N where M+N <= 3 are easy.  More args might be done by abusing spare
fields in the UInstr struct, if really necessary.  But it's not, yet.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@546
2002-07-28 09:53:34 +00:00
Julian Seward
ecd4ee7a79 Wibbles for 1.0.0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@540
2002-07-26 11:34:39 +00:00
Julian Seward
4f5ab3f6c2 Only run __libc_freeres() when valgrinding. It may do invalid free()s
which cause the low-level memory manager to crash.  When valgrinding
that's all protected, but not when cachegrinding etc.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@537
2002-07-26 10:52:48 +00:00
Julian Seward
694e83d6fb Print more helpful message on JIT failure to handle insns starting with 0x0F.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@532
2002-07-25 22:41:40 +00:00
Julian Seward
db16040de4 Track ELF frame changes as appearing in Red Hat Limbo (7.3.92).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@525
2002-07-25 00:49:51 +00:00
Julian Seward
44766a20ca Compile fixes for Red Hat Limbo (7.3.92).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@522
2002-07-24 09:41:52 +00:00
Julian Seward
bf212498f5 Some jokers apparently like setting the CPU's AC (Alignment Check) flag
for god-knows-why reasons.  This causes VG_{READ,WRITE}_MISALIGNED_WORD
to give bus errors.  Redefine them to do the obvious byte-by-byte loads/
stores.  Fortunately they are not performance critical.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@519
2002-07-24 09:36:36 +00:00
Julian Seward
51c33c4afd Assume PUTF modifies %EFLAGS in a completely arbitrary manner, and so
be completely pessimistic if it is encountered during the redundant-flag-
save/restore-elimination pass.  This fixes the following mysterious
failure:

 insane instruction
           27: PUTFL     %ecx

 valgrind: vg_from_ucode.c:2600 (vgPlain_emit_code): Assertion `sane' failed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@516
2002-07-24 09:33:52 +00:00
Julian Seward
b53529ecb5 Support for x86 insn fldenv.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@515
2002-07-23 18:48:39 +00:00
Julian Seward
5b87b4d8a7 Document probs with gcc-3.1 false positives.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@512
2002-07-16 01:49:22 +00:00
Julian Seward
67a4c735a2 At request of Ulrich Drepper, call __libc_freeres() after final __NR_exit
so as to free memory allocated by glibc.  This reduces the leaks reported
in glibc, but causes a stack of read/write-after-free errors which have
to be suppressed :-(


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@507
2002-07-16 01:43:15 +00:00
Dirk Mueller
157ebdd5b0 possible fix for valgrinding problem on longer running kernels (2.4.18-SuSE, update 17 days)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@506
2002-07-15 19:39:51 +00:00
Julian Seward
ee99a560ad Mention kernel probs with R H "Limbo" public beta (hacked 2.4.18).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@504
2002-07-14 10:45:21 +00:00
Julian Seward
fb00a3330d Document some limitations.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@503
2002-07-13 14:09:35 +00:00
Julian Seward
66d6958565 Copy pthread_rwlockattr_setpshared verbatim from LinuxThreads.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@498
2002-07-13 12:58:44 +00:00
Julian Seward
7b7227adc8 Include valgrind.spec and valgrind.spec.in in tarballs.
Also add a line to the description in the .spec.in.
(Shlomi Fish)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@494
2002-07-13 12:37:28 +00:00
Julian Seward
344e4348de (Tim Rowley, verbatim)
The Intel p4 manual suggests inserting a pause instruction in
spin-wait loops as a hint to what the code is doing.  In other
respects it acts just like a nop.  Pause (0xF3 0x90) currently
causes valgrind to panic.  The patch below keeps things running.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@493
2002-07-13 12:32:16 +00:00
Julian Seward
f485f3c6dd Implement fnstenv (store FPU environment, but not regs AIUI)
(Jeff Epler)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@492
2002-07-13 12:27:12 +00:00
Julian Seward
2349ee6191 Print additional useful information immediately prior to
VG_(panic)("VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) failed\n");


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@491
2002-07-13 12:20:35 +00:00
Julian Seward
27c607b91f vg_signals.c: vg_oursignalhandler(): don't longjmp() on fatal signal if
the scheduler's jmp_buf is not valid.  This might avoid at least some
of the following:
   vg_scheduler.c:479 (run_thread_for_a_while): Assertion `trc == 0'
   failed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@490
2002-07-13 12:12:56 +00:00
Julian Seward
4ea574f4f0 Make sigsuspend() work well enough to keep zsh hackers happy.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@489
2002-07-13 11:05:45 +00:00
Julian Seward
e5a8caf44e Make VG_USERREQ__PTHREAD_YIELD actually yield the thread. This used
to work but was broken in a subtle way by the cleanup of rev 1.70.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@488
2002-07-12 22:30:51 +00:00
Julian Seward
e666ed6444 Check for signals to be delivered after every syscall. This avoids
some obscure deadlock cases.  (Neil Conway).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@487
2002-07-12 01:23:03 +00:00
Julian Seward
2709e5a7f9 Add helpful info for package builders.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@482
2002-07-01 08:46:27 +00:00
Julian Seward
6764cec920 Final documentation updates for 1.0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@481
2002-07-01 08:30:05 +00:00
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