]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
23 years agowibble
Nicholas Nethercote [Mon, 19 May 2003 08:38:23 +0000 (08:38 +0000)] 
wibble

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

23 years agoAdd UCode opcodes for SSE/SSE2.
Julian Seward [Sun, 18 May 2003 11:56:39 +0000 (11:56 +0000)] 
Add UCode opcodes for SSE/SSE2.

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

23 years agogcc-3.3 as supplied with SuSE 8.2 ("gcc version 3.3 20030226
Julian Seward [Sun, 18 May 2003 10:05:38 +0000 (10:05 +0000)] 
gcc-3.3 as supplied with SuSE 8.2 ("gcc version 3.3 20030226
(prerelease) (SuSE Linux)") seems to complain about signed-vs-unsigned
comparisons, when -Wall is on.  This commit fixes (most of) those
complaints.

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

23 years agoBack out symlinking of libpthread.so in coregrind; it causes build
Julian Seward [Sat, 17 May 2003 11:53:46 +0000 (11:53 +0000)] 
Back out symlinking of libpthread.so in coregrind; it causes build
problems on many modern distros.  Not sure how to resolve this properly.

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

23 years agoMinor type fixups.
Nicholas Nethercote [Wed, 14 May 2003 14:04:39 +0000 (14:04 +0000)] 
Minor type fixups.

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

23 years agoundo last change (stupid)
Nicholas Nethercote [Wed, 14 May 2003 12:56:36 +0000 (12:56 +0000)] 
undo last change (stupid)

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

23 years agowibble
Nicholas Nethercote [Wed, 14 May 2003 12:54:47 +0000 (12:54 +0000)] 
wibble

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

23 years agoRemoved statement with no effect.
Nicholas Nethercote [Wed, 14 May 2003 12:52:21 +0000 (12:52 +0000)] 
Removed statement with no effect.

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

23 years agowibble
Nicholas Nethercote [Wed, 14 May 2003 12:42:14 +0000 (12:42 +0000)] 
wibble

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

23 years agowibble
Nicholas Nethercote [Wed, 14 May 2003 09:11:53 +0000 (09:11 +0000)] 
wibble

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

23 years agowibble
Nicholas Nethercote [Wed, 14 May 2003 09:08:49 +0000 (09:08 +0000)] 
wibble

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

23 years agowibble
Nicholas Nethercote [Mon, 12 May 2003 21:41:30 +0000 (21:41 +0000)] 
wibble

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

23 years agoFixed suppression reading so that you can specify up to four "fun:" or "obj:"
Nicholas Nethercote [Mon, 12 May 2003 20:40:13 +0000 (20:40 +0000)] 
Fixed suppression reading so that you can specify up to four "fun:" or "obj:"
lines (it was 3 due to a bug).

Also removed VG_(get_suppressions)() which wasn't being used, and changed
VG_(exitcode) to an Int, as it should be.

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

23 years agowhoops
Nicholas Nethercote [Mon, 12 May 2003 08:48:49 +0000 (08:48 +0000)] 
whoops

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

23 years agoThese client requests were moved to include/vg_skin.h a while ago, but I forgot
Nicholas Nethercote [Mon, 12 May 2003 08:47:57 +0000 (08:47 +0000)] 
These client requests were moved to include/vg_skin.h a while ago, but I forgot
to delete them from here.

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

23 years agoImprove threaded handling of errno:
Julian Seward [Fri, 9 May 2003 23:40:34 +0000 (23:40 +0000)] 
Improve threaded handling of errno:

- Change various incorrect direct references to errno into
  *(__errno_location()).

- In __errno_location and __h_errno_location, treat the tid==1 case
  (root thread) specially, as with __res_state().

This seems to fix a bug in threaded handling of errno on R H 9 and SuSE8.2,
and almost makes OpenOffice work again on R H 9.

MERGE TO STABLE, if it doesn't break anything.

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

23 years agoAdded a suppression for a leak in Valgrind's own libpthread.so :(
Nicholas Nethercote [Thu, 8 May 2003 07:53:52 +0000 (07:53 +0000)] 
Added a suppression for a leak in Valgrind's own libpthread.so :(

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

23 years agoMerge patch from JosefW:
Julian Seward [Mon, 5 May 2003 22:18:17 +0000 (22:18 +0000)] 
Merge patch from JosefW:

Hi,

recently I found that there is sometimes cost attributed to some
strange lines (with cachegrind/calltree) with GCC 3.x (using the
DWARF2 debug info format).

I had time to look at this. There is a bug in the DWARF2 debug line
info loader when instructions following each other have source lines
far from each other (e.g. with inlined functions).

MERGE TO STABLE

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

23 years agoFinalise for 1.9.6.
Julian Seward [Mon, 5 May 2003 22:15:35 +0000 (22:15 +0000)] 
Finalise for 1.9.6.

MERGE TO STABLE

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

23 years agoWhoops, forgot this on last commit.
Julian Seward [Mon, 5 May 2003 16:33:53 +0000 (16:33 +0000)] 
Whoops, forgot this on last commit.

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

23 years agoFixed problems with reg tests for frames below main(), which were different
Julian Seward [Mon, 5 May 2003 16:18:51 +0000 (16:18 +0000)] 
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

23 years agoAdded README_DEVELOPERS file.
Nicholas Nethercote [Mon, 5 May 2003 13:04:49 +0000 (13:04 +0000)] 
Added README_DEVELOPERS file.

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

23 years agoThis commit allows Valgrind to be run in-place from the source tree, without
Nicholas Nethercote [Mon, 5 May 2003 12:47:25 +0000 (12:47 +0000)] 
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

23 years agofix regression test run failure. appears to be a glibc bug
Dirk Mueller [Mon, 5 May 2003 11:04:37 +0000 (11:04 +0000)] 
fix regression test run failure. appears to be a glibc bug

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

23 years agoMade 'tronical' and 'pushfpopf' less likely to fail by filtering their stderr
Nicholas Nethercote [Mon, 5 May 2003 09:23:12 +0000 (09:23 +0000)] 
Made 'tronical' and 'pushfpopf' less likely to fail by filtering their stderr
output more vigorously.

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

23 years agoImproved filtering so that 'overlap' test less likely to fail.
Nicholas Nethercote [Mon, 5 May 2003 09:09:08 +0000 (09:09 +0000)] 
Improved filtering so that 'overlap' test less likely to fail.

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

23 years agoDocument 1.9.6 fixes.
Julian Seward [Mon, 5 May 2003 01:05:09 +0000 (01:05 +0000)] 
Document 1.9.6 fixes.

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

23 years agoGrrr, I made new changes to this on 2_0_BRANCH. Pull them into head
Julian Seward [Mon, 5 May 2003 00:23:42 +0000 (00:23 +0000)] 
Grrr, I made new changes to this on 2_0_BRANCH.  Pull them into head
(details of what changed in 1.9.5).

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

23 years agoIncrease VG_N_CLEANUPSTACK to 16.
Julian Seward [Sun, 4 May 2003 13:02:10 +0000 (13:02 +0000)] 
Increase  VG_N_CLEANUPSTACK  to 16.

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

23 years agoFix interception of pthread_atfork with glibc-2.3.2.
Julian Seward [Sun, 4 May 2003 12:35:54 +0000 (12:35 +0000)] 
Fix interception of pthread_atfork with glibc-2.3.2.

MERGE TO STABLE

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

23 years agoUnchain translations when doing VALGRIND_DISCARD_TRANSLATIONS. Otherwise
Julian Seward [Sun, 4 May 2003 12:32:56 +0000 (12:32 +0000)] 
Unchain translations when doing VALGRIND_DISCARD_TRANSLATIONS.  Otherwise
the tt/tc are left in an inconsistent state afterwards.  (Adam Gundy
<arg@cyberscience.com>)

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

23 years agowibble
Nicholas Nethercote [Fri, 2 May 2003 17:54:33 +0000 (17:54 +0000)] 
wibble

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

23 years agoMoved the CLIENT_tstCALL[0123] requests out of valgrind.h into vg_skin.h,
Nicholas Nethercote [Fri, 2 May 2003 17:53:54 +0000 (17:53 +0000)] 
Moved the CLIENT_tstCALL[0123] requests out of valgrind.h into vg_skin.h,
because there was no point exposing them to clients, as they don't know the
ThreadState type.

Also, removed the LOGMESSAGE request type, replaced it with calls to
VG_(message) via the generic VALGRIND_NON_SIMD_CALL2.

In fact, almost every single pthread client request could be removed in this
same way.  That would result in less code, which would be nice... yeah, real
nice.

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

23 years agowibble
Nicholas Nethercote [Fri, 2 May 2003 17:40:43 +0000 (17:40 +0000)] 
wibble

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

23 years agoMade memcpy()-et-al-overlap errors fully fledged errors, suppressible,
Nicholas Nethercote [Fri, 2 May 2003 17:24:29 +0000 (17:24 +0000)] 
Made memcpy()-et-al-overlap errors fully fledged errors, suppressible,
recordable, etc.  Thanks to Tom Hughes <thh@cyberscience.com> for the patch.

Also fixed a minor bug in the reporting -- the src/dst pointers given for
strncat(), strcpy(), strcat().

And I updated the relevent regression test.

And I even added relevant documentation.

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

23 years agoAdded regression tests for recent bug fix involving accept(), recvfrom() and
Nicholas Nethercote [Fri, 2 May 2003 16:19:10 +0000 (16:19 +0000)] 
Added regression tests for recent bug fix involving accept(), recvfrom() and
getsockopt() being allowed to received a NULL buffer.

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

23 years agoMinor fix for lookup_dcookie
Nicholas Nethercote [Fri, 2 May 2003 16:18:06 +0000 (16:18 +0000)] 
Minor fix for lookup_dcookie

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

23 years agoFixed some syscalls a little bit:
Nicholas Nethercote [Fri, 2 May 2003 16:00:34 +0000 (16:00 +0000)] 
Fixed some syscalls a little bit:

 - getcwd() now uses the result for the post_mem_write length rather than
   the argument, which would have over-estimated

 - accept(), recvfrom() and getsockopt() can now all take NULL buffers (which
   are quite legitimate) without Memcheck giving spurious errors

MERGE TO STABLE

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

23 years agoAdded "_W" suffix to stack sizes to indicate they are in words.
Nicholas Nethercote [Thu, 1 May 2003 08:06:41 +0000 (08:06 +0000)] 
Added "_W" suffix to stack sizes to indicate they are in words.

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

23 years agoRemoved magic numbers for VG_(stack) size and VG_(sigstack) size, made into
Nicholas Nethercote [Wed, 30 Apr 2003 20:49:10 +0000 (20:49 +0000)] 
Removed magic numbers for VG_(stack) size and VG_(sigstack) size, made into
#defined constants.  I hope I got all the right places.  I also hope that they
can be different sizes;  experiments seem to indicate so.  Also if I reduce the
size of the main stack at all below its current 10000 I get problems, but that
was happening before anyway, I think.

Julian, you may want to sanity check this.

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

23 years agoFixed a bug in Cachegrind -- if the profiled program changes working directory,
Nicholas Nethercote [Wed, 30 Apr 2003 20:23:58 +0000 (20:23 +0000)] 
Fixed a bug in Cachegrind -- if the profiled program changes working directory,
the output file wouldn't get written.  No longer creating the file at startup
and then writing it at the end;  just writing it at the end.  Also recording
the start directory at the start so that the output ends up in it even if the
program does change directory.

Had to add VG_(getcwd)() to vg_mylibc.c for this.

Added a regression test for it too.

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

23 years ago1. No longer printing the "MMX-only" or "SSE-capable" string at startup
Nicholas Nethercote [Wed, 30 Apr 2003 09:00:33 +0000 (09:00 +0000)] 
1. No longer printing the "MMX-only" or "SSE-capable" string at startup
   ("if (0)"'d it out).

2. Fixed the SSE state alignment in the baseBlock -- it worked for Memcheck,
   Nulgrind and Corecheck, but not for Addrcheck, Cachegrind, Lackey, Helgrind,
   due to variable numbers of shadow registers and registered compact helpers
   coming before the SSE/FPU state.

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

23 years agoExtend the state components in VG_(m_state_static) and VG_(baseBlock)
Julian Seward [Tue, 29 Apr 2003 23:50:00 +0000 (23:50 +0000)] 
Extend the state components in VG_(m_state_static) and VG_(baseBlock)
to include the SSE/SSE2 architectural state.  Automagically detect
at startup, in vg_startup.S, whether or not this is a SSE-enabled
CPU and act accordingly.  All subsequent FPU/SSE state transfers
between the simulated and real machine are then done either with
fsave/frstor (as before) or fxsave/fxrstor (the SSE equivalents).

Fragile and fiddly; (1) the SSE state needs to be stored on a 16-byte
boundary, and (2) certain bits in the saved MXCSR reg in a state
written by fxsave need to be anded out before we can safely restore
using fxrstor.

It does appear to work.  I'd appreciate people trying it out on
various CPUs to establish whether the SSE / not-SSE check works
right, and/or anything else is broken.

Unfortunately makes some programs run significantly slower.
I don't know why.  Perhaps due to copying around more processor
state than there was before (SSE state is 512 bytes, FPU state
was only 108).  I will look into this.

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

23 years agoSend bug reports to Jeremy F, not me (njn).
Nicholas Nethercote [Tue, 29 Apr 2003 15:52:33 +0000 (15:52 +0000)] 
Send bug reports to Jeremy F, not me (njn).

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

23 years agoCouple of minor fixes:
Nicholas Nethercote [Tue, 29 Apr 2003 11:16:46 +0000 (11:16 +0000)] 
Couple of minor fixes:
  - don't keel over if run on an empty file
  - abort if the "summary:" line is missing;  previously it gave a warning
    and tried to keep going but then other things broke.

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

23 years agoAdd \n in failure message.
Julian Seward [Sun, 27 Apr 2003 23:46:21 +0000 (23:46 +0000)] 
Add \n in failure message.

MERGE TO STABLE

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

23 years agoDon't trash %eflags before snapshotting the state of the machine at
Julian Seward [Sun, 27 Apr 2003 22:23:23 +0000 (22:23 +0000)] 
Don't trash %eflags before snapshotting the state of the machine at
startup.  I don't know if this is actually of interest, since surely
the flags are not live at the point where the section's .init function
is called, but still, it's a form of state pollution.

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

23 years agoAdd __NR_prctl.
Julian Seward [Sat, 26 Apr 2003 22:55:12 +0000 (22:55 +0000)] 
Add __NR_prctl.

MERGE TO STABLE

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

23 years agoreport_and_quit: Tell people to look at the FAQ.txt for advice.
Julian Seward [Sat, 26 Apr 2003 22:36:42 +0000 (22:36 +0000)] 
report_and_quit: Tell people to look at the FAQ.txt for advice.

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

23 years agoDon't call VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) if all we're doing
Julian Seward [Sat, 26 Apr 2003 22:29:25 +0000 (22:29 +0000)] 
Don't call VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) if all we're doing
is exiting normally.  There's no point, and it causes breakage when
programs which write their environment variables, finish normally.

MERGE TO STABLE

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

23 years agoAdd FAQ entry re apparent space leaks in the STL.
Julian Seward [Sat, 26 Apr 2003 22:23:35 +0000 (22:23 +0000)] 
Add FAQ entry re apparent space leaks in the STL.

MERGE TO STABLE

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

23 years agoSupport kernels >= 2.5.68 (Anders Gustafsson <andersg@0x63.nu>)
Julian Seward [Sat, 26 Apr 2003 21:49:40 +0000 (21:49 +0000)] 
Support kernels >= 2.5.68 (Anders Gustafsson <andersg@0x63.nu>)

MERGE TO STABLE

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

23 years agoAdd __NR_lookup_dcookie, whatever that might be.
Julian Seward [Sat, 26 Apr 2003 21:46:16 +0000 (21:46 +0000)] 
Add __NR_lookup_dcookie, whatever that might be.

MERGE TO STABLE

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

23 years agoMerge patch from Josef Weidendorfer <Josef.Weidendorfer@gmx.de>:
Julian Seward [Sat, 26 Apr 2003 21:42:09 +0000 (21:42 +0000)] 
Merge patch from Josef Weidendorfer <Josef.Weidendorfer@gmx.de>:

Read symbols from both "symtab" and "dynsym" sections, rather than
merely from the one that comes last in the file.

MERGE TO STABLE

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

23 years agoAdd possibly-bogus implementations for __libc_current_sigrtmin,
Julian Seward [Sat, 26 Apr 2003 21:19:53 +0000 (21:19 +0000)] 
Add possibly-bogus implementations for __libc_current_sigrtmin,
__libc_current_sigrtmax and __libc_allocate_rtsig.

MERGE TO STABLE

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

23 years agoFix compilation on glibc-2.1.X.
Julian Seward [Sat, 26 Apr 2003 21:04:42 +0000 (21:04 +0000)] 
Fix compilation on glibc-2.1.X.

MERGE TO STABLE

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

23 years agoFix threading problems on glibc-2.3.2 or later. Note this is *not*
Julian Seward [Sat, 26 Apr 2003 20:11:15 +0000 (20:11 +0000)] 
Fix threading problems on glibc-2.3.2 or later.  Note this is *not*
NPTL support.

The behaviour of weak vs strong symbols seems to have changed in
glibc-2.3.2.  This caused problems in coregrind/vg_intercept.c,
wherein strong symbols in vg_libpthread.c were intended to
override weak symbols in vg_intercept.c, in order to give alternative
thread-safe implementations of some functions, poll(), select(), etc.

The change involves moving the nonblocking implementations of poll, etc
into vg_intercept.c, renaming them to (eg)  VGR_(poll), and routing
all calls to poll to VGR_(poll) [dually for other such fns].  This
means even single-threaded programs now use these functions, but
that doesn't strike me as harmful.

MERGE TO STABLE, if it doesn't break anything

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

23 years agowibble
Nicholas Nethercote [Fri, 25 Apr 2003 21:38:23 +0000 (21:38 +0000)] 
wibble

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

23 years agoFixed
Nicholas Nethercote [Fri, 25 Apr 2003 21:37:20 +0000 (21:37 +0000)] 
Fixed
Fixed bug in strncpy() and strncat() -- they were giving the right answers, but
could read the (n+1)th char, which could possibly be inaccessible.  Thanks to
Adam Gundy <arg@cyberscience.com> for spotting it.

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

23 years agoAdded a return value (0) for the LOGMESSAGE request, since it's now visible to
Nicholas Nethercote [Fri, 25 Apr 2003 16:07:11 +0000 (16:07 +0000)] 
Added a return value (0) for the LOGMESSAGE request, since it's now visible to
skins.

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

23 years agoAdded syscall creat(), courtesy of Tom Hughes <thh@cyberscience.com>.
Nicholas Nethercote [Thu, 24 Apr 2003 18:14:11 +0000 (18:14 +0000)] 
Added syscall creat(), courtesy of Tom Hughes <thh@cyberscience.com>.

Weird that it's never come up before, everyone must use open() in preference.

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

23 years agocorrect expected stdout. prepare must NOT run twice!
Dirk Mueller [Thu, 24 Apr 2003 01:02:35 +0000 (01:02 +0000)] 
correct expected stdout. prepare must NOT run twice!

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

23 years agobe a bit more libc tolerant
Dirk Mueller [Thu, 24 Apr 2003 01:01:01 +0000 (01:01 +0000)] 
be a bit more libc tolerant

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

23 years agofix sigaltstack regression test to be more glibc-version tolerant
Dirk Mueller [Thu, 24 Apr 2003 00:40:38 +0000 (00:40 +0000)] 
fix sigaltstack regression test to be more glibc-version tolerant

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

23 years agoChanged things so that the regression test script (vg_regtest) is no longer
Nicholas Nethercote [Wed, 23 Apr 2003 21:48:20 +0000 (21:48 +0000)] 
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

23 years agoRecord the correct address of the initial thread's stack, as determined
Julian Seward [Wed, 23 Apr 2003 21:18:52 +0000 (21:18 +0000)] 
Record the correct address of the initial thread's stack, as determined
by the initial scan of /proc/self/maps, so that we correctly identify
addresses in it.  This fix is thanks to Dirk Mueller.

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

23 years agoChange the version "number" to something less confusing, since we are
Julian Seward [Wed, 23 Apr 2003 21:17:24 +0000 (21:17 +0000)] 
Change the version "number" to something less confusing, since we are
not (yet) making releases from this branch.

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

23 years agowibbles
Nicholas Nethercote [Wed, 23 Apr 2003 17:49:09 +0000 (17:49 +0000)] 
wibbles

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

23 years agoNow counting tests and stdout failures and stderr failures separately and
Nicholas Nethercote [Wed, 23 Apr 2003 17:47:13 +0000 (17:47 +0000)] 
Now counting tests and stdout failures and stderr failures separately and
correctly.

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

23 years agothe error is in line 13, not in line 15
Dirk Mueller [Wed, 23 Apr 2003 17:03:34 +0000 (17:03 +0000)] 
the error is in line 13, not in line 15

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

23 years ago- fix regression tests counting
Dirk Mueller [Wed, 23 Apr 2003 16:52:06 +0000 (16:52 +0000)] 
- fix regression tests counting
- unset $VALGRIND_OPTS (fixes 6 testsuite failures)

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

23 years agoalways run check before regtest
Dirk Mueller [Wed, 23 Apr 2003 16:39:31 +0000 (16:39 +0000)] 
always run check before regtest

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

23 years agowibble 2
Nicholas Nethercote [Wed, 23 Apr 2003 07:35:56 +0000 (07:35 +0000)] 
wibble 2

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

23 years agowibble
Nicholas Nethercote [Wed, 23 Apr 2003 07:33:05 +0000 (07:33 +0000)] 
wibble

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

23 years agoMajorly update and expand, adding workarounds for more or less all
Julian Seward [Tue, 22 Apr 2003 23:26:24 +0000 (23:26 +0000)] 
Majorly update and expand, adding workarounds for more or less all
failures with known workarounds.

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

23 years agoImplemented malloc_usable_size(), which was used in a program written by
Nicholas Nethercote [Tue, 22 Apr 2003 22:45:55 +0000 (22:45 +0000)] 
Implemented malloc_usable_size(), which was used in a program written by
Frederic Delley <fdelley@cisco.com>.

This required also adding VG_(arena_payload_szB)().

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

23 years agoAccording to Greg Hosler <hosler@lugs.org.sg>, these entries need to be added,
Nicholas Nethercote [Tue, 22 Apr 2003 21:47:56 +0000 (21:47 +0000)] 
According to Greg Hosler <hosler@lugs.org.sg>, these entries need to be added,
otherwise rpm on RH9 will complain that these files are in the payload area,
but not saved to the rpm.

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

23 years agoAdded "Int exitcode" argument to SK_(fini)(), because it could be useful
Nicholas Nethercote [Tue, 22 Apr 2003 21:41:40 +0000 (21:41 +0000)] 
Added "Int exitcode" argument to SK_(fini)(), because it could be useful
for skins.

Changed lackey to print out the exit code.

Changed AUTOMAKE_OPTIONS back to 1.5 (whoops)

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

23 years agoRe-added the FAQ that was lost a while back, possibly when I did the original
Nicholas Nethercote [Tue, 22 Apr 2003 20:58:47 +0000 (20:58 +0000)] 
Re-added the FAQ that was lost a while back, possibly when I did the original
core/skin split.  Added a couple more questions+answers.

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

23 years agoFixed minor boo-boo
Nicholas Nethercote [Tue, 22 Apr 2003 20:58:02 +0000 (20:58 +0000)] 
Fixed minor boo-boo

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

23 years agoIn my big malloc-out-of-core changes of last week, I broke Helgrind by
Nicholas Nethercote [Mon, 21 Apr 2003 22:04:03 +0000 (22:04 +0000)] 
In my big malloc-out-of-core changes of last week, I broke Helgrind by
forgetting to change one of the skin functions.  It ran fine until it tried to
generate an error message, whereupon it complained about a missing skin
function.  (We should really have more than one regression test for
Helgrind...)

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

23 years agoRenamed VG_NON_SIMD_CALL1 (and friends) as VALGRIND_NON_SIMD_CALL1 to be
Nicholas Nethercote [Mon, 21 Apr 2003 13:30:55 +0000 (13:30 +0000)] 
Renamed VG_NON_SIMD_CALL1 (and friends) as VALGRIND_NON_SIMD_CALL1 to be
consistent with the names of the other client requests.

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

23 years agoAdded two client requests: VALGRIND_COUNT_ERRORS and VALGRIND_COUNT_LEAKS.
Nicholas Nethercote [Mon, 21 Apr 2003 13:24:40 +0000 (13:24 +0000)] 
Added two client requests: VALGRIND_COUNT_ERRORS and VALGRIND_COUNT_LEAKS.
The first returns the number of errors found so far, and is a core request.
The second returns the number of bytes found
reachable/dubious/leaked/suppressed by all leak checks so far, for Memcheck and
Addrcheck.

Both are useful for using Valgrind in regression test suites where multiple
tests are present in a single file -- one can run Valgrind with no output
(using --logfile-fd=-1) and use the requests after each test to determine if
any errors happened.

Had to rename and make public vg_n_errs_found --> VG_(n_errs_found) to do so.
Nb: leak errors are not counted as errors for the purposes of
VALGRIND_COUNT_ERRORS.  This was decided as the best thing to do after
discussion with Olly Betts, who original suggested these changes.

Pulled out common client request code shared between Memcheck and Addrcheck.

Added a regression test for this.

Added some documentation too.

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

23 years agoBetter way to specify where gdb is -- now GDB_PATH is defined in config.h,
Nicholas Nethercote [Fri, 18 Apr 2003 12:54:24 +0000 (12:54 +0000)] 
Better way to specify where gdb is -- now GDB_PATH is defined in config.h,
which is global, rather than passing it in with -D to the file that needed it.

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

23 years agobe autoconf 2.13 compatible
Dirk Mueller [Thu, 17 Apr 2003 17:38:45 +0000 (17:38 +0000)] 
be autoconf 2.13 compatible

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

23 years agoreapply automake fixes. make check will now generate the binaries which
Dirk Mueller [Thu, 17 Apr 2003 17:00:43 +0000 (17:00 +0000)] 
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

23 years agofix make distcheck by properly implementing the NPTL configure check.
Dirk Mueller [Thu, 17 Apr 2003 16:58:03 +0000 (16:58 +0000)] 
fix make distcheck by properly implementing the NPTL configure check.

Dear users who still use Redhat: please test if this still works.

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

23 years agoThe location of gdb is now determined by the 'configure' script, instead
Nicholas Nethercote [Wed, 16 Apr 2003 20:50:50 +0000 (20:50 +0000)] 
The location of gdb is now determined by the 'configure' script, instead
of being hard-wired at /usr/bin/gdb.

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

23 years agowibble
Nicholas Nethercote [Wed, 16 Apr 2003 20:09:47 +0000 (20:09 +0000)] 
wibble

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

23 years agoUpdated copyright notices for 2003. Only 4 months late.
Nicholas Nethercote [Tue, 15 Apr 2003 14:58:06 +0000 (14:58 +0000)] 
Updated copyright notices for 2003.  Only 4 months late.

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

23 years agoNamespace police
Nicholas Nethercote [Tue, 15 Apr 2003 14:09:58 +0000 (14:09 +0000)] 
Namespace police

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

23 years ago-----------------------------------------------------------------------------
Nicholas Nethercote [Tue, 15 Apr 2003 13:03:23 +0000 (13:03 +0000)] 
-----------------------------------------------------------------------------
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

23 years agowibble
Nicholas Nethercote [Tue, 8 Apr 2003 12:06:51 +0000 (12:06 +0000)] 
wibble

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

23 years agoMinor HTML fixes in docs, thanks to Arnaud Desitter.
Nicholas Nethercote [Tue, 8 Apr 2003 11:08:45 +0000 (11:08 +0000)] 
Minor HTML fixes in docs, thanks to Arnaud Desitter.

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

23 years agoAdded a Makefile target for running the regression tests.
Nicholas Nethercote [Tue, 8 Apr 2003 10:29:13 +0000 (10:29 +0000)] 
Added a Makefile target for running the regression tests.

Use "make regtest" to run them now.  (It just runs
'$PREFIX/bin/vg_regtest --all')

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

23 years agoAdded regression test from Dominic Mazzoni for FPU lazy eflags update bug that
Nicholas Nethercote [Tue, 8 Apr 2003 10:04:32 +0000 (10:04 +0000)] 
Added regression test from Dominic Mazzoni for FPU lazy eflags update bug that
was fixed in coregrind/vg_from_ucode.c v1.42.

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

23 years agoFixed minor printf bogons.
Nicholas Nethercote [Tue, 8 Apr 2003 00:56:14 +0000 (00:56 +0000)] 
Fixed minor printf bogons.

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

23 years agoRemoved support for the 1.0.X series from the regression test suite -- this
Nicholas Nethercote [Tue, 8 Apr 2003 00:47:05 +0000 (00:47 +0000)] 
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

23 years agoThis commit moves some skin-specific stuff out of core, and generally
Nicholas Nethercote [Tue, 8 Apr 2003 00:08:52 +0000 (00:08 +0000)] 
This commit moves some skin-specific stuff out of core, and generally
neatens other things up.

Also, it adds the --gen-suppressions option for automatically generating
suppressions for each error.

Note that it changes the core/skin interface:
SK_(dup_extra_and_update)() is replaced by SK_(update_extra)(), and
SK_(get_error_name)() and SK_(print_extra_suppression_info)() are added.

-----------------------------------------------------------------------------
details
-----------------------------------------------------------------------------
Removed ac_common.c -- it just #included another .c file;  moved the
#include into ac_main.c.

Introduced "mac_" prefixes for files shared between Addrcheck and Memcheck,
to make it clearer which code is shared.  Also using a "MAC_" prefix for
functions and variables and types that are shared.  Addrcheck doesn't see
the "MC_" prefix at all.

Factored out almost-identical mc_describe_addr() and describe_addr()
(AddrCheck's version) into MAC_(describe_addr)().

Got rid of the "pp_ExeContext" closure passed to SK_(pp_SkinError)(), it
wasn't really necessary.

Introduced MAC_(pp_shared_SkinError)() for the error printing code shared by
Addrcheck and Memcheck.  Fixed some bogus stuff in Addrcheck error messages
about "uninitialised bytes" (there because of an imperfect conversion from
Memcheck).

Moved the leak checker out of core (vg_memory.c), into mac_leakcheck.c.
 - This meant the hacky way of recording Leak errors, which was different to
   normal errors, could be changed to something better:  introduced a
   function VG_(unique_error)(), which unlike VG_(maybe_record_error)() just
   prints the error (unless suppressed) but doesn't record it.  Used for
   leaks;  a much better solution all round as it allowed me to remove a lot
   of almost-identical code from leak handling (is_suppressible_leak(),
   leaksupp_matches_callers()).

 - As part of this, changed the horrible SK_(dup_extra_and_update) into the
   slightly less horrible SK_(update_extra), which returns the size of the
   `extra' part for the core to duplicate.

 - Also renamed it from VG_(generic_detect_memory_leaks)() to
   MAC_(do_detect_memory_leaks).  In making the code nicer w.r.t suppressions
   and error reporting, I tied it a bit more closely to Memcheck/Addrcheck,
   and got rid of some of the args.  It's not really "generic" any more, but
   then it never really was.  (This could be undone, but there doesn't seem
   to be much point.)

STREQ and STREQN were #defined in several places, and in two different ways.
Made global macros VG_STREQ, VG_CLO_STREQ and VG_CLO_STREQN in vg_skin.h.

Added the --gen-suppressions code.  This required adding the functions
SK_(get_error_name)() and SK_(print_extra_suppression_info)() for skins that
use the error handling need.

Added documentation for --gen-suppressions, and fixed some other minor document
problems.

Various other minor related changes too.

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

23 years agoAdd and use a configure test to determine if this is an NPTL based
Julian Seward [Mon, 7 Apr 2003 19:36:41 +0000 (19:36 +0000)] 
Add and use a configure test to determine if this is an NPTL based
system.  Hopefully this will allow it to build out of the box and
(sort-of) work on RH9.

MERGE TO STABLE (if it works)

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