Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 90259 invoked from network); 30 Oct 2006 09:10:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2006 09:10:59 -0000 Received: (qmail 87161 invoked by uid 500); 30 Oct 2006 09:11:07 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 87123 invoked by uid 500); 30 Oct 2006 09:11:07 -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 87114 invoked by uid 99); 30 Oct 2006 09:11:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Oct 2006 01:11:06 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of t.p.ellison@gmail.com designates 64.233.182.187 as permitted sender) Received: from [64.233.182.187] (HELO nf-out-0910.google.com) (64.233.182.187) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Oct 2006 01:10:52 -0800 Received: by nf-out-0910.google.com with SMTP id m18so2177879nfc for ; Mon, 30 Oct 2006 01:10:31 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; b=Z4+DH8D17plj7iv8b8LY1ti7hSEf5p+9bct3tTX2CfEMJfdZoptnauNr9J63OueUZirSablWwFRJdNO51f9LAWeyt8KE9mMeBMH4Kuig8b8XZhRO1Rh63L1NYMGd4VUBRnBEySbQ0wATcQcQh/8GnVICkel0mgoI634qwz5/qlo= Received: by 10.48.48.13 with SMTP id v13mr5255156nfv; Mon, 30 Oct 2006 01:10:30 -0800 (PST) Received: from ?9.20.183.69? ( [195.212.29.67]) by mx.google.com with ESMTP id p45sm7454564nfa.2006.10.30.01.10.30; Mon, 30 Oct 2006 01:10:30 -0800 (PST) Message-ID: <4545C1A3.3020705@gmail.com> Date: Mon, 30 Oct 2006 09:10:59 +0000 From: Tim Ellison User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classlib][IBMVME]the return value of java.exe References: <211709bc0610291903i29eb7be2yd91e4a47dcd89933@mail.gmail.com> <4545718E.5080208@gmail.com> In-Reply-To: X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Evgueni Brevnov wrote: > BTW, here is two more interesting cases > > 1) Throw uncaught exception in a new thread. Both RI and DRLVM give 0 > in that case. > 2) Call System.exit(123) in a new thread. Both RI and DRLVM give 123. > > Currently, DRLVM calls system _exit() at the end of System.exit(). > That's why DestroyJavaVM never returns. So the changes I proposed for > the launcher do not help until DRLVM forcibly terminates the process. > :-( > > Does IBMVME uses system calls to stop the proccess? Does DestroyJavaVM > returns? You cannot kill the entire process when destroying the VM. Apps that embed the VM will have a nasty surprise. Regards, Tim > On 10/30/06, Evgueni Brevnov wrote: >> It seems we need to fix the launcher... which is common part for both >> DRLVM and IBVME. I see the problem in the following code sequence... >> >> >> (*jvm)->DetachCurrentThread(jvm); >> (*jvm)->DestroyJavaVM (jvm); >> >> >> The current thread has an uncaught exception raised before it calls >> DetachCurrentThread. This exception is printed out by default uncaught >> exception handler which is called upon thread detaching. So after >> DetachCurrentThread completes we have no exception anymore... Moreover >> we can not play with DetachCurrentThread and DestroyJavaVM return code >> since it should not depend on uncaught exceptions. So I think the fix >> should look like the following: >> >> >> if (env->ExceptionOccured) { >> rc = 1; >> } >> (*jvm)->DetachCurrentThread(jvm); >> (*jvm)->DestroyJavaVM (jvm); >> return rc; >> >> >> If there are no objections I'll come up with the patch soon... >> >> Thanks >> Evgueni >> On 10/30/06, Evgueni Brevnov wrote: >> > I'll try to see how to fix it for DRLVM >> > >> > Evgueni >> > >> > On 10/30/06, Evgueni Brevnov wrote: >> > > hmmm.... I got 0 for DRLVM on Win2003 >> > > >> > > Evgueni >> > > >> > > On 10/30/06, Spark Shen wrote: >> > > > Then we may need to follow RI, since different error code fails >> application >> > > > >> > > > Best regards >> > > > Tony Wu ??: >> > > > > Consider this class, >> > > > > public class TestExeReturn { >> > > > > public static void main(String[] args) throws Exception { >> > > > > throw new Exception(); >> > > > > } >> > > > > } >> > > > > >> > > > > when we run "java TestExeReturn" and "echo %errorlevel%", we >> got 1 of >> > > > > RI, -1 of DRLVM and 0 for IBMVM. >> > > > > >> > > > > a testcase of apache ant failed for this issue. >> > > > > >> > > > >> > > > >> > > > -- >> > > > Spark Shen >> > > > China Software Development Lab, IBM >> > > > >> > > > >> > > >> > >> > -- Tim Ellison (t.p.ellison@gmail.com)