]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
23 years ago-----------------------------------------------------------------------------
Nicholas Nethercote [Mon, 7 Apr 2003 14:40:25 +0000 (14:40 +0000)] 
-----------------------------------------------------------------------------
overview
-----------------------------------------------------------------------------
This commit introduces an optimisation that speeds up Memcheck by roughly
-3 -- 28%, and Addrcheck by 1 -- 36%, at least for the SPEC2000 benchmarks on
my 1400MHz Athlon.

Basic idea: that handling of A/V bit updates on %esp-adjustments was quite
sub-optimal -- for each "PUT ESP", a function was called that computed the
delta from the old and new ESPs, and then called a looping function to deal
with it.

Improvements:

  1. most of the time, the delta can be seen from the code.  So there's no need
     to compute it.

  2. when the delta is known, we can directly call a skin function to handle it.

  3. we can specialise for certain common cases (eg. +/- 4, 8, 12, 16, 32),
     including having unrolled loops for these.

This slightly bloats UCode because of setting up args for the call, and for
updating ESP in code (previously was done in the called C function).  Eg. for
`date' the code expansion ratio goes from 14.2 --> 14.6.  But it's much faster.

Note that skins don't have to use the specialised cases, they can just
define the ordinary case if they want;  the specialised cases are only used
if present.

-----------------------------------------------------------------------------
details
-----------------------------------------------------------------------------
Removed addrcheck/ac_common.c, put its (minimal) contents in ac_main.c.

Updated the major interface version, because this change isn't binary
compatible with the old core/skin interface.

Removed the hooks {new,die}_mem_stack_aligned, replaced with the better
{new,die}_mem_stack_{4,8,12,16,32}.  Still have the generic {die,new}_mem_stack
hooks.  These are called directly from UCode, thanks to a new pass that occurs
between instrumentation and register allocation (but only if the skin uses
these stack-adjustment hooks).  VG_(unknown_esp_update)() is called from UCode
for the generic case;  it determines if it's a stack switch, and calls the
generic {new,die}_stack_mem hooks accordingly.  This meant
synth_handle_esp_assignment() could be removed.

The new %esp-delta computation phase is in vg_translate.c.

In Memcheck and Addrcheck, added functions for updating the A and V bits of a
single aligned word and a single aligned doubleword.  These are called from the
specialised functions new_mem_stack_4, etc.  Could remove the one for the old
hooks new_mem_stack_aligned and die_mem_stack_aligned.

In mc_common.h, added a big macro containing the definitions of new_mem_stack_4
et al.  It's ``instantiated'' separately by Memcheck and Addrcheck.  The macro
is a bit klugey, but I did it that way because speed is vital for these
functions, so eg. a function pointer would have slowed things down.

Updated the built-in profiling events appropriately for the changes (removed
one old event, added a new one;  finding their names is left as an exercise for
the reader).

Fixed memory event profiling in {Addr,Mem}check, which had rotted.

A few other minor things.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1510

23 years agoUn-break the head -- the LD_ASSUME_KERNEL thing breaks the entire
Julian Seward [Sun, 6 Apr 2003 23:40:30 +0000 (23:40 +0000)] 
Un-break the head -- the LD_ASSUME_KERNEL thing breaks the entire
universe apart from RH9.  This (and thus RH9 out-of-the-box support)
is now waiting for a reliable configure test for NPTL-ness.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1509

23 years agoA minimal set of changes to make it work on Red Hat 9, at least in the
Julian Seward [Sun, 6 Apr 2003 12:23:27 +0000 (12:23 +0000)] 
A minimal set of changes to make it work on Red Hat 9, at least in the
interim.  All hats off to Graydon Hoare for this, plus to whoever
devised the LD_ASSUME_KERNEL trapdoor.

This does not provide NPTL support.  Instead it turns out we can ask
for the old LinuxThreads interface to be used (wonderful!)

Other than that we have to deal with kernels with SYSINFO pages at the
top of memory.  No big deal, apparently.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1508

23 years agoImplement MMX movd where the src is an mmxreg and the dst is an ireg or
Julian Seward [Fri, 4 Apr 2003 20:40:34 +0000 (20:40 +0000)] 
Implement MMX movd where the src is an mmxreg and the dst is an ireg or
memory.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1507

23 years agoRationalise ucode generation for 4-byte moves into the MMX unit (movd).
Julian Seward [Fri, 4 Apr 2003 00:21:58 +0000 (00:21 +0000)] 
Rationalise ucode generation for 4-byte moves into the MMX unit (movd).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1506

23 years agoSupport __NR_munlockall (syscall 151).
Julian Seward [Thu, 3 Apr 2003 22:35:01 +0000 (22:35 +0000)] 
Support __NR_munlockall (syscall 151).

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1504

23 years agoAdd a fix for this
Julian Seward [Thu, 3 Apr 2003 22:28:00 +0000 (22:28 +0000)] 
Add a fix for this

   vg_scheduler.c:732 (cleanup_waiting_fd_table):
      Assertion `waiters == 1' failed.

