Commit Graph

1458 Commits

Author SHA1 Message Date
Jeremy Fitzhardinge
6fd5d698f2 Fix assertion failure when using VG_(system) near program termination.
The problem is that the use of VG_(system) causes a SIGCHLD to be sent
to the process, which ends up being delivered to one of the proxy LWPs
(which is a small problem in itself, but nothing too bad).

The proxy tells the scheduler LWP about this, and the scheduler LWP sends
a sigACK reply.

Then, while the proxy LWP is in the SigACK state, and the SigACK reply
is still queued in the message pipe, the scheduler LWP starts shutting
Valgrind down, and sends a SIGVGKILL to all proxy LWPs.  This causes
the proxy to drop from sigACK state to WaitReq state, and it reads
further commands - one of which is the SigACK message - this causes the
assertion failure.

The fix is to simply make the proxy LWP exit immediately when it gets
a SIGVGKILL, and not process any more requests.

This change also fixes a bug in VG_(system), in which the child process
returns back into Valgrind rather than exiting when exec fails.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2284
2004-03-02 21:38:51 +00:00
Nicholas Nethercote
fd5dafaac2 Make vg_regtest return 1 if any tests fail. Useful for scripts that call it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2283
2004-03-01 08:27:37 +00:00
Dirk Mueller
11fbbb3c91 remove arch subdir for 2.1.1 release
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2282
2004-03-01 03:25:09 +00:00
Nicholas Nethercote
ffa1ae6f30 Patch from Bartosz Taudul: latest GCC requires regparm(n) attributes on both
function declarations and definitions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2280
2004-02-29 15:50:04 +00:00
Tom Hughes
6548f1f733 Added some extra suppressions for glibc 2.2.5 on RedHat 7.3 systems.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2279
2004-02-29 13:00:51 +00:00
Tom Hughes
e60cf234f7 Modified the basic standard error filter to strip out line info out of
order warnings which some systems seem to produce.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2278
2004-02-29 13:00:18 +00:00
Tom Hughes
23a713cfd8 Add an extra suppression for glibc 2.3.2 on RedHat 8.0 systems.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2277
2004-02-29 12:42:12 +00:00
Tom Hughes
8c9a6c3e2d Changed the fdleak tests to explicitly attach /dev/null as the standard
input so that the output is well known regardless of whether the test is
run from a terminal or from cron.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2276
2004-02-29 12:02:32 +00:00
Nicholas Nethercote
01e3fb111c Allow multiple .exp files, eg. foo.stderr.exp, foo.stderr.exp2; test will pass
as long as one matches.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2275
2004-02-29 01:31:09 +00:00
Nicholas Nethercote
7f71b28677 Adjust vg_pthread_cond_t so it works with an older glibc.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2274
2004-02-28 23:32:11 +00:00
Dirk Mueller
18e5d09422 adding suppressions for Redhat 7.2, patch by Tom Hughes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2273
2004-02-28 21:21:46 +00:00
Nicholas Nethercote
9f16738ca3 Some newer systems have a new version of pthreadtypes.h that comes from glibc
2.3.3, which is binary-compatible, but not source compatible with the old one,
which came from LinuxThreads.  We were using the types defined in the old one,
which caused compilation errors on systems using the new one.

