Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 52104 invoked from network); 5 Apr 2006 15:52:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Apr 2006 15:52:47 -0000 Received: (qmail 71357 invoked by uid 500); 5 Apr 2006 15:52:41 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 71313 invoked by uid 500); 5 Apr 2006 15:52:41 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 71302 invoked by uid 99); 5 Apr 2006 15:52:41 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Apr 2006 08:52:41 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=RCVD_IN_SORBS_WEB,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 217.158.94.220 is neither permitted nor denied by domain of t.p.ellison@gmail.com) Received: from [217.158.94.220] (HELO cirrus.purplecloud.com) (217.158.94.220) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Apr 2006 08:52:38 -0700 Received: (qmail 5962 invoked from network); 5 Apr 2006 16:52:16 +0100 Received: from blueice1n1.uk.ibm.com (HELO ?9.20.183.160?) (195.212.29.67) by smtp.purplecloud.net with (DHE-RSA-AES256-SHA encrypted) SMTP; 5 Apr 2006 16:52:16 +0100 Message-ID: <4433E7AF.7010106@gmail.com> Date: Wed, 05 Apr 2006 16:52:15 +0100 From: Tim Ellison User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [vmi] JNI spec interpretation? References: <4432C57D.6070304@sablevm.org> <4432FA23.6080108@dellroad.org> <443385B0.8090506@gmail.com> <4433ADEE.5050700@sablevm.org> <4433D0FE.8020905@gmail.com> <4433D29F.1020400@dellroad.org> <4433D8A3.3070005@dellroad.org> In-Reply-To: <4433D8A3.3070005@dellroad.org> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Archie Cobbs wrote: > Robert Lougher wrote: >> It's all very well bombing out with an assertion failure, but to the >> average end-user it's still the VMs fault, especially if it works with >> other runtimes (i.e. Suns). > > Sure.. sometimes theory gets trumped by practice. Then you have to decide > which is less work: convincing 3rd parties to fix their code or > implementing > a hack/workaround. > > If there is lots of JNI code out there doing this, then you're certainly > right that the workaround (which costs essentially nothing) would be > easier. The IBM VME comes with a check utility that complains about bad practices detected in JNI code: Usage: -Xcheck:jni:[option[,option[,...]]] all check application and system classes verbose trace certain JNI functions and activities trace trace all JNI functions nobounds don't perform bounds checking on strings and arrays nonfatal don't exit when errors are detected nowarn don't display warnings noadvice don't display advice novalist don't check for va_list reuse pedantic perform more thorough, but slower checks help print this screen Don't run it on the Harmony class libraries unless you have a strong stomach ;-) Actually, there is lots of repetition in the warnings/errors so we should go ahead and fix those that we can (an easy contribution opportunity!), for example: JNI warning in NewObject/NewObjectV: Argument #2 is a weak reference. A weak reference may become NULL at any time. The reference should be promoted using NewLocalRef or NewGlobalRef and then compared to NULL before calling NewObject/NewObjectV Warning detected in java/util/zip/ZipFile.getEntryImpl(JLjava/lang/String;)Ljava/util/zip/ZipEntry; Here's an example from code in one of our dependencies: JNI error in GetStringChars: This function cannot be called inside of a critical section Error detected in com/ibm/icu4jni/converters/NativeConverter.openConverter([JLjava/lang/String;)I I expect we need ICU4JNI to fix that themselves. Regards, Tim -- Tim Ellison (t.p.ellison@gmail.com) IBM Java technology centre, UK. --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org