90 Commits

Author SHA1 Message Date
Dirk Mueller
2446c65296 only say something if there is something to say
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2037
2003-11-19 00:55:32 +00:00
Nicholas Nethercote
fb2d543ee8 Started to rescind the name "skin", replacing it with "tool". Did this in all
the places that normal users will see:

  - command line: --tool=foo (although --skin=foo still works)
  - docs: removed all traces (included renaming coregrind_skins.html to
    coregrind_tools.html)
  - in the usage messages
  - in error messages

Also did in in some places that I judged were unlikely to cause clashes with
existing workspaces:

  - in the header comments of many files (eg. "This file is part of Memcheck, a
    Valgrind tool for...")
  - in the regtests script
  - in the .supp files
  - in AUTHORS
  - in README_MISSING_SYSCALL_OR_IOCTL

Also update the AUTHORS file to mention Jeremy.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2027
2003-11-14 17:47:54 +00:00
Jeremy Fitzhardinge
d6fb2a6d85 Oops, add new files
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1976
2003-10-31 18:52:18 +00:00
Jeremy Fitzhardinge
65649c9d47 Patch from Robert Walsh <rjwalsh@durables.org>. Adds some new client
requests to allow client code to print messages through Valgrind's
logging mechanism.  The new requests are:
  VALGRIND_PRINTF - do a normal printf (prefixed with **PID**)
  VALGRIND_PRINTF_BACKTRACE - do a printf with stack trace
  VALGRIND_INTERNAL_PRINTF - printf, but for internal use (prefixed with ==PID==)
  VALGRIND_INTERNAL_PRINTF_BACKTRACE - as above, with backtrace


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1974
2003-10-31 07:12:21 +00:00
Nicholas Nethercote
f24e49d184 Change things so that helgrind regtests pass on my machine -- changed stderr
filters to strip out varying things, and changed outputs correspondingly.  Yell
if this breaks them for you.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1952
2003-10-18 14:16:01 +00:00
Jeremy Fitzhardinge
1e6361234c A complete reworking of Valgrind's handling of system calls and signals,
with the aim of making it more robust, more correct and perhaps faster.

This patch removes the need to poll blocking syscalls, by adding a proxy
LWP for each application thread.  This LWP is a kernel thread whose job
is to run all (potentially) blocking syscalls, and also to handle signals.

This allows the kernel to do more of the work of dealing with signals,
so on kernels which do this properly (2.6), Valgrind's behavious is a
lot more posix compliant.  On base 2.4 kernels, we emulate some of the
missing 2.6 functionality.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1918
2003-10-13 22:26:55 +00:00
Nicholas Nethercote
138ada5bc2 Fixed readv() and writev() so they won't fall over if they are given a negative
count.  Added a regression test for it.

Updated the basic test stderr filter to strip out line numbers from
vg_intercept.c

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1812
2003-09-04 21:57:45 +00:00
Nicholas Nethercote
9cad96992f Allow for 1 and 2 digit pids
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1741
2003-07-08 20:59:57 +00:00
Dirk Mueller
faf02201e5 spelling fixes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1715
2003-07-04 16:18:15 +00:00
Nicholas Nethercote
136c7fba2c Fixed cpuid regtest, which was broken by the switch to using the machine's real
CPUID.

Also added filters to Makefiles where missing;  "make regtest" was broken
within distributions created using "make dist", now fixed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1709
2003-06-29 10:12:58 +00:00
Nicholas Nethercote
83ef1ca2ed Some Makefile.am changes. Lots of them affected:
- changed deprecated INCLUDES variable to AM_CPPFLAGS

- moved the -DVG_LIBDIR definition from AM_CFLAGS into AM_CPPFLAGS

- generally neatened them up a bit -- removed old commented out stuff, fixed a
  couple of other minor things

Everything works for me, hopefully it won't break things for anyone else...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1680
2003-06-12 14:13:05 +00:00
Julian Seward
46aa527659 Fixed problems with reg tests for frames below main(), which were different
under some setups.

Also fixed problem with Cachegrind tests, by filtering out P4s'
warning message.

Also fixed 'mismatches'.

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


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1616
2003-05-05 16:18:51 +00:00
Nicholas Nethercote
ba72812e02 This commit allows Valgrind to be run in-place from the source tree, without
requiring "make install".  This is good for two reasons:

1. shorter compile times ("make" instead of "make install")
2. don't need to install before running the regression tests

Changes:
 - root Makefile now builds a libpthread.so.0 symlink to libpthread.so, which
   was needed.

 - startup script accepts a --in-place=<dir> option for running a non-installed
   version, where <dir> is the root of the src tree

 - VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) had to be fiddled with a bit

 - tests/vg_regtest now uses the --in-place option to test the non-installed
   version


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1614
2003-05-05 12:47:25 +00:00
Nicholas Nethercote
9b3ef6f767 Improved filtering so that 'overlap' test less likely to fail.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1611
2003-05-05 09:09:08 +00:00
Dirk Mueller
04fe80c7e2 be a bit more libc tolerant
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1553
2003-04-24 01:01:01 +00:00
Nicholas Nethercote
dc0fe27537 Changed things so that the regression test script (vg_regtest) is no longer
installed, as it was silly since the reg tests themselves aren't installed.
Updated the "make regtest" target to use the uninstalled version in tests/.

