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 207571 - IDE hangs on closing New C++ File dialog in automatic tests
Summary: IDE hangs on closing New C++ File dialog in automatic tests
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 178709 207170 208916 214016 (view as bug list)
Depends on: 207170
Blocks:
  Show dependency tree
 
Reported: 2012-01-20 14:32 UTC by Vladimir Kvashin
Modified: 2012-10-29 11:00 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Full thread dump (4.86 KB, application/zip)
2012-01-20 14:32 UTC, Vladimir Kvashin
Details
proposed fix (1.81 KB, patch)
2012-01-20 14:55 UTC, Vladimir Kvashin
Details | Diff
Proposed fix (3.67 KB, patch)
2012-02-21 15:50 UTC, Miloslav Metelka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2012-01-20 14:32:16 UTC
Created attachment 115121 [details]
Full thread dump

Full remote utomatic tests hang due to IDE hanging on closing New C++ File dialog. See thread dump in attachement.

It seems that IDE could hang on creation any remote source file from time to time while usual manual working and it was found while automatic testing only because automatic tests work more intensively.
Comment 1 Vladimir Kvashin 2012-01-20 14:50:13 UTC
In trunk, this does not reproduce, but it reproduces in 6.9.1
Comment 2 Vladimir Kvashin 2012-01-20 14:55:46 UTC
Created attachment 115125 [details]
proposed fix
Comment 3 Vladimir Kvashin 2012-01-23 09:14:43 UTC
We face this problem in the case external change event comes before CloneableEditorSupport.lastSaveTime field is initialized. 
So in propertyChange reload flag is set to true in this case, which is incorrect.

Here is a proposed change that fixes the problem (in release701_fixes context).

diff -r 3de2a7e1d744 openide.text/src/org/openide/text/CloneableEditorSupport.java
--- a/openide.text/src/org/openide/text/CloneableEditorSupport.java     Thu Jan 19 15:00:06 2012 +0300
+++ b/openide.text/src/org/openide/text/CloneableEditorSupport.java     Mon Jan 23 13:09:26 2012 +0300
@@ -227,7 +227,7 @@
     private transient Reference<Pane> lastSelected;

     /** The time of the last save to determine the real external modifications */
-    private long lastSaveTime;
+    private long lastSaveTime = -1;
Comment 4 Vladimir Kvashin 2012-02-02 17:15:02 UTC
cnd-main:
http://hg.netbeans.org/cnd-main/rev/e72b14c4ac24
blacktie:
rev/9e5179d8f90c
Comment 5 Alexander Pepin 2012-02-08 13:02:57 UTC
verified in automatic test in all branches.
Comment 6 Vladimir Kvashin 2012-02-08 20:12:42 UTC
Integrated into release71_fixes:
http://hg.netbeans.org/releases/rev/fb629a366725
Comment 7 Quality Engineering 2012-02-09 02:39:23 UTC
Integrated into 'releases', will be available in build *201202082200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/fb629a366725
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: Fixing #207170, #207571
(transplanted from e72b14c4ac246a20d896924f22774b44613f50d4)
Comment 8 Miloslav Metelka 2012-02-21 15:48:04 UTC
IMHO this patch is not optimal since lastSaveTime == -1 is used as a marker for unsuccessful save. The problem is that checkReload() (CloneableEditorSupport:2900):

 // #57104 - avoid notifyModified() which takes file lock
documentReloading = true;
NbDocument.runAtomic(sd, this);
documentReloading = false; // #57104


 is run under runAtomic() so there's then the deadlock of document-lock <-> CES.getLock().
 Not sure whether runAtomic() is there for blocking possible document modifications but I could accomplish that by checking for documentReloading flag in CES.DocFilter.
 So I would suggest to remove the runAtomic() around checkReload() (diff attached). Unit tests pass OK with this patch. Jardo, what do you think?
Comment 9 Miloslav Metelka 2012-02-21 15:50:21 UTC
Created attachment 115988 [details]
Proposed fix
Comment 10 Miloslav Metelka 2012-02-23 10:54:46 UTC
http://hg.netbeans.org/jet-main/rev/6f321c144572
Comment 11 Quality Engineering 2012-02-24 09:30:06 UTC
Integrated into 'main-golden', will be available in build *201202240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6f321c144572
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #207571 - IDE hangs on closing New C++ File dialog in automatic tests.
Comment 12 Miloslav Metelka 2012-03-01 09:26:10 UTC
Unfortunately I must rework the fix since it causes issue #208916. That also means that 7.1.1. is affected :( sorry for that.
Unfortunately I'm unable to say how frequently this happens to users.
Comment 13 Miloslav Metelka 2012-03-01 09:31:58 UTC
Sorry, I was wrong, only Vladimir's patch went into 7.1.1.
Comment 14 Vladimir Kvashin 2012-03-01 10:29:14 UTC
(In reply to comment #13)
> Sorry, I was wrong, only Vladimir's patch went into 7.1.1.
Sure. 
What do you think should we do with 7.1.1, is it ok to just leave my fix there?
Comment 15 Miloslav Metelka 2012-03-01 13:52:05 UTC
New fix:
http://hg.netbeans.org/jet-main/rev/e4fc0654f907

(In reply to comment #14)
> (In reply to comment #13)
> > Sorry, I was wrong, only Vladimir's patch went into 7.1.1.
> Sure. 
> What do you think should we do with 7.1.1, is it ok to just leave my fix there?

Yes, let's leave it for 7.1.1. If the new fix will be ok, we can release it as part of 7.1.2.
Comment 16 Miloslav Metelka 2012-03-01 13:52:57 UTC
*** Bug 208916 has been marked as a duplicate of this bug. ***
Comment 17 Quality Engineering 2012-03-04 09:30:31 UTC
Integrated into 'main-golden', will be available in build *201203040400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e4fc0654f907
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #207571 - IDE hangs on closing New C++ File dialog in automatic tests - reworked fix.
Comment 18 Miloslav Metelka 2012-05-17 09:25:48 UTC
*** Bug 207170 has been marked as a duplicate of this bug. ***
Comment 19 Miloslav Metelka 2012-06-13 10:13:15 UTC
*** Bug 214016 has been marked as a duplicate of this bug. ***
Comment 20 David Strupl 2012-10-29 11:00:44 UTC
*** Bug 178709 has been marked as a duplicate of this bug. ***