Commit Graph

118 Commits

Author SHA1 Message Date
Julian Seward
29ff6066e9 Add a new flag, --child-silent-after-fork=no|yes [no]. When enabled,
causes child processes after fork to fall completely silent, which can
make the output a lot less confusing.  In addition it is pretty much
essential in XML output mode, so as to avoid mixing up any child XML
output with the parent's.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7177
2007-11-17 22:29:25 +00:00
Julian Seward
db29debc13 Make handling of setuid executables marginally more sensible, as
suggested in #119404.

Prior to this commit, if the current traced process attempted to
execve a setuid executable, an error was always returned.  The revised
behaviour is:

If the current (traced) process attempts to execve a setuid
executable:

* If --trace-children=yes is not in effect, the execve is allowed.

* If --trace-children=yes is in effect, the execve is disallowed
  (as at present), but an error message is printed (unless in XML mode),
  so at least the execve does not fail silently any more.

As per discussion on #119404 we could probably do a lot better, but
these changes are at least simple, useful and uncontroversial.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7175
2007-11-17 21:11:57 +00:00
Julian Seward
33e93b4514 Oops (a second time), this was missed out of r7118 (Merge (from
branches/THRCHECK) the following amd64-linux stack unwind kludges)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7124
2007-11-09 23:24:09 +00:00
Tom Hughes
4c402c0681 Add support for some I2C ioctls.
Based on patch from Jean Delvare <khali@linux-fr.org>.
Fixes bug #142186.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6631
2007-03-07 10:07:13 +00:00
Julian Seward
b7302d9258 Get rid of the type XArrayStrings in m_clientstate and use new generic
equivalents in module m_xarray instead.  A suprisingly pervasive
change.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6616
2007-02-25 15:08:24 +00:00
Julian Seward
e71365244a When '-d' (one or more) is specified, disallow the client from closing
fd 2 (stderr) since that's what m_debuglog writes to, and the
resulting disappearance of the debug log can be confusing.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6519
2007-01-13 22:27:51 +00:00
Julian Seward
20a55a1469 ML_(generic_PRE_sys_mmap): In the case of a hinted mapping (for the
client) which aspacemgr accepts at the hint address but the kernel
declines, try again as a non-hinted mapping.  Fixes ld.so mapping
failures observed on ppc32-linux, although the problem potentially
applies to all Linux targets.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6495
2007-01-09 16:47:20 +00:00
Julian Seward
172505c978 Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488
2007-01-08 06:01:59 +00:00
Tom Hughes
141bfac9cf Add support for some USB ioctls. Based on patches from Jon Burgess and
Marcus Meissner in bugs #136059 and #138896.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6411
2006-12-18 16:48:10 +00:00
Julian Seward
34198cf597 Rename VG_(get_lwp_tid) to VG_(lwpid_to_vgtid).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6409
2006-12-17 19:36:06 +00:00
Julian Seward
52cf6ff843 Tidy fd-leak stuff a bit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6391
2006-12-11 01:11:02 +00:00
Julian Seward
639f06a928 Fix regression caused by recent merging, picked up by none/tests/shell.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6316
2006-10-18 00:34:21 +00:00
Julian Seward
bbe7f55813 Merge r6140 (some of):
- track SysRes changes

- track VG_(am_find_nsegment) const-ness change

- increase number of client syscall args supported from 6 to 8

- simplify type SyscallStatus.  Simply hold a copy of the SysRes
  for the syscall rather than have this be a data structure
  incorporating something very similar to the fields of a SysRes,
  and more besides.  Change various macros in priv_types_n_macros.h
  to match.

- syswrap-main.c: instantiate the various impedance-matching
  functions for AIX.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6276
2006-10-17 01:47:30 +00:00
Julian Seward
ae8215b3ac Create a new module, m_vki, and move all knowledge about the kernel
interface, except for the syscall numbers, into that.  Mostly this
means moving include/vki-*.h to include/vki/vki-*.h.

