From: Nicholas Nethercote Date: Thu, 6 Oct 2005 19:30:40 +0000 (+0000) Subject: Clarify FAQ and Java and JITs. X-Git-Tag: svn/VALGRIND_3_1_0~348 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c502dc6b3e414c61e4b10f02cab577a1b8797a8;p=thirdparty%2Fvalgrind.git Clarify FAQ and Java and JITs. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4884 --- diff --git a/docs/xml/FAQ.xml b/docs/xml/FAQ.xml index 56ae36a41f..390085b4e9 100644 --- a/docs/xml/FAQ.xml +++ b/docs/xml/FAQ.xml @@ -183,19 +183,34 @@ - I tried running a Java program under Valgrind but Valgrind aborted. - Does Valgrind handle Java programs, dynamically generated code, etc? + I tried running a Java program (or another program that uses a + just-in-time compiler) under Valgrind but something went wrong. + Does Valgrind handle such programs? - Valgrind handles dynamically generated code without a problem. - In theory, Valgrind can run any Java program just fine, even those that - use JNI and are partially implemented in other languages like C and C++. - In practice, Java implementations tend to do nasty things that most - programs do not, and Valgrind sometimes falls over these corner - cases. - If your Java programs do not run under Valgrind, please file a - bug report and hopefully we'll be able to fix the problem. + Valgrind can handle dynamically generated code, so long as none + of the generated code is later overwritten by other generated code. + If this happens, though, things will go wrong as Valgrind will continue + running its translations of the old code (this is true on x86 and AMD64, + on PPC32 there are explicit cache flush instructions which Valgrind + detects). You should try running with + --smc-check=all in this case; Valgrind + will run much more slowly, but should detect the use of the out-of-date + code. + Alternativaly, if you have the source code to the JIT compiler you + can insert calls to the + VALGRIND_DISCARD_TRANSLATIONS client + request to mark out-of-date code, saving you from using + --smc-check=all. + Apart from this, in theory Valgrind can run any Java program just + fine, even those that use JNI and are partially implemented in other + languages like C and C++. In practice, Java implementations tend to do + nasty things that most programs do not, and Valgrind sometimes falls + over these corner cases. + If your Java programs do not run under Valgrind, even with + --smc-check=all, please file a bug + report and hopefully we'll be able to fix the problem.