Also, vg_regtest now no longer uses the installed version of Valgrind to do the
testing, but instead coregrind/valgrind.  This means that you don't have to do
make install with your buggy changes before running the regtests on them :)

I even updated the RPM package .spec file!

Thanks to Dirk M�ller for the suggestion.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1551
2003-04-23 21:48:20 +00:00
Nicholas Nethercote
dd6eacf7ff Now counting tests and stdout failures and stderr failures separately and
correctly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1547
2003-04-23 17:47:13 +00:00
Dirk Mueller
ba862b918e - fix regression tests counting
- unset $VALGRIND_OPTS (fixes 6 testsuite failures)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1545
2003-04-23 16:52:06 +00:00
Dirk Mueller
02b63b3ba8 reapply automake fixes. make check will now generate the binaries which
are only required for regression testing.

If this breaks something, please mail me first instead of reverting.
Thank you.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1530
2003-04-17 17:00:43 +00:00
Nicholas Nethercote
ac7027c441 Updated copyright notices for 2003. Only 4 months late.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1526
2003-04-15 14:58:06 +00:00
Nicholas Nethercote
982fa6481a -----------------------------------------------------------------------------
overview
-----------------------------------------------------------------------------
Previously Valgrind had its own versions of malloc() et al that replaced
glibc's.  This is necessary for various reasons for Memcheck, but isn't needed,
and was actually detrimental, to some other skins.  I never managed to treat
this satisfactorily w.r.t the core/skin split.

Now I have.  If a skin needs to know about malloc() et al, it must provide its
own replacements.  But because this is not uncommon, the core provides a module
vg_replace_malloc.c which a skin can link with, which provides skeleton
definitions, to reduce the amount of work a skin must do.  The skeletons handle
the transfer of control from the simd CPU to the real CPU, and also the
--alignment, --sloppy-malloc and --trace-malloc options.  These skeleton
definitions subsequently call functions SK_(malloc), SK_(free), etc, which the
skin must define;  in these functions the skin can do the things it needs to do
about tracking heap blocks.

For skins that track extra info about malloc'd blocks -- previously done with
ShadowChunks -- there is a new file vg_hashtable.c that implements a
generic-ish hash table (using dodgy C-style inheritance using struct overlays)
which allows skins to continue doing this fairly easily.

Skins can also replace other functions too, eg. Memcheck has its own versions
of strcpy(), memcpy(), etc.

Overall, it's slightly more work now for skins that need to replace malloc(),
but other skins don't have to use Valgrind's malloc(), so they're getting a
"purer" program run, which is good, and most of the remaining rough edges from
the core/skin split have been removed.