from monty@mysql.com.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1502

23 years agoUpdate update-date.
Julian Seward [Thu, 3 Apr 2003 22:09:36 +0000 (22:09 +0000)] 
Update update-date.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1499

23 years agoDocument renaming of valgrind.h to memcheck.h.
Julian Seward [Thu, 3 Apr 2003 22:09:13 +0000 (22:09 +0000)] 
Document renaming of valgrind.h to memcheck.h.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1498

23 years agofix this test for me. You can't rely on having exactly 3 nameservers
Dirk Mueller [Thu, 3 Apr 2003 00:50:21 +0000 (00:50 +0000)] 
fix this test for me. You can't rely on having exactly 3 nameservers
configured in your system, can you?

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1494

23 years agothe following small patch adds support for the (ancient and horrible)
Julian Seward [Wed, 2 Apr 2003 20:10:56 +0000 (20:10 +0000)] 
the following small patch adds support for the (ancient and horrible)
XLAT instruction. Microsoft in their infinite wisdom use it in their OLE
dispatch code...  (from Adam Gundy <arg@cyberscience.com>)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1493

23 years agoFix a couple of missing MMX instructions. As far as I know, the only
Julian Seward [Tue, 1 Apr 2003 23:20:43 +0000 (23:20 +0000)] 
Fix a couple of missing MMX instructions.  As far as I know, the only
missing MMX insns now are those which move a value from an MMX reg to
an integer reg, and these seem pretty rare.  Easy enough to do if anyone
falls across them.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1492

23 years agoUpdated the `cpuid' regression test for the new MMX-enabled behaviour.
Nicholas Nethercote [Mon, 31 Mar 2003 10:33:04 +0000 (10:33 +0000)] 
Updated the `cpuid' regression test for the new MMX-enabled behaviour.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1491

23 years agoTeach memcheck skin how to deal with MMX instrumentation.
Julian Seward [Sun, 30 Mar 2003 01:52:26 +0000 (01:52 +0000)] 
Teach memcheck skin how to deal with MMX instrumentation.
Valgrind should now be fairly usable with MMX code.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1490

23 years agoTeach cachegrind about MMX uopcodes. Nick, can you check this? Thx -- J
Julian Seward [Fri, 28 Mar 2003 17:21:29 +0000 (17:21 +0000)] 
Teach cachegrind about MMX uopcodes.  Nick, can you check this?  Thx -- J

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1489

23 years agoMore MMX stuff, including a bunch of prefetch insns.
Julian Seward [Thu, 27 Mar 2003 23:52:58 +0000 (23:52 +0000)] 
More MMX stuff, including a bunch of prefetch insns.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1488

23 years agoUpdate response to 'cpuid' to claim MMXness. Revised magic number
Julian Seward [Thu, 27 Mar 2003 21:54:58 +0000 (21:54 +0000)] 
Update response to 'cpuid' to claim MMXness.  Revised magic number
supplied by JeremyF.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1487

23 years agoMore C++ syntax leakage fixes.
Julian Seward [Thu, 27 Mar 2003 07:48:28 +0000 (07:48 +0000)] 
More C++ syntax leakage fixes.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1486

23 years agoFix C++ syntax leakage.
Julian Seward [Thu, 27 Mar 2003 00:39:21 +0000 (00:39 +0000)] 
Fix C++ syntax leakage.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1485

23 years agoFix a bug to do with lazy eflags updating and FPU insns.
Julian Seward [Wed, 26 Mar 2003 23:43:57 +0000 (23:43 +0000)] 
Fix a bug to do with lazy eflags updating and FPU insns.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1484

23 years agoImplement support for the MMX instruction set. The scheme used is
Julian Seward [Wed, 26 Mar 2003 21:08:13 +0000 (21:08 +0000)] 
Implement support for the MMX instruction set.  The scheme used is
the same as that for FPU instructions.  That is, regard the MMX state
(which is the same as the FPU state) opaquely, and every time we
need to do a MMX instruction, move the simulated MMX state into the
real CPU, do the instruction, and move it back.  JeremyF's optimisation
to minimise FPU saves/restores applies automatically here.

So, this scheme is simple.  It will cause memcheck to complain bitterly
if uninitialised data is copied through the MMX registers, in the same
way that memcheck complains if you move uninit data through the FPU
registers.  Whether this turns out to be a problem remains to be seen.

Most instructions are done, and doing the rest is easy enough, I just
need people to send test cases so I can do them on demand.

(Core) UCode has been extended with 7 new uinstrs:

   MMX1 MMX2 MMX3
      -- 1/2/3 byte mmx insns, no references to
         integer regs or memory, copy exactly to the output stream.

   MMX_MemRd  MMX_MemWr
      -- 2 byte mmx insns which read/write memory and therefore need
         to have an address register patched in at code generation
         time.  These are the analogues to FPU_R / FPU_W.

   MMX_RegRd  MMX_RegWr
      -- These have no analogues in FPU land.  They hold 2 byte insns
         which move data to/from a normal integer register (%eax etc),
         and so this has to be made explicit so that (1) a suitable
         int reg can be patched in at codegen time, and (2) so that
         memcheck can do suitable magic with the V bits going into/
         out of the MMX regs.

