You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Leo Li (JIRA)" <ji...@apache.org> on 2007/01/16 08:11:27 UTC
[jira] Created: (HARMONY-3008) [classlib][instrument]Releases byte
array too early in the native code of redefine classes.
[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
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
[jira] Updated: (HARMONY-3008) [classlib][instrument]Releases byte
array too early in the native code of redefine classes.
Posted by "Leo Li (JIRA)" <ji...@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
[jira] Updated: (HARMONY-3008) [classlib][instrument]Releases byte
array too early in the native code of redefine classes.
Posted by "Leo Li (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leo Li updated HARMONY-3008:
----------------------------
Patch Info: [Patch Available]
Will somebody try the patch?
> [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
[jira] Closed: (HARMONY-3008) [classlib][instrument]Releases byte
array too early in the native code of redefine classes.
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison closed HARMONY-3008.
--------------------------------
Verified by Leo.
> [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
> Components: Classlib
> Reporter: Leo Li
> Assigned To: Tim Ellison
> 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.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HARMONY-3008) [classlib][instrument]Releases byte
array too early in the native code of redefine classes.
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison resolved HARMONY-3008.
----------------------------------
Resolution: Fixed
Thanks Leo,
Patch applied to INSTRUMENT module at repo revision r501090.
Please check that it was applied as you expected.
> [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
> Components: Classlib
> Reporter: Leo Li
> Assigned To: Tim Ellison
> 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.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-3008) [classlib][instrument]Releases byte
array too early in the native code of redefine classes.
Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Varlamov updated HARMONY-3008:
-------------------------------------
Component/s: Classlib
> [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
> Components: Classlib
> 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
[jira] Assigned: (HARMONY-3008) [classlib][instrument]Releases byte
array too early in the native code of redefine classes.
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison reassigned HARMONY-3008:
------------------------------------
Assignee: Tim Ellison
> [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
> Components: Classlib
> Reporter: Leo Li
> Assigned To: Tim Ellison
> 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.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-3008) [classlib][instrument]Releases
byte array too early in the native code of redefine classes.
Posted by "Leo Li (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468898 ]
Leo Li commented on HARMONY-3008:
---------------------------------
Hi, Tim:
Verified. Thank you.
Leo.
> [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
> Components: Classlib
> Reporter: Leo Li
> Assigned To: Tim Ellison
> 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.
-
You can reply to this email to add a comment to the issue online.