From commits-return-39919-apmail-harmony-commits-archive=harmony.apache.org@harmony.apache.org Thu Jul 05 09:56:28 2007 Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 85851 invoked from network); 5 Jul 2007 09:56:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jul 2007 09:56:27 -0000 Received: (qmail 80760 invoked by uid 500); 5 Jul 2007 09:56:29 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 80689 invoked by uid 500); 5 Jul 2007 09:56:29 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 80679 invoked by uid 99); 5 Jul 2007 09:56:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2007 02:56:28 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2007 02:56:25 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 41BBD7141F2 for ; Thu, 5 Jul 2007 02:56:05 -0700 (PDT) Message-ID: <22174964.1183629365264.JavaMail.jira@brutus> Date: Thu, 5 Jul 2007 02:56:05 -0700 (PDT) From: "Vera Petrashkova (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-4351) [buildtest][vts] Test vm/jvmti/funcs/GetOwnedMonitorInfo/GetOwnedMonitorInfo0101/GetOwnedMonitorInfo0101.xml is incorrect MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [buildtest][vts] Test vm/jvmti/funcs/GetOwnedMonitorInfo/GetOwnedMonitorInfo0101/GetOwnedMonitorInfo0101.xml is incorrect ------------------------------------------------------------------------------------------------------------------------- Key: HARMONY-4351 URL: https://issues.apache.org/jira/browse/HARMONY-4351 Project: Harmony Issue Type: Bug Components: build - test - ci Reporter: Vera Petrashkova According to J2SE JVMTI specification method GetOwnedMonitorInfo (jvmtiEnv* env, jthread thread, jint* owned_monitor_count_ptr, jobject** owned_monitors_ptr) returns information about the monitors owned by the specified thread. It saves the number of monitors to owned_monitor_count_ptr. The following VTS test vm/jvmti/funcs/GetOwnedMonitorInfo/GetOwnedMonitorInfo0101/GetOwnedMonitorInfo0101.xml creates thread "Owner". This "Owner" thread - acquires 7 monitors on sync0 - sync6 objects; - starts new thread "agent" The method Thread.start in DRLVM is synchronized, so the thread also acquires the monitor on object which corresponds to the "agent" thread. As the result GetOwnedMonitorInfo returns information about 8 monitors for "Owner" thread. But this test passes only when returned "owned_monitor_count_ptr" equals 7. See source code: ----------- GetOwnedMonitorInfo0101.cpp------------------ void JNICALL callbackThreadStart(prms_THRD_START) { ... result = jvmti_env->GetAllThreads(&tcount, &threads); fprintf(stderr, "\tnative: GetAllThreads result = %d (must be zero) \n", result); if (result != JVMTI_ERROR_NONE) return; for ( int i = 0; i < tcount; i++ ) { result = jvmti_env->GetThreadInfo(threads[i], &tinfo); fprintf(stderr, "\tnative: GetThreadInfo result = %d (must be zero) \n", result); fprintf(stderr, "\tnative: current thread name is %s (must be zero) \n", tinfo.name); if (result != JVMTI_ERROR_NONE) continue; if (strcmp(tinfo.name, "Owner")) continue; my_thread = threads[i]; fprintf(stderr, "\tnative: tested thread was found = %p\n", my_thread); break; } util = true; result = jvmti_env->GetOwnedMonitorInfo(my_thread, &owned_monitor_count, &owned_monitors); fprintf(stderr, "\tnative: GetOwnedMonitorInfo result = %d (must be zero) \n", result); flag = true; fprintf(stderr, "\n\tnative: number of waited threads is %d (must be 7)\n", owned_monitor_count ); if ((result == JVMTI_ERROR_NONE) && (owned_monitor_count == 7)) { <<<<<<<<< test = true; <<<<<<<<<<<<<<<<<< return; } } void JNICALL callbackVMDeath(prms_VMDEATH) { check_VMDEATH; fprintf(stderr, "\n\tTest of function GetOwnedMonitorInfo0101 : "); if (test && util) <<<<<<<<<<<<<<<< fprintf(stderr, " passed \n"); else fprintf(stderr, " failed \n"); fprintf(stderr, "\n} /* test GetOwnedMonitorInfo0101 is finished */ \n"); fflush(stderr); } -------------------------- This test fails on DRLVM and on BEA JRockit. Test vm/jvmti/funcs/GetOwnedMonitorInfo/GetOwnedMonitorInfo0101/GetOwnedMonitorInfo0101.xml is incorrect and should be fixed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.