Nulgrind (ok, this is a nop, but still ...) and AddrCheck's
instrumenters have been extended to cover these new UInstrs.  All
others (cachesim, memcheck, lackey, helgrind, did I forget any)
abort when they see any of them.  This may be overkill but at least
it ensures we don't forget to implement it in those skins.
[A bad thing would be that some skin silently passes along
MMX uinstrs because of a default: case, when it should actually
do something with them.]

If this works out well, I propose to backport this to 2_0_BRANCH.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1483

23 years agoDocumentation changes only.
Nicholas Nethercote [Tue, 25 Mar 2003 13:38:35 +0000 (13:38 +0000)] 
Documentation changes only.

Added a couple of links to the "Valgrind skins" doc, because there were none.

Added a section "suggested skins" in the "Valgrind skins" doc, just in case it
inspires anyone in user-land.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1482

23 years agoSuppressions for SuSE 8.2.
Julian Seward [Sun, 16 Mar 2003 10:55:06 +0000 (10:55 +0000)] 
Suppressions for SuSE 8.2.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1480

23 years agoFix up the documentation to be just about OK for version 2.0.
Julian Seward [Sun, 16 Mar 2003 01:12:16 +0000 (01:12 +0000)] 
Fix up the documentation to be just about OK for version 2.0.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1461

23 years agoComment change only: remove discussion of --client-perms flag and clarify
Julian Seward [Sat, 15 Mar 2003 23:39:11 +0000 (23:39 +0000)] 
Comment change only: remove discussion of --client-perms flag and clarify
performance consequences of client requests.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1460

23 years agoDuh. Make the system buildable again following recent commit
Julian Seward [Sat, 15 Mar 2003 20:03:33 +0000 (20:03 +0000)] 
Duh.  Make the system buildable again following recent commit
of include/valgrind.h rev 1.10.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1459

23 years agostartup_segment_callback: Get rid of completely pointless check re
Julian Seward [Sat, 15 Mar 2003 20:01:21 +0000 (20:01 +0000)] 
startup_segment_callback: Get rid of completely pointless check re
ASSUMED_EXE_BASE.  This is now pointless, and causes problems for people
using Clearcase, since it seems their shared objects may not follow
the convention that they end in .so.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1458

23 years agoVarious fixes to the client-perms include files to stop gccs yelping
Julian Seward [Sat, 15 Mar 2003 19:20:52 +0000 (19:20 +0000)] 
Various fixes to the client-perms include files to stop gccs yelping
at high warning levels.  Partially due to Andreas Jaeger and
Hans-Peter Nilsson.

MERGE TO STABLE.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1457

23 years agoA little cpp magic to cause compilation to fail if valgrind.h is included
Julian Seward [Sat, 15 Mar 2003 19:12:43 +0000 (19:12 +0000)] 
A little cpp magic to cause compilation to fail if valgrind.h is included
directly into sources (it should not be, and was causing people problems).

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1456

23 years agoFix stupid typo in last commit.
Nicholas Nethercote [Fri, 7 Mar 2003 13:54:50 +0000 (13:54 +0000)] 
Fix stupid typo in last commit.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1452

23 years agoFixed very minor bug with profiling. With cachegrind, if you specified
Nicholas Nethercote [Fri, 7 Mar 2003 11:13:42 +0000 (11:13 +0000)] 
Fixed very minor bug with profiling.  With cachegrind, if you specified
--profile=yes without having built it for profiling (by #including
vg_profile.c) it gave a "pushcc" panic, instead of a nice explanation.

This is because I assumed no profiling events would be pushed/popped before
VG_(init_profiling)() was called.  But cachegrind malloc's some memory in
post_clo_init(), which takes place before VG_(init_profiling)().

So I changed the dummy pushcc/popcc to give the nice error message, instead of
uninformatively panicking.

MERGE TO STABLE

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1451

23 years agovg_profile.c, which is #included by skins that want to profile, was using some
Nicholas Nethercote [Thu, 6 Mar 2003 15:56:37 +0000 (15:56 +0000)] 
vg_profile.c, which is #included by skins that want to profile, was using some
core only functions (vg_assert and VG_(core_panic)), which screwed things up.
Replaced them with the skin versions.  I don't know how this ever worked.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1450

23 years agoRequire automake >= 1.5, as suggested by Dirk Mueller.
Julian Seward [Sat, 1 Mar 2003 01:26:55 +0000 (01:26 +0000)] 
Require automake >= 1.5, as suggested by Dirk Mueller.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1448

