United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6701700 MonitorInfo objects aren't invalidated when the owning thread is resumed
JDK-6701700 : MonitorInfo objects aren't invalidated when the owning thread is resumed

Details
Type:
Bug
Submit Date:
2008-05-13
Status:
Closed
Updated Date:
2012-02-02
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
core-svc
OS:
generic
Sub-Component:
debugger
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
The spec says they are invalidated because the info contained in the MonitorInfo object might no longer be correct after a resume occurs.
For example,  the stack depth might be different, and the monitor might not even be owned by the thread anymore.
This bug is covered by the following new JTREG test:

    com/sun/jdi/MonitorFrameInfo.java

                                    

Comments
SUGGESTED FIX

------- MonitorInfoImpl.java -------
43c43
<                     ThreadReference thread, int dpth) {
---
>                     ThreadReferenceImpl thread, int dpth) {
47a48
>         thread.addListener(this);
                                     
2008-05-13
EVALUATION

MonitorInfoImpl implements ThreadListener but its ctor doesn't register
itself as a listener of the associated thread.  Thus when a resume occurs,
the MonitorInfo objects aren't notified that they should become invalid.
See the same implementation in StackFrameImpl.java
                                     
2008-05-13
EVALUATION

http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/dd7969318d7a
                                     
2009-12-08



Hardware and Software, Engineered to Work Together