include/pub_tool_basics.h previously dragged in the entire kernel
interface.  I've done away with that, so that modules which need to
see the kernel interface now have to include pub_{core,tool}_vki.h
explicitly.  This is why there are many modified .c files -- they have
all acquired an extra #include line.

This certainly breaks all platforms except x86.  Will fix shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6225
2006-10-14 19:26:10 +00:00
Julian Seward
4b572a567e Create a new module, m_vkiscnums, and move all the system call numbers
into that.  Mostly this means moving vki_unistd-<plat>.h to
include/vki/vki-scnums-<plat>.h.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6224
2006-10-14 15:51:32 +00:00
Julian Seward
070042a4c5 When handling mremap, disallow an expanding in-place remap if it would
trash some other segment as a result of the expansion.  This fixes
#129866.  I don't know if it is a good solution though.  Causes
none/tests/mremap{,2} to fail now, although I think it is still OK.
mremap really is a semantic disaster area.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6003
2006-08-16 14:22:29 +00:00
Tom Hughes
0e8a28708c Fix boundary case when trying to use brk() to expand right up to the
limit of the brk segment.

Because VG_(brk_limit) is the first address beyond the end of the
memory available to the caller of brk() we need to allow it to grow
up to and including the address one page below the end of the space
valgrind has reserved.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5974
2006-06-21 08:01:14 +00:00
Tom Hughes
22881a5f04 Implement some more terminal ioctls. Fixes bug #124039.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5970
2006-06-07 18:35:34 +00:00
Julian Seward
ad67fd79fe Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954
2006-06-05 23:21:15 +00:00
Tom Hughes
6076d2c38b Don't check the fifth argument of mremap() unless MREMAP_FIXED is set
in the fourth argument. Fix to bug #123535.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5886
2006-05-08 11:58:06 +00:00
Tom Hughes
17b262ab87 Add support for CDROMREADRAW and fix CDROMREADTOCENTRY to mark the right
number of bytes as defined in the post handler. Fixes bug #126696.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5885
2006-05-08 11:37:04 +00:00
Dirk Mueller
a0d79c6e9f split the assert so that its more obvious which
part is failing


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5864
2006-04-27 11:05:13 +00:00
Julian Seward
8367bd8ed0 Syscall wrappers for ppc32-linux (and one for amd64-linux).
(from Jakub Jelinek)  See #125492.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5849
2006-04-14 01:04:04 +00:00
Tom Hughes
2b63758b93 Enable sigsuspend on x86-linux and ppc32-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5819
2006-04-03 16:38:33 +00:00
Tom Hughes
ce490aed74 Handle msg_flags correctly - for recvmsg this field is written by the
kernel not read.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5789
2006-03-24 16:48:19 +00:00
Julian Seward
23218c0ec8 Update expected output following r5785; also add a missing 's'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5788
2006-03-22 11:18:50 +00:00
Tom Hughes
4eb782b553 Add wrappers for a load of new 2.6.16 system calls. Fixes bug #123248.
Also expands pathname arguments as strings in a lot more system call
trace messages and fixed the poll wrapper to not be x86 specific.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5785
2006-03-21 10:58:35 +00:00
Tom Hughes
6331c1b82d Make hard limit enforcement work for RLIMIT_DATA and RLIMIT_STACK in
the setrlimit system call wrapper.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5782
2006-03-20 15:36:28 +00:00
Julian Seward
7190322b0a Ensure memory acquired from sys_brk() really is zeroed. Fixes #121893.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5647
2006-02-14 11:37:41 +00:00
Tom Hughes
8441a53495 Implement a few extra ioctls based on patch from Eric Pouech in bug #120728.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5633
2006-02-11 13:29:09 +00:00
Julian Seward
d452d6b62d casting paranoia (harmless)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5484
2006-01-03 04:09:27 +00:00
Julian Seward
8ba9a34088 Add framework for ppc64 support. Apologies in advance for the
inevitable breakage to other platforms.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5250
2005-11-29 13:05:56 +00:00
Julian Seward
c7b988eab6 Fix bug observed by Neal Norwitz in which mremap fails for file mappings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5229
2005-11-23 03:41:41 +00:00
Tom Hughes
91b44ff30e Use VG_(ntohl) and VG_(ntohs) to decode IP addresses and ports. Note
that this also required reversing the order of the arguments to the
print call as the previous ordering assumed that the address was still
byte swapped.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5163
2005-11-17 12:02:58 +00:00
Julian Seward
c01a097e5b Kludgey endianness fix (for printing only) to stop fdleak_ipv4 failing on
ppc32.  I'm sure there's a Right Way to fix it, and this isn't it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5161
2005-11-17 11:45:28 +00:00
Tom Hughes
39e6ec034f Handle some ALSA ioctls that don't have size or direction hints.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5131
2005-11-14 17:03:54 +00:00
Nicholas Nethercote
9d374f4530 Rename --simulation-hints as --sim-hints for brevity.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5099
2005-11-12 18:21:40 +00:00
Tom Hughes
0d25c745d7 Fix compiler warning.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5084
2005-11-11 12:32:10 +00:00
Julian Seward
1e2a85030c Add comments from email discussion re mprotect.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5057
2005-11-09 14:51:59 +00:00
Tom Hughes
db732ea188 Handle the PROT_GROWSDOWN and PROT_GROWSUP mprotect flags properly
which stops glibc falling over when a program requires an executable
stack and glibc has been built to assume that PROT_GROWSDOWN will work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5041
2005-11-08 16:51:55 +00:00
Julian Seward
f1ead573e8 Second try at getting rid of the is_self() hack used to decide when to
load debug info from the V executable.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5033
2005-11-08 00:45:47 +00:00
Tom Hughes
48f8c22e44 Get core dumping working again - the architecture specific code that
was in the sigframe module has been moved into the coredump module 
where it belongs and things fixed up to compiler again.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4970
2005-10-31 17:05:21 +00:00
Julian Seward
4e2059f06a The Spin-Doctor arrives in Valgrind-Land: rename --weird-hacks= to
--simulation-hints=.  Bwaha.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4955
2005-10-20 01:09:57 +00:00
Nicholas Nethercote
82c3ab0af9 Overhaul the way programs are loaded at startup and exec() works. Now the
checking of programs done in these two places are combined, which avoids
duplicate code and greatly reduces the number of cases in which exec()
fails causing Valgrind to bomb out.