This commit introduces our own versions of these types.  Our versions are laid
out identically to the LinuxThreads ones, but the field names are different.
We convert all pthread types to our versions before using them, so we don't
rely on the pthreadtypes.h types any more.  Hopefully this will fix the
problem;  I have three reports that it does.  Let's see...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2272
2004-02-28 15:40:36 +00:00
Nicholas Nethercote
796e432228 Move the '-lm' link flag to the end of the command line, so it works for
everyone.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2271
2004-02-26 09:04:38 +00:00
Julian Seward
d1d5001b9c Add the nightly build scripts.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2270
2004-02-25 13:14:39 +00:00
Jeremy Fitzhardinge
e7b88d999d Fix shmdt by using the right argument for the shared segment address.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2269
2004-02-25 00:07:10 +00:00
Nicholas Nethercote
df8ba4773c Check new fds are not within Valgrind's reserved range. Still one case for
recvmsg() where I'm not sure if it should be checked, and if so, what error
should be returned if the check fails.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2268
2004-02-24 23:57:47 +00:00
Jeremy Fitzhardinge
aa80b6dcf0 This fixes bug 75614. It seems that a symbol can be named
"foo<bar::blat>"; normally stabs names are terminated by ':', but we
also need to keep track of <> pairs so we can ignore nested colons.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2267
2004-02-24 23:46:06 +00:00
Jeremy Fitzhardinge
d03690c430 Fix the use of brk. This change removes the requirement for the "real" brk
segment to be moved up to stage2's brk segment.  Instead, Valgrind's
use of brk is simulated with mmap.  In order to prevent any unwanted use
of the process brk segment, it also sets the RLIMIT_DATA to 0, which will
make brk always fail.  glibc's malloc will use mmap to allocate if brk
fails.  We try to intercept glibc's brk, but malloc seems to always use the
library-internal version.  (The client's use of brk has always been simulated,
and is unaffected by this change.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2266
2004-02-24 23:42:55 +00:00
Nicholas Nethercote
10ed746767 Fix 'make dist'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2265
2004-02-24 23:38:17 +00:00
Dirk Mueller
42b3333516 patch by Tom Hughes to make it work with gcc 2.96
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2264
2004-02-23 22:09:54 +00:00
Nicholas Nethercote
a13fdfdad3 Fix var names in prototypes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2263
2004-02-23 16:45:18 +00:00
Nicholas Nethercote
ace3f28976 Added various functions that make instrumentation easier, particularly
doing C calls.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2262
2004-02-23 16:10:06 +00:00
Nicholas Nethercote
91c730ca39 Changed bug_reports_to.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2261
2004-02-23 15:33:33 +00:00
Nicholas Nethercote
39c1f4e7fc Update and add various .cvsignore files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2260
2004-02-22 19:34:55 +00:00
Nicholas Nethercote
0ecccb51cb Three CDROM ioctls, from Rocky Bernstein.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2259
2004-02-22 18:08:04 +00:00
Nicholas Nethercote
ec45a3d7e7 Remove system-dependent output from test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2258
2004-02-22 17:24:01 +00:00
Nicholas Nethercote
fcad29e364 Patch from Tom Hughes:
Patch to ignore REP prefixes on single byte RET instructions.

(REP RET is apparently faster than RET on AMD K7/K8)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2257
2004-02-22 16:56:28 +00:00
Dirk Mueller
d03de4f1f0 sigh
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2256
2004-02-21 04:27:49 +00:00
Dirk Mueller
c87d4957a6 get rid of the thread local storage tests until somebody
writes a configure check for them.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2255
2004-02-20 14:45:52 +00:00
Nicholas Nethercote
a1db7b4001 Add a pair of missing {pre,post}_mem_write events.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2254
2004-02-15 16:21:38 +00:00
Nicholas Nethercote
3b2f2b7d57 Fix so that new versions of system (using clone()) work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2253
2004-02-15 16:15:05 +00:00
Nicholas Nethercote
1e90b8cb29 whoops
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2252
2004-02-15 16:12:35 +00:00
Nicholas Nethercote
2c736edd5f Added copyright notice to all hp2ps source files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2251
2004-02-15 15:38:08 +00:00
Nicholas Nethercote
500de31850 This patch fixes getrlimit(RLIMIT_FILENO) to return VG_(max_fd) as the soft
limit for file descriptors to try and prevent the target programming realising
that the reserved file descriptors exist. It also appears to fix
sysconf(_SC_OPEN_MAX) so that must be going through the same system call.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2250
2004-02-15 15:32:51 +00:00
Nicholas Nethercote
18b4c5e404 fix code typo
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2249
2004-02-15 15:10:25 +00:00
Nicholas Nethercote
0d8965fded Remove compile warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2248
2004-02-14 16:53:53 +00:00
Nicholas Nethercote
1b392dae5f Whoops, meant to add with Massif.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2247
2004-02-14 16:48:35 +00:00
Nicholas Nethercote
614adcef8b Whoops, meant to add this with the rest of Massif.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2246
2004-02-14 16:46:17 +00:00
Nicholas Nethercote
563c4e566a Adding Massif, the heap profiler.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2245
2004-02-14 16:40:02 +00:00
Nicholas Nethercote
49c135649d Now doing pre_mem_read()s on the args to execve(), so eg. Memcheck can check
them.  Added a regtest for this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2244
2004-02-12 14:34:14 +00:00
Nicholas Nethercote
9e07c6d746 Add files I forgot to when I committed Tom Hughes' patch for bug 73907.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2243
2004-02-12 08:35:57 +00:00
Nicholas Nethercote
4c8ecb23c3 Heroic patch from Tom Hughes:
This patch adds translation tests for most of the basic x86 instructions and
  fixes a few missing/broken instructions to work properly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2242
2004-02-11 23:33:29 +00:00
Nicholas Nethercote
b2e8445916 Added support for epoll.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2241
2004-02-10 23:44:15 +00:00
Jeremy Fitzhardinge
863515c9a4 Fix for bug 73326. It seems that gcc 3.2.2 is generating negatively-sized
scopes and out of order line number information in the stabs debug info.
I wonder if this is the stabs writer rotting now that dwarf is the
default...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2240
2004-02-05 22:58:37 +00:00
Nicholas Nethercote
41dd3b13ee Fix broken "make dist".
Doesn't fix "make distcheck", however, because this happens:

  /usr/bin/ld: cannot open linker script file ../../coregrind/x86/stage2.lds:
  No such file or directory

For some reason I can't work out, that file is built when you make in a CVS
tree, or manually from a "make dist" tarball, but not when you "make
distcheck".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2239
2004-02-05 14:27:36 +00:00
Nicholas Nethercote
5ec5ade4c2 Killed the terminally wounded --stop-after option.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2238
2004-02-01 17:29:59 +00:00
Nicholas Nethercote
9c13bfd5e5 No longer showing debugging options for --help; only for the newly added
--help-debug.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2237
2004-01-31 22:55:15 +00:00
Jeremy Fitzhardinge
7f79e2ad88 Rearrange CPUID again. Moved most of the helper logic into C, since
the assember was getting fiddly.  It now masks out only the undefined
or unimplemented parts of the feature set bits, so it now passes through
all the non-ISA-related feature bits to clients.

It also leaves the vendor ID string unmolested, so that clients can
extract vendor-specific information like extended brand strings and
cache/TLB configuration info.

It does, however, implement some Valgrind-specific requests at 0xd8000000,
though at present the only functionality is the ValgrindVCPU signature.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2236
2004-01-26 21:11:51 +00:00
Nicholas Nethercote
c75d9d3800 "VG_AR_SKIN" --> "VG_AR_TOOL"
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2235
2004-01-26 17:24:42 +00:00
Nicholas Nethercote
a00c960da2 Made code more concise. In particular:
- introduced DIS() and DIP() macros to shorten debug printing

  - introduce jmp_lit(), jcc_lit(), jmp_treg() for common UCode sequences

  - replace many unnecessary dis?dis_buf:NULL tests with dis_buf, by
    changing the tests in disAMode()

Overall, reduced code size by about 230 lines.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2234
2004-01-26 17:14:17 +00:00