23 years agoChange a bunch of AM_CFLAGS, AM_CXXFLAGS to CFLAGS, CXXFLAGS.
Julian Seward [Fri, 28 Feb 2003 23:22:44 +0000 (23:22 +0000)] 
Change a bunch of AM_CFLAGS, AM_CXXFLAGS to CFLAGS, CXXFLAGS.
The AM_ versions totally break compilation on RH6.2.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1447

23 years agoAdded a stderr filter for new_override, that removes the exact numbers for
Nicholas Nethercote [Wed, 26 Feb 2003 10:16:02 +0000 (10:16 +0000)] 
Added a stderr filter for new_override, that removes the exact numbers for
malloc, because different glibc versions seem to allocate different amounts of
memory.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1446

23 years agoMake CXXFLAGS be the same as AM_CXXFLAGS, so the correct options are
Julian Seward [Tue, 25 Feb 2003 23:49:46 +0000 (23:49 +0000)] 
Make CXXFLAGS be the same as AM_CXXFLAGS, so the correct options are
used to build the regression tests.  I don't know if this is really
the correct way to fix this problem.  I don't understand why
AM_CXXFLAGS aren't used by default for C++, seeing as how AM_CFLAGS
evidently are used for C sources.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1445

23 years agodon't delete it too early
Dirk Mueller [Tue, 25 Feb 2003 11:52:52 +0000 (11:52 +0000)] 
don't delete it too early

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1444

23 years agofix make distcheck with newer automake
Dirk Mueller [Tue, 25 Feb 2003 01:48:15 +0000 (01:48 +0000)] 
fix make distcheck with newer automake

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1443

23 years agoAdded a regression test that checks if command line arguments with spaces work.
Nicholas Nethercote [Mon, 24 Feb 2003 22:05:38 +0000 (22:05 +0000)] 
Added a regression test that checks if command line arguments with spaces work.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1442

23 years agoUndo rev 1.78, which I committed by accident. Duh.
Julian Seward [Mon, 24 Feb 2003 21:59:31 +0000 (21:59 +0000)] 
Undo rev 1.78, which I committed by accident.  Duh.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1441

23 years ago o I fixed a small bug: the code in coregrind/vg_syscalls.c seems
Julian Seward [Mon, 24 Feb 2003 21:55:34 +0000 (21:55 +0000)] 
  o  I fixed a small bug:  the code in coregrind/vg_syscalls.c seems
     to assume that all sockaddrs are non-NULL and non-zero in
     length.  This isn't always true, and when I ran a program that
     used a NULL sockaddr through Valgrind it segfaulted.  I believe
     that the change that I made fixes this bug in general, but I
     might be overlooking something.

From kclark@CetaceanNetworks.com (Kevin D. Clark)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1440

23 years agoChange the recently added VG_(memcmp) to use UChars instead of Chars.
Nicholas Nethercote [Mon, 24 Feb 2003 21:43:05 +0000 (21:43 +0000)] 
Change the recently added VG_(memcmp) to use UChars instead of Chars.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1439

23 years agoFixes handling of parameters with spaces in, and misc other
Julian Seward [Mon, 24 Feb 2003 21:42:53 +0000 (21:42 +0000)] 
Fixes handling of parameters with spaces in, and misc other
magic hacks from Nick.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1438

23 years agoSupport for glibc-2.3.X. (from Stephan Kulow)
Julian Seward [Mon, 24 Feb 2003 21:24:41 +0000 (21:24 +0000)] 
Support for glibc-2.3.X.  (from Stephan Kulow)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1437

23 years ago[Julian, you might like to check these changes]
Nicholas Nethercote [Mon, 24 Feb 2003 10:49:08 +0000 (10:49 +0000)] 
[Julian, you might like to check these changes]

Fixed demangler bug -- it was relying on glibc for some functions.  This
triggered an incredibly obscure bug in my experimental skin -- memcpy() was
called within the demangler at (about?) the same time as the dynamic linker was
fiddling with the memcpy() entry, which caused one word of memory (probably
some counter in the dynamic linker) to be incremented, which my skin didn't
like.

So I removed all (AFAICT) of the demangler's dependencies on glibc.  This
required adding macros for memset, memcpy, strlen, strcmp..., to replace them
with their VG_(...) version.  The only #includes now are to .h files that are
part of Valgrind.

Also required #defining "size_t" as "Int".

Also required adding VG_(memcmp)() to vg_mylibc.c.

Also removed the "-1 == EOF" part of the compile-time test in safe-ctype.h
that checks the character set is ASCII.  This was to remove the dependency
on stdio.h.  Slightly dodgy, but should be ok I think/hope.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1436

23 years agoAdded two new events: pre_deliver_signal and post_deliver_signal.
Nicholas Nethercote [Mon, 24 Feb 2003 10:42:47 +0000 (10:42 +0000)] 
Added two new events: pre_deliver_signal and post_deliver_signal.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1435

