harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov" <alexey.v.varla...@gmail.com>
Subject Re: svn commit: r570409 - in /harmony/enhanced/drlvm/trunk/src/test/regression/H4511: ./ GCTagged.cpp GCTagged.java run.test.xml
Date Wed, 29 Aug 2007 04:48:17 GMT
Hi Xiao-Feng,

This test fails on all platforms but Win32, could you please fix or exclude it:

Win64:
    [java]     [junit] Running
org.apache.harmony.drlvm.tests.regression.h4511.GCTagged
     [java]     [junit] Windows reported exception: 0xc0000005
     [java]     [junit] Registers:
     [java]     [junit]     RAX: 0x00000000000000c0, RBX: 0x0000000000130000
     [java]     [junit]     RCX: 0x00000000000000c0, RDX: 0x0000000002f9db00
     [java]     [junit]     RSI: 0x00000000004075da, RDI: 0x000000000012b800
     [java]     [junit]     RSP: 0x000000000012b7e0, RBP: 0x000000000012bbc8
     [java]     [junit]     R8 : 0x0000000002ed66d0, R9 : 0x000000000516ba50
     [java]     [junit]     R10: 0x0000000100000001, R11: 0xffffffff0000ffff
     [java]     [junit]     R12: 0x0000000000000000, R13: 0x0000000000000000
     [java]     [junit]     R14: 0x0000000000000000, R15: 0x0000000000000000
     [java]     [junit]     RIP: 0x0000000000737e38
     [java]     [junit] Stack trace:
     [java]     [junit]   0: ManagedObject::vt (??:-1)
     [java]     [junit]   1: ?? (??:-1)
     [java]     [junit]   2:
org/apache/harmony/nio/FileChannelFactory.getFileChannel(Ljava/lang/Object;JI)Ljava/nio/channels/FileChannel;
(FileChannelFactory.java:38)
     [java]     [junit]   3:
java/io/FileOutputStream.(Ljava/io/FileDescriptor;)V
(FileOutputStream.java:126)
     [java]     [junit]   4:
java/lang/System.createErr()Ljava/io/PrintStream; (System.java:347)
     [java]     [junit]   5: java/lang/System.()V (System.java:59)
     [java]     [junit]   6: ?? (??:-1)
     [java]     [junit]   7: java/lang/ThreadGroup.checkAccess()V
(ThreadGroup.java:180)
     [java]     [junit]   8:
java/lang/ThreadGroup.(Ljava/lang/ThreadGroup;Ljava/lang/String;)V
(ThreadGroup.java:103)
     [java]     [junit]   9:
java/lang/Thread.(Ljava/lang/ThreadGroup;Ljava/lang/String;JJIZ)V
(Thread.java:226)
     [java]     [junit]
     [java]     [junit] Test
org.apache.harmony.drlvm.tests.regression.h4511.GCTagged FAILED

Linux32:
    [java]        [cc]
/export/users/cc/cc-common/build/checkouts/hdk/working_vm/src/test/regression/H4511/GCTagged.cpp:10:
error: integer constant is too large for "long" type

Linux64:
 SIGABRT in VM code.
     [java]     [junit] Stack trace:
     [java]     [junit]   0: raise (??:-1)
     [java]     [junit]   1: abort (??:-1)
     [java]     [junit]   2: ?? (??:-1)
     [java]     [junit]   3: new_do_write (??:-1)
     [java]     [junit]   4: _IO_file_xsputn@@GLIBC_2.2.5 (??:-1)
     [java]     [junit]   5: ?? (??:-1)
     [java]     [junit]   6: ?? (??:-1)
     [java]     [junit]   7: ?? (??:-1)
     [java]     [junit]   8: ?? (??:-1)
     [java]     [junit]   9: ?? (??:-1)
     [java]     [junit]  10: __assert_fail (??:-1)
     [java]     [junit]  11: ?? (??:-1)
     [java]     [junit]  12: ?? (??:-1)
     [java]     [junit]  13: _start (../sysdeps/x86_64/elf/start.S:65)
     [java]     [junit]  14: throw_from_sigcontext
(/export/users/cc/cc-common/build/checkouts/hdk/working_vm/vm/vmcore/src/util/linux/signals_em64t.cpp:166)
     [java]     [junit]  15: ?? (??:-1)
     [java]     [junit]  16:
org/apache/harmony/nio/FileChannelFactory.getFileChannel(Ljava/lang/Object;JI)Ljava/nio/channels/FileChannel;
(FileChannelFactory.java:38)
     [java]     [junit]  17:
java/io/FileOutputStream.(Ljava/io/FileDescriptor;)V
(FileOutputStream.java:126)
     [java]     [junit]  18:
java/lang/System.createErr()Ljava/io/PrintStream; (System.java:347)
     [java]     [junit]  19: java/lang/System.()V (System.java:59)
     [java]     [junit]  20: ?? (??:-1)
     [java]     [junit]  21: java/lang/ThreadGroup.checkAccess()V
