This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 212307 - "Check for deadlock" always displays monitors
Summary: "Check for deadlock" always displays monitors
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-10 12:46 UTC by Jiri Kovalsky
Modified: 2012-05-11 13:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Class reproducing a deadlock. (1.68 KB, text/x-java)
2012-05-10 12:46 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2012-05-10 12:46:06 UTC
Created attachment 119279 [details]
Class reproducing a deadlock.

Product Version: NetBeans IDE Dev (Build 201205090400)
Java: 1.7.0_04; Java HotSpot(TM) 64-Bit Server VM 23.0-b21
System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb)
User directory: /home/cesilko/.netbeans/dev
Cache directory: /home/cesilko/.cache/netbeans/dev

Description:
============
When checking for deadlock monitors are always displayed ignoring value of "Show monitors" option. If the button is pushed, the Debugging view is refreshed and if the "Show monitors" is pushed one more time (i.e. turned off), the monitors are finally hidden.

Steps to reproduce:
===================
1. Open MemoryView project and invoke "Debug File" from popup menu of DeadlockTest.java.
2. Invoke "Debug > Check for Deadlock" from main menu.
3. Verify that both Thread-0,1 threads have their "Owned Monitor: java.lang.Object (#..)" monitors displayed even though "Show monitors" button above Navigator is not pushed.
Comment 1 Martin Entlicher 2012-05-10 16:32:58 UTC
When a deadlock occurs, the "Show monitors" is set on. If the user does not change it, it's only temporary and it's reset back to the off state when the debugger session is finished.
Fixed by changeset:   221375:220c30656e80
http://hg.netbeans.org/main/rev/220c30656e80
Comment 2 Quality Engineering 2012-05-11 10:13:30 UTC
Integrated into 'main-golden', will be available in build *201205110400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/220c30656e80
User: mentlicher@netbeans.org
Log: #212307: Set the SHOW_MONITORS property when a deadlock occurs. Revert it back on debugger exit, unless it's changed in between.
Comment 3 Jiri Kovalsky 2012-05-11 13:07:55 UTC
Product Version: NetBeans IDE Dev (Build 201205110400)
Java: 1.7.0_04; Java HotSpot(TM) 64-Bit Server VM 23.0-b21
System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb)
User directory: /home/cesilko/.netbeans/dev
Cache directory: /home/cesilko/.cache/netbeans/dev

I don't probably understand the fix correctly but now the "Show monitors" option is always set on even if I turn it off after detection of deadlock. If debugger is exited, next time a deadlock is detected, the option is on again. Is this as designed Martine? Didn't you want to give user a chance to persist his preference?
Comment 4 Martin Entlicher 2012-05-11 13:34:49 UTC
Yes, this is as designed. When a deadlock is detected, "Show monitors" is always set on, so that the user can see the details for the deadlock - the monitors are usually a crucial information.
If the user does not change the option, next time the debugger is run, "Show monitors" is back off. Until another deadlock is detected.
Does this make sense?
Comment 5 Jiri Kovalsky 2012-05-11 13:44:46 UTC
OK, I agree. I was just confused by the "unless it's changed in between" explanation. Verifying then. Thanks!