-----------------------------------------------------------------------------
details
-----------------------------------------------------------------------------
Moved malloc() et al intercepts from vg_clientfuncs.c into vg_replace_malloc.c.
Skins can link to it if they want to replace malloc() and friends;  it does
some stuff then passes control to SK_(malloc)() et al which the skin must
define.  They can call VG_(cli_malloc)() and VG_(cli_free)() to do the actual
allocation/deallocation.  Redzone size for the client (the CLIENT arena) is
specified by the static variable VG_(vg_malloc_redzone_szB).
vg_replace_malloc.c thus represents a kind of "mantle" level service.

To get automake to build vg_replace_malloc.o, had to resort to a similar trick
as used for the demangler -- ask for a "no install" library (which is never
used) to be built from it.

Note that all malloc, calloc, realloc, builtin_new, builtin_vec_new, memalign
are now aware of --alignment, when running on simd CPU or real CPU.

This means the new_mem_heap, die_mem_heap, copy_mem_heap and ban_mem_heap
events no longer exist, since the core doesn't control malloc() any more, and
skins can watch for these events themselves.

This required moving all the ShadowChunk stuff out of the core, which meant
the sizeof_shadow_block ``need'' could be removed, yay -- it was a horrible
hack.  Now ShadowChunks are done with a generic HashTable type, in
vg_hashtable.c, which skins can "inherit from" (in a dodgy C-only fashion by
using structs with similar layouts).  Also, the free_list stuff was all moved
as a part of this.  Also, VgAllocKind was moved out of core into
Memcheck/Addrcheck and renamed MAC_AllocKind.

Moved these options out of core into vg_replace_malloc.c:
    --trace-malloc
    --sloppy-malloc
    --alignment

The alternative_free ``need'' could go, too, since Memcheck is now in complete
control of free(), yay -- another horribility.

The bad_free and free_mismatch events could go too, since they're now not
detected by core, yay -- yet another horribility.

Moved malloc() et al wrappers for Memcheck out of vg_clientmalloc.c into
mac_malloc_wrappers.c.  Helgrind has its own wrappers now too.

Introduced VG_USERREQ__CLIENT_CALL[123] client requests.  When a skin function
is operating on the simd CPU, this will call a given function and run it on the
real CPU.  The macros VG_NON_SIMD_CALL[123] in valgrind.h present a cleaner
interface to actually use.  Also introduce analogues of these that pass 'tst'
from the scheduler as the first arg to the called function -- needed for
MC_(client_malloc)() et al.

Fiddled with USERREQ_{MALLOC,FREE} etc. in vg_scheduler.c; they call
SK_({malloc,free})() which by default call VG_(cli_malloc)() -- can't call
glibc's malloc() here.  All the other default SK_(calloc)() etc. instantly
panic; there's a lock variable to ensure that the default SK_({malloc,free})()
are only called from the scheduler, which prevents a skin from forgetting to
override SK_({malloc,free})().  Got rid of the unused USERREQ_CALLOC,
USERREQ_BUILTIN_NEW, etc.

Moved special versions of strcpy/strlen, etc, memcpy() and memchr() into
mac_replace_strmem.c -- they are only necessary for memcheck, because the
hyper-optimised normal glibc versions confuse it, and for memcpy() etc. overlap
checking.

Also added dst/src overlap checks to strcpy(), memcpy(), strcat().  They are
reported not as proper errors, but just with single line warnings, as for silly
args to malloc() et al;  this is mainly because they're on the simulated CPU
and proper error handling would be a pain;  hopefully they're rare enough to
not be a problem.  The strcpy check is done after the copy, because it would
require counting the length of the string beforehand.  Also added strncpy() and
strncat(), which have overlap checks too.  Note that addrcheck doesn't do
overlap checking.

Put USERREQ__LOGMESSAGE in vg_skin.h to do the overlap check error messages.

After removing malloc() et al and strcpy() et al out of vg_clientfuncs.c, moved
the remaining three things (sigsuspend, VG_(__libc_freeres_wrapper),
__errno_location) into vg_intercept.c, since it contains things that run on the
simulated CPU too.  Removed vg_clientfuncs.c altogether.

Moved regression test "malloc3" out of corecheck into memcheck, since corecheck
no longer looks for silly (eg. negative) args to malloc().

