Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 31895 invoked from network); 5 Dec 2006 10:41:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2006 10:41:46 -0000 Received: (qmail 33683 invoked by uid 500); 5 Dec 2006 10:41:55 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 33585 invoked by uid 500); 5 Dec 2006 10:41:55 -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 33575 invoked by uid 99); 5 Dec 2006 10:41:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Dec 2006 02:41:54 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= 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; Tue, 05 Dec 2006 02:41:45 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 798257142E1 for ; Tue, 5 Dec 2006 02:41:25 -0800 (PST) Message-ID: <11299349.1165315285494.JavaMail.jira@brutus> Date: Tue, 5 Dec 2006 02:41:25 -0800 (PST) From: "Eugene S. Ostrovsky (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2395) [drlvm][jvmti] GetObjectMonitorUsage does not return local references as expected by spec In-Reply-To: <5222177.1164982221049.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/HARMONY-2395?page=all ] Eugene S. Ostrovsky updated HARMONY-2395: ----------------------------------------- Attachment: H-2395-GetObjectMonitorUsage-fixed.patch Added patch: H-2395-GetObjectMonitorUsage-fixed.patch GetObjectMonitorUsage fixed. 1. Local handles allocation added. 2. Race condition in thread arrays manipulation fixed. > [drlvm][jvmti] GetObjectMonitorUsage does not return local references as expected by spec > ------------------------------------------------------------------------------------------ > > Key: HARMONY-2395 > URL: http://issues.apache.org/jira/browse/HARMONY-2395 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Environment: Windows/ia32, Linux/ia32 > Reporter: Ruslan Scherbakov > Attachments: H-2395-GetObjectMonitorUsage-fixed.patch, JVMTI_MonTest.zip > > > According to JVMTI spec GetObjectMonitorUsage function should return local references in the monitor owner and in the wait and notify lists. Local refs returned by JVMTI or JNI function can be deleted by DeleteLocalRef. > However according to the test output below DRLVM does not return local ref. As a result it crashes some time after DeleteLocalRef for the owner of the jvmtiMonitorUsage structure. The same is for waiters/notify_waiters. SUN and JRockit work fine in this situation. > DRLVM>>> > ========================================================================================= > 2. run initial class WITH agent > Agent_OnLoad: pVM=010020A0, options=(null) > Agent_OnLoad: OK > 1. MonitorWait : thread=024D0B00, pJniEnv=01057288 > 2. MonitorContendedEnter : thread=024D0B00, pJniEnv=01057288 > MonitorUsage: invalid phase > 3. ThreadStart : thread=024E3F50, pJniEnv=024E20B8 > 4. MonitorContendedEntered: thread=024D0B00, pJniEnv=01057288 > 5. MonitorWaited : thread=024D0B00, pJniEnv=01057288 > 6. VMInit : thread=024D5730, pJniEnv=01057288 > 7. ThreadStart : thread=024D0B00, pJniEnv=01057288 > 8. MonitorWait : thread=024E3F50, pJniEnv=024E20B8 > 9. MonitorContendedEnter : thread=024E3F50, pJniEnv=024E20B8 > MonitorUsage: entry_count=1, waiter_count=1 > MonitorUsage: DeleteLocalRef owner =024E3F50 > [ThreadTest] START > 10. MonitorWait : thread=024D0B00, pJniEnv=01057288 > 11. MonitorContendedEnter : thread=024D0B00, pJniEnv=01057288 > ... > An unhandled error (4) has occurred. > ... > SUN>>> > ========================================================================================= > 2. run initial class WITH agent > Agent_OnLoad: pVM=6D82F610, options=(null) > Agent_OnLoad: OK > 1. ThreadStart : thread=00A87168, pJniEnv=00A865C8 > 2. MonitorWait : thread=00A87A18, pJniEnv=00A865C8 > 3. ThreadStart : thread=00A88788, pJniEnv=00A87BB0 > 4. MonitorWait : thread=00A88828, pJniEnv=00A87BB0 > 5. VMInit : thread=00A84698, pJniEnv=00036F10 > 6. ThreadStart : thread=00A92660, pJniEnv=00A90C80 > 7. ThreadStart : thread=00A84698, pJniEnv=00036F10 > [ThreadTest] START > [ThreadTest] buddy started > 8. ThreadStart : thread=00AA9168, pJniEnv=00A97938 > 9. MonitorContendedEnter : thread=00AA9208, pJniEnv=00A97938 > MonitorUsage: entry_count=1, waiter_count=0 > MonitorUsage: DeleteLocalRef owner =00AA9210 > 10. MonitorWait : thread=00A86138, pJniEnv=00036F10 > 11. MonitorContendedEntered: thread=00AA9208, pJniEnv=00A97938 > [ThreadTest] buddy run > 12. ThreadEnd : thread=00AA9168, pJniEnv=00A97938 > 13. MonitorWaited : thread=00A86138, pJniEnv=00036F10 > [ThreadTest] FINISH > 14. ThreadEnd : thread=00A84698, pJniEnv=00036F10 > 15. ThreadStart : thread=00A86420, pJniEnv=00036F10 > 16. ThreadEnd : thread=00A86420, pJniEnv=00036F10 > 17. VMDeath : thread=00000000, pJniEnv=00036F10 > JRockit>> > ========================================================================================= > 2. run initial class WITH agent > Agent_OnLoad: pVM=005ACF84, options=(null) > Agent_OnLoad: OK > 1. ThreadStart : thread=00394FC8, pJniEnv=0039510C > 2. ThreadStart : thread=40B88090, pJniEnv=40B881D4 > 3. ThreadStart : thread=40BCA738, pJniEnv=40BCA87C > 4. ThreadStart : thread=40BDCF08, pJniEnv=40BDD04C > 5. ThreadStart : thread=40BDD6C8, pJniEnv=40BDD80C > 6. ThreadStart : thread=40BFDBB0, pJniEnv=40BFDCF4 > 7. VMInit : thread=00394FC8, pJniEnv=0039510C > 8. ThreadStart : thread=411C39A8, pJniEnv=411C3AEC > 9. ThreadStart : thread=411C4258, pJniEnv=411C439C > [ThreadTest] START > [ThreadTest] buddy started > 10. MonitorWait : thread=00394FC8, pJniEnv=0039510C > 11. ThreadStart : thread=41213140, pJniEnv=41213284 > 12. MonitorContendedEnter : thread=41213140, pJniEnv=41213284 > MonitorUsage: entry_count=1, waiter_count=0 > MonitorUsage: DeleteLocalRef owner =41213344 > 13. MonitorWaited : thread=00394FC8, pJniEnv=0039510C > 14. MonitorWait : thread=00394FC8, pJniEnv=0039510C > 15. MonitorContendedEntered: thread=41213140, pJniEnv=41213284 > [ThreadTest] buddy run > 16. MonitorWaited : thread=00394FC8, pJniEnv=0039510C > 17. MonitorWait : thread=00394FC8, pJniEnv=0039510C > 18. MonitorContendedEnter : thread=41213140, pJniEnv=41213284 > MonitorUsage: entry_count=0, waiter_count=1 > 19. MonitorContendedEntered: thread=41213140, pJniEnv=41213284 > 20. ThreadEnd : thread=41213140, pJniEnv=41213284 > 21. MonitorWaited : thread=00394FC8, pJniEnv=0039510C > [ThreadTest] FINISH > 22. ThreadEnd : thread=00394FC8, pJniEnv=0039510C > 23. ThreadStart : thread=41215E98, pJniEnv=41215FDC > 24. ThreadEnd : thread=41215E98, pJniEnv=41215FDC > 25. VMDeath : thread=00000000, pJniEnv=41215FDC -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira