[ http://issues.apache.org/jira/browse/HARMONY-2395?page=all ] Ruslan Scherbakov updated HARMONY-2395: --------------------------------------- Attachment: JVMTI_MonTest.zip Attached test case to reproduce the problem. > [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: 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