23 years agoAdded two new events: pre_deliver_signal and post_deliver_signal.
Nicholas Nethercote [Mon, 24 Feb 2003 10:36:48 +0000 (10:36 +0000)] 
Added two new events: pre_deliver_signal and post_deliver_signal.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1434

23 years agoAdded a useful skin instrumentation function.
Nicholas Nethercote [Mon, 24 Feb 2003 10:32:51 +0000 (10:32 +0000)] 
Added a useful skin instrumentation function.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1433

23 years agoIncreased maximum number of non-compact helpers.
Nicholas Nethercote [Mon, 24 Feb 2003 10:21:45 +0000 (10:21 +0000)] 
Increased maximum number of non-compact helpers.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1432

23 years ago Initial rough hack to spot the stack segment at startup by looking
Julian Seward [Sun, 23 Feb 2003 03:54:59 +0000 (03:54 +0000)] 
   Initial rough hack to spot the stack segment at startup by looking
   for a rwx mapping which contains the startup %esp.

Might be better to look for just rw-.  Stack might not be executable
if there's a noexec patch, and x86-64 actually enforces the x bit
distinctly from r.

--> Look for just rw-.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1431

23 years agoFix comment bug.
Julian Seward [Sun, 23 Feb 2003 03:40:03 +0000 (03:40 +0000)] 
Fix comment bug.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1429

23 years agoMake poll() return (errno==EINTR) if the poll is interrupted by a signal.
Julian Seward [Sun, 23 Feb 2003 03:37:58 +0000 (03:37 +0000)] 
Make poll() return (errno==EINTR) if the poll is interrupted by a signal.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1428

23 years agoHopefully deal with system 252 (__NR_exit_group) correctly.
Julian Seward [Sun, 23 Feb 2003 03:26:08 +0000 (03:26 +0000)] 
Hopefully deal with system 252 (__NR_exit_group) correctly.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1427

23 years ago---> 1.9.4
Julian Seward [Sun, 23 Feb 2003 03:25:36 +0000 (03:25 +0000)] 
---> 1.9.4

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1426

23 years agoSupport kernels > 2.5.43 (David Kimdon <dwhedon@debian.org>)
Julian Seward [Sun, 23 Feb 2003 03:09:33 +0000 (03:09 +0000)] 
Support kernels > 2.5.43 (David Kimdon <dwhedon@debian.org>)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1425

23 years agoApply the following:
Julian Seward [Sun, 23 Feb 2003 03:00:29 +0000 (03:00 +0000)] 
Apply the following:

The veneers for msgrcv in vg_intercept.c and vg_libpthread.c are not
returning the number of bytes read correctly - they always return zero
for any non-error case, which causes programs using msgrcv to behave
somewhat non-optimally when running under valgrind ;-)

Attached is a patch against 1.9.3 which fixes this.

Tom

--
Tom Hughes (thh@cyberscience.com)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1424

23 years agoFurther cleanups re new method for finding the stack segment at
Julian Seward [Sun, 23 Feb 2003 01:41:17 +0000 (01:41 +0000)] 
Further cleanups re new method for finding the stack segment at
startup.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1423

23 years agoInitial rough hack to spot the stack segment at startup by looking
Julian Seward [Sun, 23 Feb 2003 01:25:51 +0000 (01:25 +0000)] 
Initial rough hack to spot the stack segment at startup by looking
for a rwx mapping which contains the startup %esp.  This should be
more robust than the previous mechanism, which checked a small number
of known places and gave up if none matched.  This change is motivated
by Gentoo Linux's high security mode, in which the stack location is
chosen randomly for each new process.

Thanks to Catherine Allen for helping out on this.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1422

23 years agoChanged comments only: added a couple of missing syscall numbers.
Nicholas Nethercote [Wed, 19 Feb 2003 11:39:02 +0000 (11:39 +0000)] 
Changed comments only:  added a couple of missing syscall numbers.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1421

23 years agoCommitted Jeremy F's patch 86:
Nicholas Nethercote [Mon, 17 Feb 2003 10:09:19 +0000 (10:09 +0000)] 
Committed Jeremy F's patch 86:

  Fix a bug introduced in err_extra changes; not all errors have an 'extra'.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1420

23 years agoFixed a minor bug -- the condition for determining whether
Nicholas Nethercote [Mon, 10 Feb 2003 10:17:26 +0000 (10:17 +0000)] 
Fixed a minor bug -- the condition for determining whether
VG_(handle_esp_assignment)() was needed by a skin (and thus whether to register
it in the baseBlock) was different to that used when determining whether to
call it in code generation... so it could be (attempted to be) called having
not been registered.

Fixed this by consistifying the conditions, using a function
VG_(need_to_handle_esp_assignment)() that is used in both places.  The bug
hadn't been found previously because no existing skin exercised the mismatched
conditions in conflicting ways.

Also took VG_(track).post_mem_write out of consideration because it's no longer
important (due to a change in how stack switching is detected).

----
Improved the error message for when a helper can't be found in the baseBlock --
now looks up the debug info to tell you the name of the not-found function.

