Julian Seward [Mon, 1 Jan 2007 22:07:58 +0000 (22:07 +0000)]
Avoid printf in the recursive routines, so that the intercept of
mempcpy which is called from printf does not mess up the
carefully-balanced call-stack overflow checks that this test does on
ppc64-linux.
Julian Seward [Sun, 31 Dec 2006 00:22:30 +0000 (00:22 +0000)]
Intercept/replace glibc-2.5's __strcpy_chk function for the usual
reasons: it reads word-sized chunks from memory and so produces lots
of errors in SuSE 10.2 (amd64).
Julian Seward [Thu, 28 Dec 2006 20:26:08 +0000 (20:26 +0000)]
Get rid of the core-tool events pre_mutex_lock, post_mutex_lock and
post_mutex_unlock. The core can't detect them anyway any more, so
there's no point in having them.
Julian Seward [Sun, 24 Dec 2006 02:20:24 +0000 (02:20 +0000)]
A large but non-functional commit: as suggested by Nick, rename some
IR types, structure fields and functions to make IR a bit easier to
understand. Specifically:
dopyIR* -> deepCopyIR*
sopyIR* -> shallowCopyIR*
The presence of a .Tmp union in both IRExpr and IRStmt is
confusing. It has been renamed to RdTmp in IRExpr, reflecting
the fact that here we are getting the value of an IRTemp, and to
WrTmp in IRStmt, reflecting the fact that here we are assigning
to an IRTemp.
IRBB (IR Basic Block) is renamed to IRSB (IR SuperBlock),
reflecting the reality that Vex does not really operate in terms
of basic blocks, but in terms of superblocks - single entry,
multiple exit sequences.
IRArray is renamed to IRRegArray, to make it clearer it refers
to arrays of guest registers and not arrays in memory.
VexMiscInfo is renamed to VexAbiInfo, since that's what it is
-- relevant facts about the ABI (calling conventions, etc) for
both the guest and host platforms.
Callgrind: Throttle calls CLG_(run_thread) after r6413
After the change in r6413, CLG_(run_thread) is called a
lot more often, increasing the polling overhead to check
for a callgrind command file (created by callgrind_control
for controlling a callgrind run in an interactive way).
This reduces the calls to only be done every 5000 BBs,
which gives a similar polling frequency as before.
Julian Seward [Sat, 23 Dec 2006 01:21:12 +0000 (01:21 +0000)]
Change the core-tool interface 'thread_run' event to be more useful:
- Rename the event to 'thread_runstate'.
- Add arguments: pass also a boolean indicating whether the thread
is running or stopping, and a 64-bit int showing how many blocks
overall have run, so tools can make a rough estimate of workload.
The boolean allows tools to see threads starting and stopping.
Prior to this, de-schedule events were invisible to tools.
- Call the callback (hand the event to tools) just before client
code is run, and again immediately after it stops running. This
should give correct sequencing w.r.t posting of thread creation/
destruction events.
In order to make callgrind work without complex changes, I added a
simple impedance-matching function 'clg_thread_runstate_callback'
which hands thread-run events onwards to CLG_(thread_run).
Use this new 'thread_runstate' with care: it will be called before
and after every translation, which means it will be called ~500k
times in a startup of firefox. So the callback needs to be fast.
Julian Seward [Sun, 17 Dec 2006 18:58:55 +0000 (18:58 +0000)]
A naming-only change: rename VG_(set_running) to VG_(acquire_BigLock)
and VG_(set_sleeping) to VG_(release_BigLock). And some other minor
renamings to the thread locking stuff, to make it easier to follow.
Julian Seward [Sat, 16 Dec 2006 14:25:04 +0000 (14:25 +0000)]
64-bit followup to r6404: fix and simplify the inline assembly, so it
works right when compiled by gcc-4.1.0. Also add a new flag, -A, to
test all available instructions.
Completely overhauled the internals of Memcheck's error handling. All the
different error kinds were reusing the same struct for storing their
details. Each one used some but not all the fields, and the AddrInfo was
similar, and it was very confusing.
So I changed MC_Error and AddrInfo to be tagged unions, like Vex's IRExpr and
IRStmt types. The resulting code is a little more verbose but much easier
to understand. I also split up several error kinds, which also made things
simpler. The user-visible behaviour is identical except for a couple of
very minor things that I've documented in the NEWS file for the 3.3.0
release.
Ideally I'd get rid of the Addr and Char* fields in the core Error type,
which are not always used, and do them similarly within tools. But that
would require changing the core/tool interface, so I'm leaving it for the
moment.
Dirk Mueller [Thu, 7 Dec 2006 15:31:57 +0000 (15:31 +0000)]
rename as _SOURCES is a reserved keywoard and breaks with newer
auto*foo:
Makefile.am:110: variable `VEX_PRIMARY_SOURCES' is defined but no
program or
Makefile.am:110: library has `VEX_PRIMARY' as canonic name (possible
typo)
Julian Seward [Wed, 6 Dec 2006 18:05:54 +0000 (18:05 +0000)]
Fix confusing and contradictory "Rerun with ..." messages printed at
the end of MC_(do_detect_memory_leaks). This causes various leak
regression tests to fail; will fix shortly.
Julian Seward [Wed, 6 Dec 2006 03:35:38 +0000 (03:35 +0000)]
When generating suppressions, remember to Z-demangle function names,
since the suppression-matching machinery does the same. Not doing so
causes auto-generated suppressions involving Z-mangled fn names to not
work.
Julian Seward [Fri, 1 Dec 2006 02:59:17 +0000 (02:59 +0000)]
Change a stupid algorithm that deals with real register live
ranges into a less stupid one. Prior to this change, the complexity
of reg-alloc included an expensive term
O(#instrs in code sequence x #real-register live ranges in code sequence)
This commit changes that term to essentially
O(#instrs in code sequence) + O(time to sort real-reg-L-R array)
On amd64 this nearly halves the cost of register allocation and means
Valgrind performs better in translation-intensive situations (a.k.a
starting programs). Eg, firefox start/exit falls from 119 to 113
seconds. The effect will be larger on ppc32/64 as there are more real
registers and hence real-reg live ranges to consider, and will be
smaller on x86 for the same reason.
The actual code the JIT produces should be unchanged. This commit
merely modifies how the register allocator handles one of its
important data structures.
Julian Seward [Tue, 28 Nov 2006 00:15:35 +0000 (00:15 +0000)]
Make it possible to suppress, and auto-generate suppressions for,
"User" errors; that is, errors resulting from client requests (check
memory range is addressible / defined).
Julian Seward [Fri, 24 Nov 2006 15:18:15 +0000 (15:18 +0000)]
- remove some 'inline' directives so as to make stack backtraces
involving this library easier to make sense of
- try to handle 'long double' better. The problem is that the
library needs to know how many bytes are written when a 'long double'
is stored, which is sometimes not the same as what sizeof(long double)
says.