13-track-condvar-mutex
This fixes mutex lock/unlock tracking. In particular, it gets
tracking of mutex ownership over condition variables correct.
I didn't take the bits to do with vg_tid_currently_in_baseBlock's value
when baseBlock is empty.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1252
08-skin-clientreq
Introduce a systematic way for skins to distinguish each other's
client requests. Uses the de-facto standard two-letter identifiers in
the top two bytes of the client request code. Also changes the
interface to SK_(handle_client_request) so that a skin can say whether
or not it handled the request, which allows correct setting of the
default return value if the request was not handled.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1251
and Addrcheck. In coregrind/vg_memory.c, create
void VG_(generic_detect_memory_leaks
and remove several hundred lines of code from both ac_main.c and mc_main.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1250
16-ld-nodelete
Add -Wl,-z,nodelete,-z,initfirst to link line for libpthread.so,
because HJ [Lu] says so. Also add soname.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1249
15-hg-datasym
HELGRIND: In conjunction with patch 13-data-syms, print symbolic
information for addresses in error messages (if possible).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1248
14-hg-tid
HELGRIND: This fixes a bug in Helgrind in which all memory access by
syscalls was being treated as if it were happening in thread 1. This
is because the eraser_mem_read/write functions were using
get_current_tid_1_if_root() to get the current tid. Unfortunately,
during syscalls there is no current thread, so it was getting
1_if_root. This patch fixes this by using what thread ID information
we're given, and only using get_current_tid() if we're recording a
memory access performed by code (rather than by a syscall).
... which relies on ...
06-memops
Implement VG_(memcpy/memset).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1247
Fix to the ELF file reader to make sure that each SegInfo includes not
only the text mapped from an ELF file, but also the data and bss. This
allows the data symbols to be extracted. Also adds a new needs boolean
to allow a skin to specify if it needs data symbols. As a nice
side-effect, it removes the "offset" hack: the offset is the mapped
address in the ELF Phdr: it is (mapped_address - phdr_vaddr).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1246
valgrind.in 1.17.2.3
vg_syscall_mem.c 1.58.2.12
Add Jeremy Fitzhardinge's --weird-hacks=lax-ioctls patch, and add some docs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1244
Create __ versions of the select and poll symbols, so that all
references are caught (Jeremy Fitzhardinge)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1241
vg_libpthread.c 1.90.2.9
vg_libpthread_unimp.c 1.30.2.4
Add sem_timedwait(). From Scott Smith <sls@cs.unt.edu>.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1238
don't register helpers until command-line options are seen. As requested by
Jeremy Fitzhardinge. Also neatened the code up marginally.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1230
Attached patch is for the Dwarf2 source line info reader;
For reading, a state machine is used reconstructing source line
info while running and reading (see DWARF2 specification, ch. 6.2).
The state machine was correct, but the calls to addLineInfo()
were wrong: It reported most of the times too small ranges
for source code statements, because it used only the diff of the last
state machine command instead of the diff to the last statement
boundary. Effect: Around 1/3 of all addresses with source line info got
unknown location.
The patch adds a "last_address" to the state machine to remember the last
statement boundary. On reset, it#s initialised to the "invalid" address 0. I
hope this is OK (or should we use "(Addr)-1" instead?).
The patch now uses the "is_stmt" boolean correctly to only call addLineInfo()
if there's a statement boundary (on x86, is_stmt most probably is
always true...).
MERGE TO STABLE
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1209
the appearance of libc_internal_tsd_address requires a redesign, since
the existing scheme doesn't make it sensible to take the address of a
specific-data value.
New scheme is that the ThreadState structure carries not the table of
specifics, but merely a pointer to such. This is allocated from the
client-side library, thus residing in client-visible memory and so
addresses can validlyh be taken.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1208
- autoconf stuff for detecting glibc-2.3
- vg_libpthread_unimp.c: hack for __pthread_clock_[gs]ettime
- vg_libpthread.c: initialise thread's default locale by calling
__uselocale(LC_GLOBAL_LOCALE) at the right time. Gruesome.
Also need to do this for new other threads - not yet done.
- cleanups -- don't use write() to write messages when bombing out,
instead go direct to the syscalls. Avoids nasty circularities
with glibc initialisations.
MERGE TO STABLE
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1207
skin_name1,skin_name2:supp_name
No spaces are allowed on either side of the comma.
This is useful for sharing suppressions between Addrcheck and Memcheck.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1205
write no flags (usually) or write ZCP (rarely, >= P6 only fast FPU compare
insns.)
up_UInstr: Put some 0x in %x fields so we can see what's hex.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1204
non-readable, non-writable sections. Just ignore them. Comment in
the 1.0.X sources to the effect that this never happens is evidently a
lie.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1203
vg_syscall_mem.c 1.58.2.8 and 1.58.2.10
vg_unsafe.h 1.8.4.2
Support for __NR_ptrace, thanks to Jason Molenda. Now valgrind can be
used to debug GDB. Bwaha!
Kludge to work around the problem that the /usr/include/sys/user.h on
R H 6.2 doesn't define struct user_fpxregs_struct (problem appeared
with Jason Molenda's ptrace patch).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1192
Fix really stupid bug in REP SCAS<sz>.
Also (head only) add a bunch of asserts to guard against use of
seg override prefixes in conjunction with string ops; these are
not yet implemented.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1188
right.
Here's a code sequence illustrating the problem. The conditional jump
at the end evidently goes the wrong way sometimes, and the program
goes off into outer space soon after.
0x4017F6F7: addl %ebx,%ecx
12: GETL %ECX, t10
13: ADDL %EBX, t10 (-wOSZACP)
14: PUTL t10, %ECX
15: INCEIPo $2
0x4017F6F9: decl %eax
16: GETL %EAX, t12
17: DECL t12 (-wOSZAP)
18: PUTL t12, %EAX
19: INCEIPo $1
0x4017F6FA: jnb-8 0x4017F710
20: Jnbo $0x4017F710 (-rOSZACP)
21: JMPo $0x4017F6FC
Look carefully at the annotation on # 17. Then look in the Intel docs
and see what flag(s) the Jnb (not-below) condition consults. Bwaha!
It consults the carry flag.
The generated code for 17 (renamed to 12 after some NOP removal, I
guess) is
12: DECL %edx (-wOSZAP) [---d--]
42: 4A
decl %edx
43: 9C 8F 45 20
pushfl ; popl 32(%ebp)
viz, we do the decl, and then copy the real machine's %eflags into
%EFLAGS. Unfortunately this copies the real carry flag into the
simulated one, rather than leaving the simulated one alone.
So the principle is that it's only safe to omit the initial
%EFLAGS->%eflags move prior to the insn if the insn writes _all_ the
flags, and in this case it doesn't.
(after further consideration ...)
At first it seems tempting to play games with subset checks, ie if an
insn writes a _subset_ of the flags, we'd better copy sim'd to real
flags before the insn.
Problem with that is that the D (direction) flag, which specifies the
direction that rep-prefix string ops travel, is part of the "normal"
flag set. So it is conceivable, although highly unlikely, that an app
could
- set the D flag
- do something like ADD (-wOSZACP)
- use the D flag
then we'd still have to do an %EFLAGS->%eflags copy prior to the ADD,
in order to ensure the simulated D flag is preserved.
So it seems to me that it's pretty much impossible to preserve
absolute correctness and do any better than the vg_from_ucode.c rev
1.8 scheme.
Backing out rev 1.9. We can just as easily restore it from cvs if a
better solution is arrived at.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1185