Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 69038 invoked from network); 16 Jan 2007 08:24:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jan 2007 08:24:48 -0000 Received: (qmail 88181 invoked by uid 500); 16 Jan 2007 08:24:54 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 88163 invoked by uid 500); 16 Jan 2007 08:24:54 -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 88154 invoked by uid 99); 16 Jan 2007 08:24:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jan 2007 00:24:54 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jan 2007 00:24:47 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 864D27141A3 for ; Tue, 16 Jan 2007 00:24:27 -0800 (PST) Message-ID: <30172427.1168935867520.JavaMail.jira@brutus> Date: Tue, 16 Jan 2007 00:24:27 -0800 (PST) From: "Leo Li (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-3008) [classlib][instrument]Releases byte array too early in the native code of redefine classes. In-Reply-To: <30169940.1168931487496.JavaMail.jira@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 [ https://issues.apache.org/jira/browse/HARMONY-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Leo Li updated HARMONY-3008: ---------------------------- Attachment: patch-3008.diff > [classlib][instrument]Releases byte array too early in the native code of redefine classes. > ------------------------------------------------------------------------------------------- > > Key: HARMONY-3008 > URL: https://issues.apache.org/jira/browse/HARMONY-3008 > Project: Harmony > Issue Type: Bug > Reporter: Leo Li > Attachments: patch-3008.diff > > > In instrument.c, Java_org_apache_harmony_instrument_internal_InstrumentationImpl_redefineClasses_1native, we have: > Line 237: > class_bytes = (*env)->GetByteArrayElements(env, jclass_bytes, ©); > if(NULL == class_bytes){ > hymem_free_memory(class_definitions); > return; > } > class_byte_count = (*env)->GetArrayLength(env, jclass_bytes); > if(copy == JNI_TRUE){ > (*env)->ReleaseByteArrayElements(env,jclass_bytes, class_bytes, JNI_ABORT); > } > > //construct a jvmtiClassDefinition element > class_definitions[index].klass=klass; > class_definitions[index].class_bytes=class_bytes; > class_definitions[index].class_byte_count=class_byte_count; > } > //perform redefinition > err=(*jvmti)->RedefineClasses(jvmti, length, class_definitions); > the class_bytes are freed before RedefineClasses of JVM_TI uses them. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira