harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Popov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3309) [jdktools][jpda] JDWP tests for enabling object collection fails with collecting objects
Date Mon, 02 Jul 2007 15:18:04 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509593

Ivan Popov commented on HARMONY-3309:

It seems the problem is not in DRLVM, but in implementation of JDWP agent. All JDWP commands
are executed in the agent thread which never exits from native code. During execution of JDWP
commands agent accesses java objects via JNI and JVMTI interface. For each of such objects
local JNI references are created and never deleted automatically. This prevents accessed objects
from garbage collecting.

To resolve this problem one has to review implementation of each JDWP command and explicitly
call JNI function DeleteLocalRef() for each accessed object after the command is executed
and all output data are stored in reply packet. For example, fixing this problem for ReferenceType.GetValues
command makes mentioned above tests to pass against DRLVM.

> [jdktools][jpda] JDWP tests for enabling object collection fails with collecting objects
> ----------------------------------------------------------------------------------------
>                 Key: HARMONY-3309
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3309
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/ia32, Linux/ia32, Harmony-jdk-r514598
>            Reporter: Ivan Popov
>            Priority: Minor
> The following JDWP unit tests
>   org.apache.harmony.jpda.tests.jdwp.ObjectReference.EnableCollectionTest
>   org.apache.harmony.jpda.tests.jdwp.MultiSession.EnableCollectionTest
> fail because unreferenced objects are not collected in debuggee VM.
> The problem is that JNI Weak Global References used in JDWP agent are not fully supported
> However, this does not break usual debugger functionality, so I'm marking this issue
as minor.
> Typical diagnostics for this failure is the following:
> ## FAILURE: Checked Object is NOT UNLOADed after ObjectReference::EnableCollection command
> <...>
> junit.framework.AssertionFailedError: Checked Object is NOT UNLOADed after ObjectReference::EnableCollection
> at org.apache.harmony.jpda.tests.jdwp.ObjectReference.EnableCollectionTest.testEnableCollection001(EnableCollectionTest.java:141)

> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> or
> ## FAILURE: Checked Object is NOT UNLOADed after MultiSession::EnableCollection command
> <...>
> junit.framework.AssertionFailedError: Invalid message from debuggee. 
> at org.apache.harmony.jpda.tests.jdwp.MultiSession.EnableCollectionTest.testEnableCollection001(EnableCollectionTest.java:137)

> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> To reproduce this failure:
> 1. create Harmony JDK with federated build:
>     svn checkout https://svn.apache.org/repos/asf/harmony/enhanced/trunk
>     cd trunk
>     ant
> 2. goto jdktools directory, add junit to classpath, and run particular test:
>     cd working_jdktools
>     export CLASSPATH=<...>/trunk/common_resources/depends/jars/junit_3.8.2/junit.jar
>     ant test -Dbuild.module=jpda -Dtest.case=org.apache.harmony.jpda.tests.jdwp.ObjectReference.EnableCollectionTest
> 3. see results in <...>/trunk/working_jdktools/build/test_report/html/index.html
> It is possible also to run test directly from command line:
>    cd working_jdktools
>    deploy/jdk/bin/java -classpath ../common_resources/depends/jars/junit_3.8.2/junit.jar:build/tests/classes
>    org.apache.harmony.jpda.tests.jdwp.ObjectReference.EnableCollectionTest 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message