- removed various things that are no longer used
- made (module-)local some things that were global
- improved the formatting in places
Removed about 160 lines of code, and non-trivially reduced the number
of global entities.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2541
are treated as blocking.
This fixes bug #86000 because shmat is no longer treated as blocking
and it is therefore no longer possible for two threads to try and use
the same address for the shared memory segment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2536
can block (ie F_SETLKW) are treated as blocking.
This resolves the F_SETOWN problem described in bug #85969.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2535
even when the system call fails, and allow the PRE function to modify the
system call flags.
Also fix nanosleep so that it only marks the returned time as defined
if the system call exited with EINTR due to be interrupted.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2534
requires padding of the address space around calls to io_setup in order
to constrain the kernel's choice of address for the I/O context.
Based on patch from Scott Smith <scott-kde@gelatinous.com> with various
enhancements, this fixes bug #83060.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2485
- removed an unnecessary VG_(unmap_range)() call in do_brk() -- the
VG_(munmap)() just before it does it anyway.
- inlined mprotect_segment() and munmap_segment() because it's more concise and
easier to understand that way.
- a couple of minor formatting changes
- added and cleaned up a couple of comments
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2469
add a segment mapping to the segment skip-list, and then often the caller of
VG_(mmap) would do another one for the same segment, just to change the SF_*
flags. Now VG_(mmap) gets passed the appropriate SF_* flags so it can do it
directly. This results in shorter, simpler code, and less work at runtime.
Also, strengthened checking in VG_(mmap), POST(mmap), POST(mmap2) -- now if the
result is not in the right place, it aborts rather than unmapping and
continuing. This is because if it's not in the right place, something has
gone badly wrong.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2466
the current reserved area, which effectively acts as a hard limit. The
setrlimit system call now simply updates the emulated limits as best
as possible - the hard limit is not allowed to move at all and just
returns EPERM if you try and change it.
This should stop reductions in the soft limit causing assertions when
valgrind tries to allocate descriptors from the reserved area.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2440
--logfile-fd --> --log-fd
--logfile --> --log-file
--logsocket --> --log-socket
to be consistent with each other and other options (esp. --input-fd). Also
renamed some related variables. The old names still work, for backwards
compatibility, but they're not documented.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2429
the execve system call if the envp pointer is null as it causes
valgrind to die with a segmentation fault.
CCMAIL: 83573-done@bugs.kde.org
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2427
improve the checking of other interface related ioctls.
Based in part on a patch from Jim McDonald <jim@mcdee.net> supplied
as a fix for bug #83344.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2424
that when the client is killed by a coredumping signal, Valgrind will
generate the coredump itself, which is full of client state, rather than
Valgrind state; this core file will therefore be useful to the developer
in debugging their program.
The corefile generated is named vgcore.pidNNNNN (and maybe with .M on
the end in case of duplicates). If you set a logfile with --logfile,
then this name will be used as the basename for the core file, so that
both the core and the logs will be next to each other.
Valgrind respects the RLIMIT_CORE limit when generating the file; if the
limit is set to 0, then it will not generate one.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2312
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
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
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
Patch to provide a proper environment to the debugger
Although this patch isn't strictly needed to allow alternative debuggers to
be used, it is needed if you want to use an X based debugger such as ups
(and presumably ddd) as VG_(system) has until now passed an empty
enviroment when starting the debugger but that causes DISPLAY to be lost.
This patch causes VG_(system) to pass a copy of the client environment
instead, with the necessary mashing done to clean up the LD_xxx variables.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2233
no longer exists. One advantage of this is that global
variables/structures needed for communicating between the two can be made
local. Also, the order in which things happen has been simplified.
This is mostly just a big refactoring. Startup is now a fair bit easier to
understand. Dependencies between the various startup stages are fairly well
documented in comments. Also, --help and --version now work properly --
eg. --help gives tool-specific help if --tool was specified. There is still
some parts where things could be reordered and/or simplified, and where the
dependencies aren't clear. These are marked with 'XXX'.
One new feature was added: ability to read options from ~/.valgrindrc and
./.valgrindrc. Part of this is support for specifying tool-specific options
in the form --toolname:tool-specific-option.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2222
threads to have thread-private data which is quickly accessible via a
segment in the GDT, stored in %gs. The patch implements the relevent
syscalls (setthreadarea), and also manages switching the VCPU's segment
information at thread context-switch time. Mostly Tom Hughes' work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2215
malloc. The problem was that LD_PRELOAD was being left set with
our replacement .so files, which meant they were being applied to
stage1/stage2. This caused malloc to fail and a subsequent SIGSEGV.
This change unconditionally removes all of Valgrind's special environment
before each execve, since it will be replaced as needed by the child
Valgrind.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2184