harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vera Petrashkova (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4315) [buildtest][vts] Test vm/jvmti/funcs/GetClassSignature/GetClassSignature0102/GetClassSignature0102.xml crashes when it tries to print wrong data
Date Tue, 03 Jul 2007 07:21:04 GMT
[buildtest][vts] Test vm/jvmti/funcs/GetClassSignature/GetClassSignature0102/GetClassSignature0102.xml
crashes when it tries to print wrong data
------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4315
                 URL: https://issues.apache.org/jira/browse/HARMONY-4315
             Project: Harmony
          Issue Type: Bug
          Components: build - test - ci
            Reporter: Vera Petrashkova
         Attachments: GetClassSignature.patch

Test vm/jvmti/funcs/GetClassSignature/GetClassSignature0102/GetClassSignature0102.xml
checks that  method 
GetClassSignature(jvmtiEnv* env, jclass klass, char** signature_ptr, char**
generic_ptr)

returns JVMTI_ERROR_INVALID_CLASS when klass is not a class object or the class 
has been unloaded.

It invokes method with jthread object and expects that VM returns error code.

But then this test tries to output information about "signature of used wrong 
class".
See GetClassSignature0102.cpp source code:
----------------------
void JNICALL callbackException(prms_EXCPT)
{
    check_EXCPT;

    if (flag) return;

    jvmtiError result;
    jclass myclass = NULL;
    char* signature;
    char* generic;

    /*
     * Function separate all other exceptions in all other method
     */
    if (!check_phase_and_method_debug(jvmti_env, method, SPP_LIVE_ONLY,
                "special_method", DEBUG_OUT)) return;

    result = jvmti_env->GetMethodDeclaringClass(method, &myclass);
    if (DEBUG_OUT)
    {
        fprintf(stderr, "\tnative: GetMethodDeclaringClass result = %d (must be zero) \n",
result);
        fprintf(stderr, "\tnative: method is %p \n", method);
        fprintf(stderr, "\tnative: myclass is %p \n", myclass);
    }
    if (result != JVMTI_ERROR_NONE) return;

    flag = true;
    util = true;

    result = jvmti_env->GetClassSignature((jclass)thread, &signature, &generic);
    fprintf(stderr, "\tnative: GetClassSignature result = %d (must be JVMTI_ERROR_INVALID_CLASS
(21)) \n", result);
    fprintf(stderr, "\tnative: classes ptr is %p \n", myclass); <<<<<<<<<<<<
    fprintf(stderr, "\tnative: signature is %s \n", signature); <<<<<<<<<<<<
    fprintf(stderr, "\tnative: generic is %s \n", generic);     <<<<<<<<<<<
    fflush(stderr);

    if (result != JVMTI_ERROR_INVALID_CLASS) return;
    test = true;
}
-----------------------

VM returns correct error code but then it crashes on reporting wrong datas.
As the result this test fails even if it actually passes.
These useless reports should be removed.


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


Mime
View raw message