----
Increased the number of noncompact helpers allowed from 8 to 24

----
Removed a magic number that was hardcoded all over the place, introducing
VG_MAX_REGS_USED for the size of the arrays needed by VG_(get_reg_usage)()

----
Also added these functions

   VG_(get_archreg)()
   VG_(get_thread_archreg)()
   VG_(get_thread_shadow_archreg)()
   VG_(set_thread_shadow_archreg)()

which can be useful for skins.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1419

23 years agoFix really stupid cut + paste error.
Nicholas Nethercote [Thu, 6 Feb 2003 08:17:08 +0000 (08:17 +0000)] 
Fix really stupid cut + paste error.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1418

23 years agoUgh, fixed it properly this time.
Nicholas Nethercote [Wed, 5 Feb 2003 22:08:58 +0000 (22:08 +0000)] 
Ugh, fixed it properly this time.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1417

23 years agoFixed comment typo.
Nicholas Nethercote [Wed, 5 Feb 2003 22:06:48 +0000 (22:06 +0000)] 
Fixed comment typo.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1416

23 years agoMade VGOFF_(helper_idiv_64_32) and all the similar helper offsets visible to
Nicholas Nethercote [Mon, 3 Feb 2003 12:33:31 +0000 (12:33 +0000)] 
Made VGOFF_(helper_idiv_64_32) and all the similar helper offsets visible to
skins, so they can determine which helper is being called for CALLM
instructions.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1415

23 years agoMinor documentation update about 'details'.
Nicholas Nethercote [Mon, 3 Feb 2003 12:21:53 +0000 (12:21 +0000)] 
Minor documentation update about 'details'.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1414

23 years agoMade the setting of VG_(details).avg_translation_sizeB optional, defaulting to
Nicholas Nethercote [Mon, 3 Feb 2003 12:20:07 +0000 (12:20 +0000)] 
Made the setting of VG_(details).avg_translation_sizeB optional, defaulting to
100 bytes (added VG_DEFAULT_TRANS_SIZEB).  Took the now-unnecessary settings
out of Nulgrind and CoreCheck.  Also made .avg_translation_sizeB a UInt (from
an Int), to avoid possibility of negatives.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1413

23 years agoAdded some functions for skins to access shadow registers:
Nicholas Nethercote [Mon, 3 Feb 2003 12:03:22 +0000 (12:03 +0000)] 
Added some functions for skins to access shadow registers:
VG_(get_shadow_archreg), VG_(set_shadow_archreg), VG_(shadow_archreg_address).
Curiously, the only way skins could previously access them was with
VG_(shadow_reg_offset), which wasn't very flexible.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1412

23 years agoAdded a comment.
Nicholas Nethercote [Mon, 3 Feb 2003 11:25:34 +0000 (11:25 +0000)] 
Added a comment.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1411

23 years agoRenamed VG_(nameCondcode)() as VG_(name_UCondcode)() to make it consistent
Nicholas Nethercote [Mon, 3 Feb 2003 11:17:46 +0000 (11:17 +0000)] 
Renamed VG_(nameCondcode)() as VG_(name_UCondcode)() to make it consistent
with similar functions, and made it visible to skins (useful).

Also bumped up the skin interface minor version number due to this change; this
bumping will cover any other binary-compatible changes between now and the next
release (after 1.9.3).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1410

23 years agoFixed minor error in --trace-codegen=1xxxx output that meant 'shrdl' was being
Nicholas Nethercote [Mon, 3 Feb 2003 11:08:52 +0000 (11:08 +0000)] 
Fixed minor error in --trace-codegen=1xxxx output that meant 'shrdl' was being
printed as 'shldl'.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1409

23 years agoMade more informative the error message that is shown when liveness problems
Nicholas Nethercote [Mon, 3 Feb 2003 11:07:03 +0000 (11:07 +0000)] 
Made more informative the error message that is shown when liveness problems
occur... this is helpful when writing skins, because it's easy for problems
with SK_(instrument)() to screw it up.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1408

23 years agoAdded VG_(get_obj)().
Nicholas Nethercote [Tue, 28 Jan 2003 20:40:57 +0000 (20:40 +0000)] 
Added VG_(get_obj)().

Also added declaration for VG_(get_error_where)() to vg_skin.h (which should
have been included with the last commit).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1407

23 years agoTwo minor changes:
Nicholas Nethercote [Tue, 28 Jan 2003 19:59:38 +0000 (19:59 +0000)] 
Two minor changes:

  - When recording errors, VG_(dup_extra_and_update)() previously was only
    called if the 'extra' field was non-NULL.  Now it's always called.
    This is for two reasons:

      a. The 'extra' field could be holding a non-pointer value that just
         happens to be 0
      b. The skin might want to update the error, even if it doesn't use
         the 'extra' field.

    A pretty minor change that shouldn't upset anybody.

  - Made the ExeContext 'where' field of an error visible to skins, by
    adding VG_(get_error_where)().  This can be useful, eg. for comparing
    errors for equality.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1406

