Fix problem with FC2's vdso (sysinfo) page, which lives at a low,
random address. This gets unmapped as part of the client setup, and
causes syscalls to fail as a result. This patch simply disregards the
sysinfo page. It seems like a blunt fix, but I don't think anything
depends on a sysinfo page.
Tom Hughes [Sun, 13 Jun 2004 12:07:53 +0000 (12:07 +0000)]
When cancelling a thread that is waiting on a condition variable we
need to relock the associated mutex before running the cancellation
handlers.
This patch ensures that the mutex is reaquired in the above case and
also makes pthread_join and pthread_cond_wait act as cancellation points
as required by the POSIX threads standard.
Based on patch from Joseph Link <joelink@joelink.net>.
Tom Hughes [Sun, 13 Jun 2004 09:59:02 +0000 (09:59 +0000)]
Add support for separate debug files, which are just separate ELF files
containing the relevant debug sections and located using the information
in the .gnu_debuglink section of the main file along with some search
rules and checksum logic borrowed from binutils/gdb.
Tom Hughes [Sat, 12 Jun 2004 12:58:22 +0000 (12:58 +0000)]
It appears that NPTL uses a new system for dealing with cleanup
handlers when a thread is cancelled which has the side effect that
programs linked with librt fail on Fedora Core 2 due to librt having
been built against the NPTL header instead of the old pthread headers.
This change extends valgrind's libpthread.so to handle both the old
and new style cleanup handlers in a similar way to NPTL and seems to
be sufficient to get programs linked with librt working again.
Tom Hughes [Fri, 4 Jun 2004 21:42:18 +0000 (21:42 +0000)]
There is no __accept in any libc or libpthread that I can find so
it isn't clear why we were intercepting that and only aliasing accept
to it. Switched to intercepting accept directly instead.
Tom Hughes [Thu, 3 Jun 2004 18:00:58 +0000 (18:00 +0000)]
Changed cancellation wrappers to use dlsym(RTLD_NEXT) to look up the
libc version of the wrapped function when forwarding the call rather
than trying to call the internal __libc_xxx version of the routine
as many of those are marked as GLIBC_PRIVATE in recent releases.
Partial fix for bug 76869. This fixes the problem with returning from
a signal handler when VDSOs are turned off in FC2. Note that we don't
(yet) support VDSOs being on (use "echo 0 > /proc/sys/kernel/vdso").
Fix wishlist item 82098, thanks to Ralf Wildenhues:
ANSIfication of the hp2ps code. The most important changes are the correct
use of the stdarg mechanism (former hacks could bite on other systems, so
please tell upstream), inclusion of stdlib.h instead of declaring free
yourself, adding a few missed PROTO()s and using size_t for xmalloc and
xrealloc.:
Addrcheck wasn't doing overlap checking as it should. This is because
mac_replace_strmem.o was being linked with vgskin_addrcheck.so instead of
vgpreload_addrcheck.so. I fixed the Makefile, and also moved
_VG_USERREQ__MEMCHECK_GET_RECORD_OVERLAP so Addrcheck could see it. And I
added the 'overlap' test (from memcheck/tests/) to Addrcheck's regression
suite.
Tom Hughes [Wed, 21 Apr 2004 15:39:57 +0000 (15:39 +0000)]
Change the debugger attachment code to send the STOP signal to the
forked process before using ptrace() to continue it, instead of asking
ptrace to deliver it, as that doesn't seem to work on some versions
of linux.
Tom Hughes [Wed, 21 Apr 2004 15:16:43 +0000 (15:16 +0000)]
Initialise %cs, %ds and %ss in the virtual machine to match the values
supplied by the operating system for the code, data and stack segments.
Explicit references using these segments still won't work but they
will at least produce an assertion to indicate that they aren't
supported instead of raising a segmentation fault in the target
program because of an apparent privilege violation.
Add a "delete:" line to the regression test .vgtest files, to clean up any file
created by the test. Added appropriate lines to the Cachegrind and Massif
tests. Should prevent large numbers of files clogging up directories.
Fix for bug 77869. Names in stabs are terminated by ':'. Except templated
names, which can have :: within <> quotes. Except when it's an operator,
which can have a name like operator<, followed by ::.
Suppressions of jump errors were broken, because the size was zero and
so caused an assertion failure. So set size == 1 -- it's only used for
suppressions.
Address 0x%x is not stack'd, malloc'd or (recently) free'd
This makes things clearer in some circumstances, particularly when bogusly
accessing heap memory that has been freed, but Memcheck is no longer tracking.
Revamped. Split into sections, added stuff about the name "Valgrind" (where it
comes from, pronunciation), removed some obsolete questions, added some new
ones.
Tom Hughes [Wed, 31 Mar 2004 15:23:13 +0000 (15:23 +0000)]
Implement tcdrain in the pthread library. The fact that this function
is missing was reported in bug #70344 but the reporter then closed the
bug saying that they were using the wrong version of valgrind.
Tom Hughes [Sun, 28 Mar 2004 11:26:29 +0000 (11:26 +0000)]
For FPU/MMX/SSE instructions which don't reference any memory, make memcheck
look at whether the eflags are read or written and generate UCode to validate
and/or mark as valid the eflags when necessary.
Tom Hughes [Mon, 22 Mar 2004 19:46:29 +0000 (19:46 +0000)]
Redirect _dl_sysinfo_int80, which is glibc's default system call
routine, to the routine in our trampoline page so that the
special sysinfo unwind hack in vg_execontext.c will kick in.
When creating new threads, initially block all signals. It's up to the
client code (in vg_libpthread.c) to set the appropriate signal mask when
its ready. This prevents a bug where a thread gets sent a signal before
even running any of its initialization code, which can cause problems
(particularly if the signal handler directly or indirectly uses TLS).
This change does two things: one is the implementation of
VG_(synth_fault_*), which synthesize faults as if an instruction had
caused a CPU fault. This is used in two places: one in vg_translate.c,
when trying to fetch instructions from bad memory, and the other in
vg_ldt.c, when using a bad segment register. This fixes a bug where an
assertion would fail rather than getting a useful message.
Julian Seward [Sun, 14 Mar 2004 03:06:37 +0000 (03:06 +0000)]
Modify the memory manager so it "natively" supports 8-byte alignment,
basically by messing with the block layout.
* Move freelist next ptr from before payload to after it
* Ensure payload and red zones always have sizes which are
multiples of 8-bytes.
Seems to work OK. Values returned from the two basic allocator
functions VG_(arena_malloc) and VG_(arena_malloc_aligned) are
vg_asserted to have suitable alignment (== 8, >= 8 && == requested
alignment) respectively.