Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 25805 invoked from network); 13 Oct 2006 06:26:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Oct 2006 06:26:27 -0000 Received: (qmail 96504 invoked by uid 500); 13 Oct 2006 06:26:24 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 96470 invoked by uid 500); 13 Oct 2006 06:26:24 -0000 Mailing-List: contact harmony-commits-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-commits@incubator.apache.org Received: (qmail 96430 invoked by uid 99); 13 Oct 2006 06:26:24 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 23:26:24 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 23:26:23 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 680B07142E4 for ; Thu, 12 Oct 2006 23:25:39 -0700 (PDT) Message-ID: <17626751.1160720739423.JavaMail.jira@brutus> Date: Thu, 12 Oct 2006 23:25:39 -0700 (PDT) From: "Alexey Varlamov (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-1720) Classlib test org.apache.harmony.luni.tests.java.lang.ThreadTest.test_stop_subtest0 fails In-Reply-To: <14124923.1160045299587.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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 [ http://issues.apache.org/jira/browse/HARMONY-1720?page=comments#action_12441937 ] Alexey Varlamov commented on HARMONY-1720: ------------------------------------------ Hmm, reading javadoc for Thread.stop(Throwable): "If there is a security manager installed, the checkAccess method of this thread is called, which may result in a SecurityException being raised (in the current thread). If this thread is different from the current thread (that is, the current thread is trying to stop a thread other than itself) or obj is not an instance of ThreadDeath, the security manager's checkPermission method (with the RuntimePermission("stopThread") argument) is called in addition. Again, this may result in throwing a SecurityException (in the current thread). If the argument obj is null, a NullPointerException is thrown (in the current thread). " Current impl of DRLVM does not follow this description. Note, checkPermission() for "stopThread" is called only for non-ThreadDeath throwables; and the documentation for stop() requires throwing exactly ThreadDeath instance. So there is inconsistency either in documentation or in impl of the overloaded stop() methods. I may guess stop() is equvalent of stop(new ThreadDeath()) and this is a hole in the javadoc. PS. I suspect order of exceptions currently is incompatible in DRLVM: NPE should be thrown last, not first. > Classlib test org.apache.harmony.luni.tests.java.lang.ThreadTest.test_stop_subtest0 fails > ----------------------------------------------------------------------------------------- > > Key: HARMONY-1720 > URL: http://issues.apache.org/jira/browse/HARMONY-1720 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Reporter: Elena Semukhina > Priority: Critical > Attachments: Harmony-1720_Thread.patch > > > The test fails with the following assertion: > test_stop_subtest0(org.apache.harmony.luni.tests.java.lang.ThreadTest)junit.fework.AssertionFailedError: checkAccess called > The test does not expect that security manager's checkAccess() method is called when stopping a new thread which is not running yet. > I think it is a compatibility issue. > The spec for Thread.stop() says: > If there is a security manager installed, its checkAccess method is called with this as its argument. > RI does not call this method for a thread which does not run, and this seems reasonable. > I suggest that drlvm would do the same. > NOTE: to reproduce the bug you should comment out ThreadTest.test_suspend() which hangs now. This issue is expected to be fixed with H-1519. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira