Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 31425 invoked from network); 15 Oct 2007 02:17:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Oct 2007 02:17:36 -0000 Received: (qmail 84616 invoked by uid 500); 15 Oct 2007 02:17:23 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 84591 invoked by uid 500); 15 Oct 2007 02:17:23 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 84581 invoked by uid 99); 15 Oct 2007 02:17:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Oct 2007 19:17:23 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sean.xx.qiu@gmail.com designates 64.233.166.178 as permitted sender) Received: from [64.233.166.178] (HELO py-out-1112.google.com) (64.233.166.178) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Oct 2007 02:17:26 +0000 Received: by py-out-1112.google.com with SMTP id u77so2834993pyb for ; Sun, 14 Oct 2007 19:17:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=FOW8cx59D3n7oj4woubF+Er0TWJwVFVp7aQEJ1uwWIA=; b=Rf8W3Az6MRNhAzaiFcT8CSDg3ZwayvmVWn48AcV0RVH1ydj7oI0wDg1TN3OCIt8Lu9Ju1ZgjR+TRfhCW60kwxa7O/RFCvDQAP0mEm/cSgWW7Nh/nEUw9/vq/eXghyymviwbVNTscAbd5gmmupw73Mc/+qI7kD/Nng1tdzofdTMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=SydMwNCJkr+pPYgVJvgicWyFCfDp7Fs5ZGBIglUEjKu4HdKW+Gs17SkyOYfuumiak9ZNv3xoS599hwC2JoGtSPhNqVC0zyrSLSlh5eZ0/HDAItzw+Md2guMxENzAH2+AEfCMqjY95rZh96lC62iFqoFSLpsukz2M0l2q4OvyvMg= Received: by 10.35.33.15 with SMTP id l15mr7042602pyj.1192414624593; Sun, 14 Oct 2007 19:17:04 -0700 (PDT) Received: by 10.35.86.1 with HTTP; Sun, 14 Oct 2007 19:17:04 -0700 (PDT) Message-ID: <94d710af0710141917l4702a65clc0e1f07dce0af8df@mail.gmail.com> Date: Mon, 15 Oct 2007 10:17:04 +0800 From: "Sean Qiu" To: dev@harmony.apache.org Subject: Re: [launcher] Uncaught exceptions not printed on J9 VME In-Reply-To: <47124A6D.5090106@apache.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_28660_27605006.1192414624587" References: <470F9FFB.4050109@googlemail.com> <47124A6D.5090106@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_28660_27605006.1192414624587 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline This would be really helpful. 2007/10/15, Gregory Shimansky : > > Oliver Deakin wrote: > > Hi all, > > > > A little while back there was a thread called "[drlvm] Should the > > launcher print uncaught exceptions?" [1] where we discussed the fact > > that running a test case like [2] did not print a stack trace with the > > Harmony launcher. As part of this discussion, HARMONY-1819 was raised > > and the line "(*jvm)->DetachCurrentThread(jvm)" was added to the > > launcher main.c in repo revision r464443. > > > > HARMONY-3713 was later raised pointing out that calling > > DetachCurrentThread() to detach the main thread was contrary to the spec > > [3], and the line was removed from main.c. However, I have just noticed > > that if you run [2] on the current J9 VME (and, in fact, on the RI with > > a simple launcher) you do not get any stack trace printed, and I imagine > > this has been the case since the commit of HARMONY-3713. > > > > The RI has a bug [4], contrary to the spec [3], which requires > > DetachCurrentThread() to be called by the invoking launcher if you wish > > to see the stack trace of an uncaught exception. It appears that J9 has > > matched this bug, probably so no unexpected trace is printed in > > launchers programmed against the RI. > > > > So currently running Harmony classlib with the J9 VME will not result in > > any stack trace being printed for uncaught exceptions, which makes > > debugging issues where that occurs more troublesome. Id like to propose > > that the DetachCurrentThread() line be readded to main.c (i.e. the > > opposite of the patch for HARMONY-3713), perhaps with a comment to show > > that this is to match the behaviour of the RI rather than the spec. > > > > Any objections? > > I wonder if simply adding > > if ((*env)->ExceptionCheck(env)) > (*env)->ExceptionDescribe(env); > > is enough to print out stack trace in the main thread without violating > the spec. > > > -- > Gregory > > -- Sean Qiu China Software Development Lab, IBM ------=_Part_28660_27605006.1192414624587--