23 years agoSmall changes to expected output, due to recent changes in leak-check
Nicholas Nethercote [Tue, 28 Jan 2003 19:53:09 +0000 (19:53 +0000)] 
Small changes to expected output, due to recent changes in leak-check
reporting.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1405

23 years agoI forgot to get rid of these when deleting the client stack perms stuff.
Julian Seward [Sun, 5 Jan 2003 13:11:55 +0000 (13:11 +0000)] 
I forgot to get rid of these when deleting the client stack perms stuff.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1404

23 years agoAdd syscall 185 (__NR_capset). From Gerald Carter <jerry@samba.org>.
Julian Seward [Sun, 5 Jan 2003 12:35:19 +0000 (12:35 +0000)] 
Add syscall 185 (__NR_capset).  From Gerald Carter <jerry@samba.org>.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1403

23 years agoOnly complain three times about unhandled ioctls, then shut up. Stops
Julian Seward [Sun, 5 Jan 2003 12:19:35 +0000 (12:19 +0000)] 
Only complain three times about unhandled ioctls, then shut up.  Stops
it complaining endlessly when running kscd.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1402

23 years agoIncrease default bb limit from 1e+12 to 1e+15. The former limit could
Julian Seward [Sun, 5 Jan 2003 12:16:30 +0000 (12:16 +0000)] 
Increase default bb limit from 1e+12 to 1e+15.  The former limit could
easily be reached in ~12 hours flat out computation on a fast machine
with a simple skin.  It happened to me.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1401

23 years agoWhen ignoring memcheck-style client requests for block permissions
Julian Seward [Sat, 28 Dec 2002 13:09:57 +0000 (13:09 +0000)] 
When ignoring memcheck-style client requests for block permissions
changes, print a message the first 3 times so the user at least knows
these requests are getting ignored.  If I was less lazy I would make
these requests -- at least those pertaining to memory addressibility
-- be done properly.  But I'm too lazy.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1400

23 years agoRemove the mechanism which allowed clients to set block permissions
Julian Seward [Sat, 28 Dec 2002 12:55:48 +0000 (12:55 +0000)] 
Remove the mechanism which allowed clients to set block permissions
on their stacks and have those blocks automatically cleared when the
stack retreats past them.  This never really worked, certainly didn't
work in a multithreaded setting, and slowed everything down due to
having to do even more stuff at %esp changes.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1399

23 years agoRecognise Leak suppressions.
Julian Seward [Sat, 28 Dec 2002 12:36:55 +0000 (12:36 +0000)] 
Recognise Leak suppressions.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1398

23 years agosynth_jcond_lit: fix bug in the sequences generated for LE/NLE.
Julian Seward [Sat, 28 Dec 2002 00:19:00 +0000 (00:19 +0000)] 
synth_jcond_lit: fix bug in the sequences generated for LE/NLE.
These assumed that ROR sets the P and Z flags and in fact it
sets neither.  Add an extra OR insn to really set those flags.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1397

23 years agoMinor cleanup and verification of the lazy-eflag optimisation stuff.
Julian Seward [Sat, 28 Dec 2002 00:04:08 +0000 (00:04 +0000)] 
Minor cleanup and verification of the lazy-eflag optimisation stuff.
As of now it is correct, following several hours study.

- Rename upd_cc parameters to simd_flags since that's what they
  really mean: does this insn interact at all with %EFLAGS
  (the simulated flags) ?

- Have a convention that calls to new_emit which specify
  FlagsEmpty for both the def and use sets should pass False
  as the simd_flags parameter; this seems more logical than
  saying True.  From partial evaluation of new_emit with
  these args one can see it does nothing under such circumstances,
  as one would hope.

- Add an alternative, unused implementation of new_emit in
  which the state space is explicitly enumerated.  Instructive.

--------------------------------------------------------------

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1396

23 years agoFix type errors in args to VG_(new_emit). No practical effect, since
Julian Seward [Thu, 26 Dec 2002 17:10:12 +0000 (17:10 +0000)] 
Fix type errors in args to VG_(new_emit).  No practical effect, since
(Int)False == (Int)FlagsEmpty, but still.

Whilst hunting (completely unsuccessfully) for some bug causing
MySQL to malfunction with some skins (memcheck), or with most
skins when --single-step=yes.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1395

23 years agoImplement pthread_getconcurrency, in the same way as LinuxThreads does it.
Julian Seward [Thu, 26 Dec 2002 12:16:11 +0000 (12:16 +0000)] 
Implement pthread_getconcurrency, in the same way as LinuxThreads does it.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1393

23 years agoFix longstanding bug in make_thread_jump_to_cancelhdlr, which caused
Julian Seward [Thu, 26 Dec 2002 11:51:50 +0000 (11:51 +0000)] 
Fix longstanding bug in make_thread_jump_to_cancelhdlr, which caused
pthread_join to a cancelled thread not return PTHREAD_CANCELED as it
should.  This was due to a mix up with stack offsets.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1392

