From commits-return-59902-apmail-harmony-commits-archive=harmony.apache.org@harmony.apache.org Wed Aug 19 07:20:20 2009 Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 13419 invoked from network); 19 Aug 2009 07:20:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Aug 2009 07:20:20 -0000 Received: (qmail 35940 invoked by uid 500); 19 Aug 2009 07:20:39 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 35895 invoked by uid 500); 19 Aug 2009 07:20:38 -0000 Mailing-List: contact commits-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 commits@harmony.apache.org Received: (qmail 35886 invoked by uid 99); 19 Aug 2009 07:20:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Aug 2009 07:20:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Aug 2009 07:20:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2E72A234C044 for ; Wed, 19 Aug 2009 00:20:15 -0700 (PDT) Message-ID: <1622340479.1250666415178.JavaMail.jira@brutus> Date: Wed, 19 Aug 2009 00:20:15 -0700 (PDT) From: "Jim Yu (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-6303) [JDWP] Fix a potential crash problem that would happen if String object is GCed In-Reply-To: <1342751358.1250148854917.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-6303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744937#action_12744937 ] Jim Yu commented on HARMONY-6303: --------------------------------- You are right, Mark. I just considered that we were discussing to use Java 6 branch JDWP in Java 5 builds. So I suppose it would become a critical defect for Java 5 as well if we did that. So far, given that we haven't merged Java 6 JDWP to Java 5, it is OK for me to remove the "Fix Version" field. Anyway, thanks for pointing it out. > [JDWP] Fix a potential crash problem that would happen if String object is GCed > ------------------------------------------------------------------------------- > > Key: HARMONY-6303 > URL: https://issues.apache.org/jira/browse/HARMONY-6303 > Project: Harmony > Issue Type: Bug > Components: JDK > Affects Versions: 5.0M10 > Reporter: Jim Yu > Attachments: HARMONY-6303.diff > > > I found there was a potential crash problem in StringReference command set, Value command. In the statement [1] as following shows, if the string object for which we are trying to read its ID has been GCed actually, the string ID we retrieved would be null as a result. Hence if we pass the null value to the follwing jni invocations [2], crash would happen. The solution is that we should return the error code to the upper level when the string object is GCed in this case. > [1] jstring stringObject = m_cmdParser->command.ReadStringID(jni); > [2] jsize len = jni->GetStringLength(stringObject); > jsize utfLen = jni->GetStringUTFLength(stringObject); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.