You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Gregory Shimansky (JIRA)" <ji...@apache.org> on 2007/05/16 21:10:17 UTC

[jira] Resolved: (HARMONY-3799) [drlvm][jvmti] compatibility: GetVersionNumber returns the value with zero micro version

     [ https://issues.apache.org/jira/browse/HARMONY-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky resolved HARMONY-3799.
----------------------------------------

    Resolution: Fixed

Patch applied at 538681. Please check that JVMTI now reports correct micro version.

> [drlvm][jvmti] compatibility: GetVersionNumber returns the value with zero micro version
> ----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3799
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3799
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vera Petrashkova
>         Assigned To: Gregory Shimansky
>            Priority: Minor
>         Attachments: GVN.zip, H3799.patch
>
>
> According to JVMTI  specifications 
> GetVersionNumber  returns value which is the version identifier. 
> The version identifier includes major, minor and micro version as well as the interface type.
> DRLVM returns version identifier which contains zero micro version while
> RI returns version number which parts equal: 
>         major = 1, minor = 0 and micro = 36
> It looks like DRLVM returns version number which equals to JVMTI_VERSION_1_0.
>  
> To reproduce this run the following test:
> ---------------GVN.java-------------
> public class GVN {
>     static public void main(String args[]) {
>         return;
>     }
> }
> ------------------------------GVN.cpp------------------------------
> #include <stdio.h>
> #include "jvmti.h"
> static jvmtiEnv *jvmti = NULL;
> JNIEXPORT jint 
> JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
>      jvmtiError err;
>      jint res;
>      jint ver_ptr;
>      jint micro_rt;
>      jint minor_rt;
> 	 jint major_rt;
>      res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_0);
>      if (res != JNI_OK || jvmti == NULL) {
>          return JNI_ERR;
>      }
>     err = jvmti->GetVersionNumber(&ver_ptr);
> 	fprintf(stderr,"Version number: %x JVMTI_VERSION_1_0: %x \n", ver_ptr, JVMTI_VERSION_1_0);
>     major_rt = (ver_ptr & JVMTI_VERSION_MASK_MAJOR) >> JVMTI_VERSION_SHIFT_MAJOR;
> 	minor_rt = (ver_ptr & JVMTI_VERSION_MASK_MINOR) >> JVMTI_VERSION_SHIFT_MINOR;
>     micro_rt = (ver_ptr & JVMTI_VERSION_MASK_MICRO) >> JVMTI_VERSION_SHIFT_MICRO;
> 	if (micro_rt > 0 ) {
> 		fprintf(stderr, "PASSED\n");
>     } else {
>         fprintf(stderr, "FAILED\n ");
> 	}
> 	fprintf(stderr, "\tRuntime version: %d.%d.%d\n", major_rt, minor_rt, micro_rt);
> 	fflush(stderr);
>  
>     
>     return JNI_OK;
> }
> --------------------------------------------
> Create GVN.dll or use library from attachment
> Run test GVN
> java  -showversion -agentlib:GVN GVN
> Output on RI:
> ==============
> Version number: 30010024 JVMTI_VERSION_1_0: 30010000
> PASSED
>         Runtime version: 1.0.36
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> Output on DRLVM:
> =================
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r532358, (Apr 25 2007), Windows/ia32/msvc 1310, debug build
> http://incubator.apache.org/harmony
> Version number: 30010000 JVMTI_VERSION_1_0: 30010000
> FAILED
>         Runtime version: 1.0.0
> This bug causes the failure of the test
>     vm.jvmti.funcs.GetVersionNumber.GetVersionNumber0101.GetVersionNumber0101.
> from DRLVM Validation Test Suite (http://issues.apache.org/jira/browse/HARMONY-3206)

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