(ThreadGroup.java:180)
     [java]     [junit]  22:
java/lang/ThreadGroup.(Ljava/lang/ThreadGroup;Ljava/lang/String;)V
(ThreadGroup.java:103)
     [java]     [junit]  23:
java/lang/Thread.(Ljava/lang/ThreadGroup;Ljava/lang/String;JJIZ)V
(Thread.java:226)

2007/8/28, xli@apache.org <xli@apache.org>:
> Author: xli
> Date: Tue Aug 28 06:10:44 2007
> New Revision: 570409
>
> URL: http://svn.apache.org/viewvc?rev=570409&view=rev
> Log:
> Harmony-4511: test case for tagged object reclamation
>
> Added:
>    harmony/enhanced/drlvm/trunk/src/test/regression/H4511/
>    harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.cpp   (with props)
>    harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.java   (with props)
>    harmony/enhanced/drlvm/trunk/src/test/regression/H4511/run.test.xml   (with props)
>
> Added: harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.cpp
> URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.cpp?rev=570409&view=auto
> ==============================================================================
> --- harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.cpp (added)
> +++ harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.cpp Tue Aug 28 06:10:44
2007
> @@ -0,0 +1,142 @@
> +#include <iostream>
> +#include <jvmti.h>
> +
> +using namespace std;
> +
> +#define PACKAGE "org/apache/harmony/drlvm/tests/regression/h4511/"
> +
> +static const char* EXCEPTION_CLASS = "L" PACKAGE "InvokeAgentException;";
> +
> +static const jlong TAG_VALUE = 0xfedcba9876543210;
> +
> +#define TURN_EVENT(event, state) { \
> +    jvmtiError err = turn_event(jvmti, event, state, #event); \
> +    if (JVMTI_ERROR_NONE != err) return; \
> +}
> +
> +#define CHECK_RESULT(func) \
> +    if (JVMTI_ERROR_NONE != err) { \
> +        cerr << "[JvmtiAgent] ERROR: " << #func << " failed with error:
" << err << endl;  \
> +        return; \
> +    }
> +
> +#define CHECK_JNI3(result, func, error_code) { \
> +    if (jni->ExceptionCheck()) { \
> +        cerr << "[JvmtiAgent] ERROR: unexpected exception in " << #func
<< endl;  \
> +        jni->ExceptionDescribe(); \
> +        return error_code; \
> +    } \
> +    if (! (result)) { \
> +        cerr << "[JvmtiAgent] ERROR: get NULL in " << #func << endl;
 \
> +        return error_code; \
> +    } \
> +}
> +
> +#define CHECK_JNI(result, func) CHECK_JNI3(result, func, )
> +
> +static jvmtiError turn_event(jvmtiEnv* jvmti, jvmtiEvent event, bool state,
> +        const char* event_name)
> +{
> +    jvmtiError err;
> +    err = jvmti->SetEventNotificationMode(state ? JVMTI_ENABLE : JVMTI_DISABLE,
> +            event, NULL);
> +    if (JVMTI_ERROR_NONE != err) {
> +        cerr << "[JvmtiAgent] ERROR: unable to " << (state ? "en" : "dis")
> +                << "able " << event_name
> +                << endl;
> +    }
> +
> +    return err;
> +}
> +
> +static void JNICALL VMInit(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread)
> +{
> +    cerr << endl << "==> VM Init callback" << endl;
> +
> +    TURN_EVENT(JVMTI_EVENT_EXCEPTION, true);
> +}
> +
> +static void JNICALL
> +Exception(jvmtiEnv *jvmti,
> +            JNIEnv* jni,
> +            jthread thread,
> +            jmethodID method,
> +            jlocation location,
> +            jobject exception,
> +            jmethodID catch_method,
> +            jlocation catch_location)
> +{
> +    jvmtiError err;
> +
> +    jclass exn_class = jni->GetObjectClass(exception);
> +    CHECK_JNI(exn_class, GetObjectClass);
> +
> +    char* class_name = NULL;
> +    err = jvmti->GetClassSignature(exn_class, &class_name, NULL);
> +    CHECK_RESULT(GetClassSignature);
> +
> +    if (0 != strcmp(EXCEPTION_CLASS, class_name))
> +        return;
> +
> +//    cerr << "==> Exception callback" << endl;
> +//    cerr << "    for class: " << class_name << endl;
> +
> +    jfieldID object_field = jni->GetFieldID(exn_class, "object",
> +            "Ljava/lang/Object;");
> +    CHECK_JNI(object_field, GetFieldID);
> +
> +    jobject object = jni->GetObjectField(exception, object_field);
> +    CHECK_JNI(object, GetObjectField);
> +
> +    err = jvmti->SetTag(object, TAG_VALUE);
> +    CHECK_RESULT(SetTag);
> +}
> +
> +JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *vm, char *options, void *reserved)
> +{
> +    jvmtiEnv *jvmti = NULL;
> +    jvmtiError err;
> +
> +    // Get JVMTI interface pointer
> +    jint iRes = vm->GetEnv((void**)&jvmti, JVMTI_VERSION);
> +    if (JNI_OK != iRes) {
> +        cerr << "[JvmtiAgent] ERROR: unable to get JVMTI environment" <<
endl;
> +        return -1;
> +    }
> +
> +    // Set events callbacks
> +    jvmtiEventCallbacks callbacks;
> +    memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
> +
> +    callbacks.VMInit = VMInit;
> +    callbacks.Exception = Exception;
> +
> +    err = jvmti->SetEventCallbacks(&callbacks, sizeof(jvmtiEventCallbacks));
> +    if (JVMTI_ERROR_NONE != err) {
> +        cerr << "[JvmtiAgent] ERROR: unable to register event callbacks" <<
endl;
> +        return -1;
> +    }
> +
> +    err = jvmti->SetEventNotificationMode(JVMTI_ENABLE,
> +            JVMTI_EVENT_VM_INIT, NULL);
> +    if (JVMTI_ERROR_NONE != err) {
> +        cerr << "[JvmtiAgent] ERROR: unable to enable VMInit event"
> +                << endl;
> +        return -1;
> +    }
> +
> +    // Set capabilities
> +    jvmtiCapabilities capabilities;
> +    memset(&capabilities, 0, sizeof(jvmtiCapabilities));
> +    capabilities.can_generate_exception_events = 1;
> +    capabilities.can_tag_objects = 1;
> +
> +    err = jvmti->AddCapabilities(&capabilities);
> +    if (JVMTI_ERROR_NONE != err) {
> +        cerr << "[JvmtiAgent] ERROR: unable to possess capabilities" <<
endl;
> +        return -1;
> +    }
> +
> +    // Agent initialized successfully
> +    return 0;
> +}
>
> Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.cpp
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Added: harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.java
> URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.java?rev=570409&view=auto
> ==============================================================================
> --- harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.java (added)
> +++ harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.java Tue Aug 28 06:10:44
2007
> @@ -0,0 +1,60 @@
> +package org.apache.harmony.drlvm.tests.regression.h4511;
> +
> +import junit.framework.TestCase;
> +
> +/**
> + * Test case for garbage collectin of tagged objects.
> + */
> +public class GCTagged extends TestCase {
> +
> +    static final int OBJECT_NUMBER = 1000;
> +    static final int OBJECT_SIZE = 1024 * 1024;
> +
> +    public static void main(String args[]) {
> +        (new GCTagged()).test();
> +    }
> +
> +    public void test() {
> +
> +        System.out.println("Allocating " + OBJECT_NUMBER +
> +                " byte arrays of size " + OBJECT_SIZE);
> +        int a = 0;
> +        int i = 0;
> +        OutOfMemoryError exception = null;
> +
> +        try {
> +            for (; i < OBJECT_NUMBER; i++) {
> +
> +                Object obj = new byte[OBJECT_SIZE];
> +                try {
> +                    // notify agent to set the tag
> +                    throw new InvokeAgentException(obj);
> +                } catch (InvokeAgentException exc) {
> +                    // useless code just to prevent optimizing jit from
> +                    // eliminating emty catch block
> +                    a += obj.hashCode();
> +                }
> +            }
> +
> +            System.out.println("done.");
> +        } catch (OutOfMemoryError exc) {
> +            exception = exc;
> +
> +            System.out.println("Caught " + exc);
> +            System.out.println("    at iteration " + i);
> +            System.out.println("    approx alocated size (bytes) " +
> +                    i * OBJECT_SIZE);
> +        }
> +
> +        assertTrue(null == exception);
> +    }
> +}
> +
> +class InvokeAgentException extends Exception {
> +
> +    Object object;
> +
> +    InvokeAgentException(Object obj) {
> +        this.object = obj;
> +    }
> +}
>
> Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H4511/GCTagged.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Added: harmony/enhanced/drlvm/trunk/src/test/regression/H4511/run.test.xml
> URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H4511/run.test.xml?rev=570409&view=auto
> ==============================================================================
> --- harmony/enhanced/drlvm/trunk/src/test/regression/H4511/run.test.xml (added)
> +++ harmony/enhanced/drlvm/trunk/src/test/regression/H4511/run.test.xml Tue Aug 28 06:10:44
2007
> @@ -0,0 +1,9 @@
> +<project name="RUN HARMONY-4511 Regression Test">
> +    <target name="run-test">
> +        <!-- use special launcher for JVMTI tests -->
> +        <run-jvmti-test
> +            test="org.apache.harmony.drlvm.tests.regression.h4511.GCTagged"
> +            agent="GCTagged"/>
> +    </target>
> +</project>
> +
>
> Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H4511/run.test.xml
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
>
>

Mime
View raw message