Commit Graph

906 Commits

Author SHA1 Message Date
Julian Seward
ecee893b06 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
2003-05-09 23:40:34 +00:00
Nicholas Nethercote
b4894b2b23 Added a suppression for a leak in Valgrind's own libpthread.so :(
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1624
2003-05-08 07:53:52 +00:00
Julian Seward
2cdb93b219 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
2003-05-05 22:18:17 +00:00
Julian Seward
c8997a2ad1 Finalise for 1.9.6.
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1618
2003-05-05 22:15:35 +00:00
Julian Seward
8ab5a6a18f Whoops, forgot this on last commit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1617
2003-05-05 16:33:53 +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
705542afcc Added README_DEVELOPERS file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1615
2003-05-05 13:04:49 +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
Dirk Mueller
77f71065e1 fix regression test run failure. appears to be a glibc bug
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1613
2003-05-05 11:04:37 +00:00
Nicholas Nethercote
d43c0e3942 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
2003-05-05 09:23:12 +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
Julian Seward
7674ae56e4 Document 1.9.6 fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1608
2003-05-05 01:05:09 +00:00
Julian Seward
f30706b105 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
2003-05-05 00:23:42 +00:00
Julian Seward
c82b1c580f Increase VG_N_CLEANUPSTACK to 16.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1588
2003-05-04 13:02:10 +00:00
Julian Seward
e455ba148d Fix interception of pthread_atfork with glibc-2.3.2.
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1587
2003-05-04 12:35:54 +00:00
Julian Seward
c873dac6c4 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
2003-05-04 12:32:56 +00:00
Nicholas Nethercote
91998793ac wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1585
2003-05-02 17:54:33 +00:00
Nicholas Nethercote
90ef0ac1d6 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
2003-05-02 17:53:54 +00:00
Nicholas Nethercote
1810431e9d wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1583
2003-05-02 17:40:43 +00:00
Nicholas Nethercote
8c22ec62d9 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
2003-05-02 17:24:29 +00:00
Nicholas Nethercote
2566d12bc0 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
2003-05-02 16:19:10 +00:00
Nicholas Nethercote
8c12eaeb63 Minor fix for lookup_dcookie
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1580
2003-05-02 16:18:06 +00:00
Nicholas Nethercote
694c3ee614 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
2003-05-02 16:00:34 +00:00
Nicholas Nethercote
4bf271eb18 Added "_W" suffix to stack sizes to indicate they are in words.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1578
2003-05-01 08:06:41 +00:00
Nicholas Nethercote
d2457b59af 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
2003-04-30 20:49:10 +00:00
Nicholas Nethercote
8dd1a0138c 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
2003-04-30 20:23:58 +00:00
Nicholas Nethercote
4f5104dded 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
2003-04-30 09:00:33 +00:00
Julian Seward
23ae8adf30 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
2003-04-29 23:50:00 +00:00
Nicholas Nethercote
2d4e9e253f Send bug reports to Jeremy F, not me (njn).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1573
2003-04-29 15:52:33 +00:00
Nicholas Nethercote
fe1f67595b 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
2003-04-29 11:16:46 +00:00
Julian Seward
72e5cd5ce5 Add \n in failure message.
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1571
2003-04-27 23:46:21 +00:00
Julian Seward
fbf2533776 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
2003-04-27 22:23:23 +00:00
Julian Seward
284654f749 Add __NR_prctl.
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1569
2003-04-26 22:55:12 +00:00
Julian Seward
14a09cb25e report_and_quit: Tell people to look at the FAQ.txt for advice.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1568
2003-04-26 22:36:42 +00:00
Julian Seward
89b48351b8 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
2003-04-26 22:29:25 +00:00
Julian Seward
a01d8e81df Add FAQ entry re apparent space leaks in the STL.
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1565
2003-04-26 22:23:35 +00:00
Julian Seward
85291a44d9 Support kernels >= 2.5.68 (Anders Gustafsson <andersg@0x63.nu>)
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1564
2003-04-26 21:49:40 +00:00
Julian Seward
a6194ccaea Add __NR_lookup_dcookie, whatever that might be.
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1563
2003-04-26 21:46:16 +00:00
Julian Seward
c1be97aff0 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
2003-04-26 21:42:09 +00:00
Julian Seward
76ffe12471 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
2003-04-26 21:19:53 +00:00
Julian Seward
ac403fbc41 Fix compilation on glibc-2.1.X.
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1560
2003-04-26 21:04:42 +00:00
Julian Seward
4efd705c4b 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
2003-04-26 20:11:15 +00:00
Nicholas Nethercote
e40dd39e04 wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1558
2003-04-25 21:38:23 +00:00
Nicholas Nethercote
c9acb6f0d2 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
2003-04-25 21:37:20 +00:00
Nicholas Nethercote
4e3c15f4a6 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
2003-04-25 16:07:11 +00:00
Nicholas Nethercote
4f1b2c3adc 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
2003-04-24 18:14:11 +00:00
Dirk Mueller
e91178ac88 correct expected stdout. prepare must NOT run twice!
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1554
2003-04-24 01:02:35 +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
Dirk Mueller
92ca30fb7f fix sigaltstack regression test to be more glibc-version tolerant
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1552
2003-04-24 00:40:38 +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