23 years agoDon't panic on encountering a LeakSupp.
Julian Seward [Thu, 26 Dec 2002 11:50:21 +0000 (11:50 +0000)] 
Don't panic on encountering a LeakSupp.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1391

23 years agoImplement suppressions for leak checks, which is a fairly frequently
Julian Seward [Thu, 26 Dec 2002 01:53:45 +0000 (01:53 +0000)] 
Implement suppressions for leak checks, which is a fairly frequently
asked-for feature.

A leak-check suppression looks like any other, and has the name 'Leak':

{
   example-leak-suppression
   Memcheck,Addrcheck:Leak
   fun:malloc
   fun:foo
   fun:main
}

Fitting this into the core/skin split proved very tricky.  Problem is
we want to scan the suppressions list to find Leak suppressions, but

- The core code can't do it because LeakSupp is a skin-specific
  suppression kind.

- The skin code can't do it because most (all) of the types and
  structures for the suppressions are private to the core.

Eventual "solution" (least-worst thing I could think of) is for the
skins using the leak checker to pass it the value of LeakSupp.
Even that isn't really clean because the skins consider it a value
of type MemCheckSuppKind but the core thinks it must be a
CoreSuppKind, and the two are not to be reconciled.  So I kludged
around this by casting it to a UInt.

Nick, perhaps you know some way to smooth this out?

Apart from that all changes are straightforward.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1390

23 years agoDon't assume Perl lives in /usr/bin; do a proper test for it.
Julian Seward [Sun, 22 Dec 2002 19:32:23 +0000 (19:32 +0000)] 
Don't assume Perl lives in /usr/bin; do a proper test for it.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1389

23 years ago--> 1.9.3 (not ready yet, but change it anyway)
Julian Seward [Sun, 22 Dec 2002 19:26:30 +0000 (19:26 +0000)] 
--> 1.9.3 (not ready yet, but change it anyway)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1388

23 years agoVG_(print_malloc_stats): change a %d to a %u.
Julian Seward [Sun, 22 Dec 2002 19:24:22 +0000 (19:24 +0000)] 
VG_(print_malloc_stats): change a %d to a %u.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1387

23 years agovg_scan_all_valid_memory: Don't prod any page unless we're sure we
Julian Seward [Sun, 22 Dec 2002 19:11:14 +0000 (19:11 +0000)] 
vg_scan_all_valid_memory: Don't prod any page unless we're sure we
need to.  Poking pages unnecessarily can cause a page fault which
under some rare circumstances can cause the kernel to extend the stack
segment all the way down to the poked page, which is seriously bad.

Fixes a bug shown by --trace-children=yes --skin=addrcheck
--leak-check=yes when running OpenOffice 1.0.1 on SuSE 8.1. This
distro seems to run with no stack limit, which is one prerequisite of
this bug.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1386

23 years agoImplement ADC Ib, AL.
Julian Seward [Mon, 16 Dec 2002 00:14:02 +0000 (00:14 +0000)] 
Implement ADC Ib, AL.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1385

23 years agoFix bug in MOV Iv,Ev when Ev is a reg. Noticed by Magnus Christensson
Julian Seward [Mon, 16 Dec 2002 00:10:30 +0000 (00:10 +0000)] 
Fix bug in MOV Iv,Ev when Ev is a reg.  Noticed by Magnus Christensson
<mch@virtutech.se>.  The bug lasted this long because there is an
alternative shorter encoding for the same insn which is usually used
in preference.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1384

23 years agoSuppressions for R H 8.
Julian Seward [Sun, 15 Dec 2002 23:09:24 +0000 (23:09 +0000)] 
Suppressions for R H 8.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1383

23 years agoRemove spurious \n in message.
Julian Seward [Sun, 15 Dec 2002 13:35:40 +0000 (13:35 +0000)] 
Remove spurious \n in message.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1382

23 years agoChange the behaviour of VG_(get_fnname) back to what it was, viz, not
Julian Seward [Sun, 15 Dec 2002 13:11:39 +0000 (13:11 +0000)] 
Change the behaviour of VG_(get_fnname) back to what it was, viz, not
adding offsets ("+N") to the end of function names.  Make a new
function VG_(get_fnname_w_offset) with that behaviour and use it for
%y in VG_(printf) et al.

This is needed so that all addresses within a function generate the
same function name.  The offset'd behaviour was breaking the cache
profiler and dependent program kcachegrind.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1381

23 years ago#if 0 out unused functions.
Julian Seward [Sun, 15 Dec 2002 03:10:42 +0000 (03:10 +0000)] 
#if 0 out unused functions.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1380

23 years agoThis test should actually elicit a (false) warning from memcheck,
Julian Seward [Sun, 15 Dec 2002 02:59:03 +0000 (02:59 +0000)] 
This test should actually elicit a (false) warning from memcheck,
so the .stderr.exp should reflect that.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1379