all commentary from our libpthread.so through to the valgrind core and
hence to the selected logging sink.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1274
or for whatever reason hangs up the connection, don't let valgrind
get SIGPIPE; instead just switch back to spewing messages on stderr.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1273
valgrind ... --logsocket=192.168.0.1:1500 or whatever, to send all
output to that address/port combination.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1272
19-hg-lockgraph
HELGRIND: large patch which does a big bugfix and adds some new
instrumentation:
1. The bugfix is BIG. Previously the code which maintained the
thread's current lockset would often (maybe always) fail to add new
locks to the set, so it always looked like threads were holding one
lock. The problem was in weird_LockSet_equals(); I rewrote it in a way
which should be obviously correct. Fixing this exposed a bug in
removing locks from a thread's lockset, which was also caused by
another bug in weird_LockSet_equals(). This fix makes many spurious
data race warnings go away (notably, stdio becomes silent).
2. The new feature is tracking of the order of lock usage. If
threads are taking locks in an inconsistent order, that's a symptom of
possible deadlock. Helgrind will now warn when it sees this happening
(though the warnings themselves need to be improved).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1267
16-function-intercept
Implement a more reliable for vg_libpthread to intercept libc
calls. Since the only reliable way of making sure that our code
defines the symbol is by making sure that valgrind.so itself does it,
this patch adds a new file, vg_intercept.so, which defines those
symbols. They are then passed off to a weak local function if
libpthread isn't present, or to the libpthread version if it is.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1265
14-hg-mmap-magic-virgin
This does two things:
1. change the signatures of the new_mem_mmap and change_mem_mprotect
functions to remove the pointless 'nn' argument. This makes them match
the signature of new_mem_startup...
2. change helgrind to mark memory created by mmap as if it were the
same as other magically pre-inited memory. Implement this by pointing
helgrind's new_mem_mmap function at new_mem_startup.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1263
13-kill-1ifroot
Kill VG_(get_current_tid_1_if_root)() and replace it with the slightly
more appetising (though still hackish)
VG_(get_current_or_recent_tid)(). This is intended for use when
there's no thread actually loaded into the baseblock, but we're doing
work on behalf of the the thread that was last running (such as during
a syscall).
This probably fixes a bug with helgrind misattributing memory created
with mmap to thread 1 rather than the thread which called mmap (though
the behaviour is still probably wrong: mmapped memory should be
magically_inited).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1262
Workaround bad DWARF2 line info generated by the Intel Fortran compiler.
There is a big comment in the sources explaining more.
MERGE TO STABLE
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1259
21-hg-dupwrite
HELGRIND: quite often memory is written with a value which is already
there, which would not cause a race (I think; there are certainly
valid idioms which rely on this behaviour). Anyway, suppressing checks
for such overwrites cuts down the number of apparently spurious
errors. Also fixes the bug in which FP loads were considered to be
stores.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1258
20-hg-secmap
HELGRIND: fix bugs causing a torrent of "access to distingished map"
messages. There were two: one is some absurdly broken rounding/padding
code in set_address_range_state() (how did anything work!?). The other
was some odd looking code in the tracking of attaching shared memory
segments. Since they're semantically very similar to mmap, track them
as such.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1257
19-hg-context
HELGRIND: Yet more work on making sure the right context is used when
reporting errors. The previous code used the snapshot of the thread
context in the VG_(threads) array rather than the current machine
state in the baseBlock. This patch makes sure that errors arising from
program reads and writes are reported properly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1256
18-hg-err-reporting
HELGRIND: show more information about the address we're reporting a
possible data race for; in particular, try to describe where the
address came from (static variable, or heap allocated and if so
where?) (Mostly stolen from memcheck). Also puts memory locations
involved with an error into an error state, so that duplicate errors
are suppressed. Also displays the last good set of locks for a memory
location.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1255
17-hg-generic-mutex
HELGRIND: remove references to pthread_mutex_t and replace it with a
more generic notion of a mutex. Adds a persistent store of per-mutex
information. Not presently useful, but will be.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1254
14-sprintf
Update to core VG_(printf)/sprintf/vprintf. They've been modified to
return the number of characters they generated (either printed, put
into the buffer, or sent). Also adds a new %y format, which takes an
Addr argument and looks up a symbol. It takes a '(' flag (ie: "%(y")
which surrounds the symbol in parens if it could be found.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1253
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