Removed the m_eip, m_esp, m_ebp fields from the `Error' type.  They were being
set up, and then read immediately only once, only if GDB attachment was done.
So now they're just being held in local variables.  This saves 12 bytes per
Error.

Made replacement calloc() check for --sloppy-malloc;  previously it didn't.

Added "silly" negative size arg check to realloc(), it didn't have one.

Changed VG_(read_selfprocmaps)() so it can parse the file directly, or from a
previously read buffer.  Buffer can be filled with the new
VG_(read_selfprocmaps_contents)().  Using this at start-up to snapshot
/proc/self/maps before the skins do anything, and then parsing it once they
have done their setup stuff.  Skins can now safely call VG_(malloc)() in
SK_({pre,post}_clo_init)() without the mmap'd superblock erroneously being
identified as client memory.

Changed the --help usage message slightly, now divided into four sections: core
normal, skin normal, core debugging, skin debugging.  Changed the interface for
the command_line_options need slightly -- now two functions, VG_(print_usage)()
and VG_(print_debug_usage)(), and they do the printing themselves, instead of
just returning a string -- that's more flexible.

Removed DEBUG_CLIENTMALLOC code, it wasn't being used and was a pain.

Added a regression test testing leak suppressions (nanoleak_supp), and another
testing strcpy/memcpy/etc overlap warnings (overlap).

Also changed Addrcheck to link with the files shared with Memcheck, rather than
#including the .c files directly.

Commoned up a little more shared Addrcheck/Memcheck code, for the usage
message, and initialisation/finalisation.

Added a Bool param to VG_(unique_error)() dictating whether it should allow
GDB to be attached; for leak checks, because we don't want to attach GDB on
leak errors (causes seg faults).  A bit hacky, but it will do.

Had to change lots of the expected outputs from regression files now that
malloc() et al are in vg_replace_malloc.c rather than vg_clientfuncs.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1524
2003-04-15 13:03:23 +00:00
Nicholas Nethercote
0756a50bc3 Removed support for the 1.0.X series from the regression test suite -- this
was present from before the core/skin split, which is now dead.  Means the
script is slightly simpler, and we can dispense with lots of expected
foo.stderr.hd files.

Also undid accidental change to required Automake version in main Makefile.am
from my last commit, whoops.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1518
2003-04-08 00:47:05 +00:00
Julian Seward
2d2a15abbf 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
2003-02-28 23:22:44 +00:00
Dirk Mueller
8f9785b1eb fix make distcheck with newer automake
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1443
2003-02-25 01:48:15 +00:00
Julian Seward
802a40daea Don't assume Perl lives in /usr/bin; do a proper test for it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1389
2002-12-22 19:32:23 +00:00
Nicholas Nethercote
fc717e001c Fixed minor problem in regtest script.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1271
2002-10-30 15:23:05 +00:00
Julian Seward
e464620bad Unbreak make dist / make distcheck.
Not sure if this is correct; Nick, can you verify?  Thx.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1199
2002-10-05 16:19:56 +00:00
Nicholas Nethercote
24e24c44aa wibbles
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1184
2002-10-04 15:30:48 +00:00
Nicholas Nethercote
db419f2bdc Moved discard, clientperm and clientstackperm from tests/ into the test
suite-proper, giving them .vgtest files and all that.  They don't make sense
for 1.0.X because the client request constants are different in HEAD, indeed
one of them (clientperm) fails with --stable.

Also moved blocked_syscall.c from tests/ to tests/unused/.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1181
2002-10-04 14:16:38 +00:00
Nicholas Nethercote
21a55aa6c6 *** empty log message ***
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1180
2002-10-04 11:43:11 +00:00
Nicholas Nethercote
d386c3db8e Added one regression test for each of addrcheck, lackey, and helgrind, each of
which had none previously.  They all run tests/true (added as well), just to
automatically catch any total b0rkage errors.

Also fixed up filter_stderr_basic to account for changes to startup message;
my changes from yesterday broke all the --stable tests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1179
2002-10-04 11:35:47 +00:00
Nicholas Nethercote
64fcc7f813 Prettified output somewhat, so that full directory names (relative to .) are
printed, and so that directories containing no test files get a different, more
concise, message.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1176
2002-10-04 10:03:34 +00:00
Nicholas Nethercote
3c7b9b2e03 Changed startup message to give information about skin and core separately.
Added "version" and "copyright_author" fields for skins to supply.

Now startup message looks something like this:

==12698== cachegrind, an I1/D1/L2 cache profiler for x86-linux.
==12698== Copyright (C) 2002, and GNU GPL'd, by Nicholas Nethercote.
==12698== Built with valgrind-HEAD, a program execution monitor.
==12698== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward.
==12698== Estimated CPU clock rate is 1422 MHz
==12698== For more details, rerun with: -v

The skin can specify a version number, but the skins that will be distributed
with Valgrind don't.

Also changed "x86 GNU/Linux" to the wicked "x86-linux" at Julian's request.

Updated default regression test filter to handle this new startup message.

----

Also moved the skin's name, description, etc., fields out of VG_(needs) into a
new struct VG_(details), since they are logically quite different to the needs.
Did a little code formatting, etc., for this.  Updated skin docs
correspondingly, too.

Also renamed the need `run_libc_freeres' --> `libc_freeres' so it's a noun
phrase rather than a verb phrase.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1172
2002-10-03 14:05:52 +00:00
Nicholas Nethercote
2ad7c51c41 Added (brief!) docs for Nulgrind.
Also fixed minor wibble tests/Makefile.am that was breaking 'make distcheck'.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1167
2002-10-02 13:49:13 +00:00
Nicholas Nethercote
089e7e3bcb Updated file descriptions in the copyright notices to reflect the core/skin
split.  Each skin now has its own two-line description.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1166
2002-10-02 13:26:35 +00:00
Nicholas Nethercote
86f876238e Update and add .cvsignore files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1156
2002-10-01 11:50:39 +00:00
Nicholas Nethercote
124f1cd350 Moved `resolv' into the test-suite-proper.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1155
2002-10-01 11:45:34 +00:00
Nicholas Nethercote
4cd67f62e6 Converted all functions visible from vg_skin.h with names in CamelCaps to
use_under_scores instead, to be consistent.

Also added some missing 'extern's on function declarations in vg_skin.h.

Also added a quick note in vg_regtest.in on the simplest way to run regression
tests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1135
2002-09-30 10:23:54 +00:00
Nicholas Nethercote
8af201d0ca Moved vg_regtest to vg_regtest.in, using autoconf so vg_regtest now knows where
the `valgrind' script is kept, so people who install valgrind in a directory
other than the one I do don't need to use the --valgrind option all the time.