Also, we can now load some programs we could not previously, such as scripts
lacking a "#!" line at the start.  Also, the startup failure messages for
bad programs match the shell's messages very closely.

And I added a whole bunch of regtests to test all this.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4918
2005-10-14 03:11:30 +00:00
Tom Hughes
6961dcf591 Fix statement-before-declaration warnings for the core code.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4906
2005-10-12 10:45:27 +00:00
Julian Seward
5027b7a30e Enable sys_ftruncate64 on ppc32.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4891
2005-10-07 13:30:48 +00:00
Tom Hughes
193e4670fc When looking for a heap segment to extend look for the heap limit
address rather than the base address as the heap may have been split
into more than one segment by using mprotect on it...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4882
2005-10-06 14:49:21 +00:00
Julian Seward
4ce62c9445 If the launcher can't figure out what it's own name is, don't bail
out.  Instead, print a warning message, continue, and cause any
attempt to trace into a child process to fail with ECHILD.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4861
2005-10-04 23:07:33 +00:00
Julian Seward
4a47f441f2 Rewrite ML_(fd_allowed):
* include explaination from Tom
* make logic easier to follow, and add comments
* remove veto on the -d file descriptor (detailed comments in code)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4860
2005-10-04 22:27:22 +00:00
Tom Hughes
65bd3eb367 Create a new SkShmC segment type for shared memory segments so that we
can ensure they are never merged with adjacent segments. This makes
sure that we can find the right piece of memory to release when the
shmdt system call occurs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4854
2005-10-04 15:59:54 +00:00