-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
6
-
generic
-
generic
Attached test reproduces bug found during execution multiple JDI tests in single VM.
Test scenario:
Fisrt, debuggee VM starts thread with name "TestThread1" which acquires monitor with JNI MonitorEnter and finishes, then debugger starts second thread with name "TestThread2" which just executes infinite loop. Debuggeer first print data obtained for "TestThread1" and then print data obtained for "TestThread2" and for both threads method ownedMonitorsAndFrames() returns the same monitor and this is wrong for "TestThread2" which doesn't acquire any monitor.
Bug reproduces intermittently.
Test output:
debuggee out>>>Command received: createThread1
Thread: instance of OwnedMonitorsDebuggee$Thread1(name='TestThread1', id=151)
Total monitors: 1
Monitor: instance of java.lang.Object(id=155) Thread: instance of OwnedMonitorsDebuggee$Thread1(name='TestThread1', id=151) Depth: -1
debuggee out>>>Command received: createThread2
Thread: instance of OwnedMonitorsDebuggee$Thread2(name='TestThread2', id=158)
Total monitors: 1
Monitor: instance of java.lang.Object(id=155) Thread: instance of OwnedMonitorsDebuggee$Thread2(name='TestThread2', id=158) Depth: -1
Unexpected monitors was returned for TestThread2
debuggee out>>>Command received: QUIT
debuggee out>>>Exit
TEST FAIL
Test scenario:
Fisrt, debuggee VM starts thread with name "TestThread1" which acquires monitor with JNI MonitorEnter and finishes, then debugger starts second thread with name "TestThread2" which just executes infinite loop. Debuggeer first print data obtained for "TestThread1" and then print data obtained for "TestThread2" and for both threads method ownedMonitorsAndFrames() returns the same monitor and this is wrong for "TestThread2" which doesn't acquire any monitor.
Bug reproduces intermittently.
Test output:
debuggee out>>>Command received: createThread1
Thread: instance of OwnedMonitorsDebuggee$Thread1(name='TestThread1', id=151)
Total monitors: 1
Monitor: instance of java.lang.Object(id=155) Thread: instance of OwnedMonitorsDebuggee$Thread1(name='TestThread1', id=151) Depth: -1
debuggee out>>>Command received: createThread2
Thread: instance of OwnedMonitorsDebuggee$Thread2(name='TestThread2', id=158)
Total monitors: 1
Monitor: instance of java.lang.Object(id=155) Thread: instance of OwnedMonitorsDebuggee$Thread2(name='TestThread2', id=158) Depth: -1
Unexpected monitors was returned for TestThread2
debuggee out>>>Command received: QUIT
debuggee out>>>Exit
TEST FAIL
- relates to
-
JDK-6289830 Monitors entered by JNI MonitorEnter aren't freed after thread quits normally
-
- Closed
-
-
JDK-6282335 DetachCurrentThread doesn't release monitors was taken by MonitorEnter (doc change)
-
- Closed
-