Tom Hughes [Thu, 29 Apr 2010 09:22:25 +0000 (09:22 +0000)]
Link the tls test against tls2.so as it references symbols in it
and Fedora 13 no longer allows so's to be required indirectly (via
tls.so in this case).
Tom Hughes [Thu, 29 Apr 2010 09:01:21 +0000 (09:01 +0000)]
Include valgrind headers before system headers to avoid problems
with the system headers #defining things which are used as names
of structure members in vki headers.
This is needed to allow valgrind to build on Fedora 13 and Rawhide.
Tom Hughes [Wed, 28 Apr 2010 08:09:30 +0000 (08:09 +0000)]
Add some basic DWARF4 support. Based on patch from Jakub Jelinek
but with support for VLIW architectures with multiple opcodes per
instruction removed. Fixes #233595.
search_all_symtabs: when mapping addresses to text symbols, consider
any symbol in the r-x mapped segment to be a valid candidate. This
relaxes the filtering criterion slightly, makes it consistent with
other is-it-text? checks. Some addresses which before didn't get
mapped to anything are now correctly mapped to "vtable for Foo"
symbols.
Change the method used in hg_intercepts.c to hide from the user, the
race between mythread_wrapper and the wrapper for pthread_create. The
previous scheme could lead to false race reports in obscure cases.
Julian Seward [Sun, 14 Mar 2010 15:09:27 +0000 (15:09 +0000)]
Improve performance of the fallback path when a translation is not
found in the fast-cache.
* reduce max loading of the per-sector TT hash tables from 80% to 65%.
This reduces the number of required probes by a factor of 3.
* when searching for a translation, don't visit the sectors in a fixed
order. Instead, use an MTF array in which the most popular sectors
(in terms of most likely to hold the translation we're looking for)
are visited first. This reduces the number of required probes by
another factor of 2.
These improvements have no effect on small programs, but improve
scalability on big apps. For an application comprising 300k
translations, runtime on Memcheck is reduced by 3% and on None by
about 20%. The average number of probes per fast-cache miss is
reduced from around 22 to less than 5.
Julian Seward [Thu, 11 Mar 2010 13:43:18 +0000 (13:43 +0000)]
If a race error is detected, check to see whether the raced-on address
is inside a heap block, and if so, print the allocation point of the
heap block. It's stupid not to do this considering that the
implementation already keeps track of all mallocs and frees.
Julian Seward [Mon, 8 Mar 2010 14:45:26 +0000 (14:45 +0000)]
Fix the definedness handling of the last argument of sys_socketpair.
The last argument is really a pointer to an array of two ints and so
we need to say it is an int* and not an int [2]. This just happens to
work on amd64-linux because sizeof(int [2]) == 8 == sizeof(int*). On
arm-linux it duly craps out w/ an assertion because sizeof(int [2]) !=
sizeof(UWord).
Bart Van Assche [Sun, 7 Mar 2010 10:54:21 +0000 (10:54 +0000)]
Changes:
- Generalized the behavior of happens-before / happens-after annotations such
that not only 1:1 but also n:m patterns are supported.
- Dropped support for invoking happens-before / happens-after annotations on
POSIX condition variables (pthread_cond_t).
- Report the details about the offending synchronization object in generic
errors.
- Converted a few tl_assert() statements into error messages.
Bart Van Assche [Sun, 7 Mar 2010 10:42:15 +0000 (10:42 +0000)]
Made the behavior of the annotate_smart_pointer test program configurable
through command-line arguments, and made sure that the annotations present
in the source code are recognized by all Valgrind-based data race detection
tools.
Bart Van Assche [Sat, 6 Mar 2010 10:54:36 +0000 (10:54 +0000)]
Changes:
- Annotated the smart pointer implementation.
- Explained the purpose of the test via source code comments.
- Removed class Semaphore.
- Made it possible to specify the number of threads to be created via the
command line.
Tom Hughes [Fri, 5 Mar 2010 10:11:41 +0000 (10:11 +0000)]
On amd64 all IPC calls behave as if the IPC_64 flag is set in the
command, so pretend that it is set when calling the generic wrapper
functions in pre and post handlers. Fixes #229509.
Julian Seward [Wed, 3 Mar 2010 22:57:47 +0000 (22:57 +0000)]
Make the version number available in the valgrind.h headers, so
clients can do version-specific client requests. This is something we
should have done long ago. Still needs a way to regtest this, to
check that the embedded version matches what's stated in configure.in.
Tom Hughes [Tue, 23 Feb 2010 10:02:55 +0000 (10:02 +0000)]
Add support for the getcpu system call on x86, ppc32 and ppc64. There
is no support for amd64 because there is no getcpu system call on that
platform - it is always done as a vsyscall in user space.
Based on patch from Aleksander Salwa. Closes #223758.
Julian Seward [Mon, 22 Feb 2010 11:03:10 +0000 (11:03 +0000)]
When creating a child thread, initially set its os_state.threadgroup
to have the same value as the parent. This avoids exit races leading
to hangs and strange behaviour in heavily multithreaded apps, in the
situation where threads are rapidly being created, and at the same
time an existing thread does sys_exit_group so as to terminate the
entire process. Thanks to Konstantin S for chasing this down to a
small test case. Fixes #226116.
Julian Seward [Sun, 21 Feb 2010 20:40:53 +0000 (20:40 +0000)]
CVTPI2PD (which converts 2 x I32 in M64 or MMX to 2 x F64 in XMM):
only switch the x87 FPU to MMX mode in the case where the source
operand is in memory, not in an MMX register. This fixes #210264.
This is all very fishy.
* it's inconsistent with all other instructions which convert between
values in (MMX or M64) and XMM, in that they put the FPU in MMX mode
even if the source is memory, not MMX. (for example, CVTPI2PS).
At least, that's what the Intel docs appear to say.
* the AMD documentation makes no mention at all of this. For example
it makes no differentiation in this matter between CVTPI2PD and
CVTPI2PS.
I wonder if Intel surreptitiously changed the behaviour of CVTPI2PD
since this code was written circa 5 years ago. Or, whether the Intel
and AMD implementations differ in this respect.
Tom Hughes [Fri, 19 Feb 2010 16:50:45 +0000 (16:50 +0000)]
Add parentheses round the "zzarg" macro argument when using it as it
may expand to an expression which may mean we wind up doing the cast
before evaluating the expression... Closes #227570.
Tom Hughes [Tue, 16 Feb 2010 15:05:55 +0000 (15:05 +0000)]
Neither FUTEX_WAKE or FUTEX_WAKE_BITSET actually dereference the
futex at all (they just use the address) so we shouldn't insist on
it's contents being define. Fixes #224723.
Julian Seward [Fri, 12 Feb 2010 12:12:39 +0000 (12:12 +0000)]
Try to find the PDB file for a given PE file by the totally kludgey
method of doing "strings file.dll | egrep '\.pdb|\.PDB'".
Distantly derived from a patch by leiz@ucla.edu. Fixes #222902,
although I still would prefer to do this the proper way, by parsing
the PE file properly.
Julian Seward [Sat, 30 Jan 2010 13:40:27 +0000 (13:40 +0000)]
The client request VG_USERREQ__LOAD_PDB_DEBUGINFO that we get from
Wine as a notification to read PDB/PE debug info, contains a parameter
'reloc' whose purpose is unknown, and which is unused. Rename it
accordingly, to 'unknown_purpose__reloc'. (a non-functional change)