As a consequence, vg_regtests is now installed in and run out of bin/, rather
than tests/.

Also added a GPL copyright notice to vg_regtests.in.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1118
2002-09-27 08:44:17 +00:00
Nicholas Nethercote
95ee50f064 Changed the regression testing options --head and --eraser to --stable and
--dev, because the old ones were now totally confusing (since --head no longer
applies to HEAD).  Had to change a couple of .vgtest "vgopt:" lines for this.
Unfortunately the --stable result files are still *.stderr.exp.hd" because
changing them via CVS is a pain.

Also improved documentation in script slightly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1117
2002-09-27 08:26:27 +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
dfed07b587 Wibble.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1101
2002-09-23 16:27:35 +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
78a3a1ff43 Removed defunct .cvsignore files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1091
2002-09-23 11:33:13 +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
53c2b601cd Removed, not needed any more.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1089
2002-09-23 10:14:50 +00:00
Nicholas Nethercote
c13b50c6b7 Removing files for total repo restructuring; these files were moved elsewhere by *hacking the repository directly*
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1088
2002-09-23 10:01:42 +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
Julian Seward
c2818e1b69 Test case for resolver bug fixed by vg_libpthread.c rev 1.91. Thanks to
Waldo Bastian for chasing this one into a corner.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@553
2002-08-06 09:09:53 +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