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 230452 - NbLifecycleManager.finishExitState: "File > Exit" does not work
Summary: NbLifecycleManager.finishExitState: "File > Exit" does not work
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 7.4
Hardware: PC Linux
: P1 normal with 1 vote (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 229038 229285 230152 230272 230611 230815 231330 231331 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-05-29 12:43 UTC by Jiri Kovalsky
Modified: 2013-06-22 02:08 UTC (History)
15 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Full thread dump of the IDE which cannot be closed normally. (20.73 KB, application/octet-stream)
2013-05-29 12:43 UTC, Jiri Kovalsky
Details
Log with the -J-Dorg.netbeans.core.NbLifecycleManager.level=FINE (149.77 KB, application/octet-stream)
2013-06-15 17:06 UTC, ecerichter
Details
Full Thread Dump 7.4Beta(2013-06-13_22-01-06) (13.92 KB, text/plain)
2013-06-18 10:20 UTC, Jiri Rechtacek
Details
DEV 201306162301 - Video showing the issue (5.52 MB, video/avi)
2013-06-18 10:25 UTC, ecerichter
Details
Thread dump with DEV 201306162301 (31.33 KB, application/octet-stream)
2013-06-18 10:26 UTC, ecerichter
Details
AGAIN: Log with the -J-Dorg.netbeans.core.NbLifecycleManager.level=FINE (225.63 KB, application/octet-stream)
2013-06-18 10:31 UTC, ecerichter
Details
fine log (34.85 KB, text/x-log)
2013-06-18 12:03 UTC, Jiri Rechtacek
Details
Possible fix - use "hg unbundle 230452.hg"; "hg up -C a9006cd1a62d" (2.36 KB, application/octet-stream)
2013-06-18 13:09 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2013-05-29 12:43:41 UTC
Created attachment 135069 [details]
Full thread dump of the IDE which cannot be closed normally.

Product Version: NetBeans IDE Dev (Build 201305262300)
Updates: Updates available
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
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:
============
I cannot exit IDE normally and have to kill it, because "File > Exit" menu item does nothing. IDE is working normally and fully responsive. Please see the attached full thread dump. I also have application snapshot and heap dump if it would be useful.

What I did:
===========
1. I tried to reproduce issue #229657.
2. Then I finished debugging session by appropriate button in Debugger toolbar.
3. Finally I clicked "x" button in the IDE's title bar but it didn't work so I did "File > Exit" which didn't work either.
Comment 1 Jiri Rechtacek 2013-05-29 15:43:08 UTC
*** Bug 229285 has been marked as a duplicate of this bug. ***
Comment 2 Antonin Nebuzelsky 2013-06-03 15:27:54 UTC
*** Bug 230611 has been marked as a duplicate of this bug. ***
Comment 3 Jaroslav Tulach 2013-06-04 06:07:38 UTC
*** Bug 229038 has been marked as a duplicate of this bug. ***
Comment 4 Jaroslav Tulach 2013-06-04 06:09:10 UTC
*** Bug 230152 has been marked as a duplicate of this bug. ***
Comment 5 Ondrej Vrabec 2013-06-04 13:52:26 UTC
*** Bug 230272 has been marked as a duplicate of this bug. ***
Comment 6 Ondrej Vrabec 2013-06-06 07:42:38 UTC
*** Bug 229365 has been marked as a duplicate of this bug. ***
Comment 7 everflux 2013-06-07 21:31:31 UTC
I am testing the installation of NB 7.3.1 (latest), the installer hangs at 35% (Installing Java ME...)
Not sure if this is the same bug, since the bug was reported against NB 7.4, but I did not want to create even more duplicates.

java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

nbi.products.to.install=nb-base,7.3.1.0.201306052037;nb-javase,7.3.1.0.201306052037;nb-javame,7.3.1.0.201306052037;nb-webcommon,7.3.1.0.201306052037;nb-javaee,7.3.1.0.201306052037;nb-cnd,7.3.1.0.201306052037;nb-groovy,7.3.1.0.201306052037;nb-php,7.3.1.0.201306052037;nb-ergonomics,7.3.1.0.201306052037;
Comment 8 everflux 2013-06-07 21:33:25 UTC
Correction: The installation finished, the dialog box did not draw correctly. Please ignore previous comment, I will open a new bug report.
Comment 9 Jaroslav Tulach 2013-06-10 06:47:32 UTC
If anyone can reproduce with logging, please attach your log file. Here is the flag to turn logging on:

-J-Dorg.netbeans.core.NbLifecycleManager.level=FINE

Thanks.
Comment 10 Jaroslav Tulach 2013-06-10 06:56:03 UTC
Changeset: 6dd4a63fcf77
Author:    Jaroslav Tulach <jtulach@netbeans.org>
Date:      2013-06-10 08:55
Message:   #230452: Set the global variable first and only then enter the secondary loop
Comment 11 Jaroslav Tulach 2013-06-10 06:57:21 UTC
I've made a small change, however I am not sure if that helps. Reproducing with logging on would still be useful.
Comment 12 Quality Engineering 2013-06-14 02:00:16 UTC
Integrated into 'main-golden', will be available in build *201306132301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6dd4a63fcf77
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #230452: Set the global variable first and only then enter the secondary loop
Issue #230452 - NbLifecycleManager.finishExitState: "File > Exit" does not work
Comment 13 ecerichter 2013-06-15 17:04:19 UTC
(In reply to comment #11)
> I've made a small change, however I am not sure if that helps. Reproducing with
> logging on would still be useful.

If you have followed my bug report, then you have a clear easy way to reproduce the problem. Instead, you closed it without paying enough attention to it.

Nevertheless, I'll repeat here what you need, and how did your attempt results.

1) Put any java program to run.
2) Try to close IDE once
3) You get the warning about a running program.
4) Cancel the exit
5) Stop the program
6) Try to close the IDE again. Not working anymore.

Now, after the patch, what happens is:

1) Put any java program to run.
2) Try to close IDE once
3) You get the warning about a running program.
4) Cancel the exit
5) Stop the program
6) Try to close the IDE: you will get warned about the running program AGAIN - even if the program is not running anymore.

Attached is the log you asked for.
Comment 14 ecerichter 2013-06-15 17:06:56 UTC
Created attachment 135840 [details]
Log with the -J-Dorg.netbeans.core.NbLifecycleManager.level=FINE
Comment 15 Jaroslav Tulach 2013-06-17 06:51:22 UTC
Thanks for pointing me to the right steps and providing log file. I, however still can't reproduce the problem. Moreover I don't even see the "get warned about the running program AGAIN" behavior.

There is a note in your log saying
"INFO [org.netbeans.core.execution.Install]: KILL_PENDING_TASKS"
I have serious doubts you could generate such message when no application was running.

I don't know how to move forward. Try to reproduce again, elaborate on step #5 (how do you stop the program) attach log and please also attach thread dump.
Comment 16 Jaroslav Tulach 2013-06-17 06:54:01 UTC
This part of the log indicates some activity of parsing API. Maybe the application was no longer running, but the background scanning was still on. The exit dialog might have been shown due to the scanning activity then...

INFO [org.netbeans.core.execution.Install]: KILL_PENDING_TASKS
INFO [org.netbeans.modules.extbrowser]: interrupted in run(): java.lang.InterruptedException
FINE [org.netbeans.core.NbLifecycleManager]: org.netbeans.core.NbLifeExit@5157e0a5.run()
WARNING [org.netbeans.modules.parsing.impl.TaskProcessor]: ParserManager.parse called in AWT event thread by: org.netbeans.modules.parsing.impl.RunWhenScanFinishedSupport.runWhenScanFinished(RunWhenScanFinishedSupport.java:136)
INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Resolving dependencies took: 1 ms
INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 0 binary roots took: 0 ms
INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 0 source roots took: 0 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 0 ms]
Comment 17 Tomas Zezula 2013-06-17 08:11:06 UTC
The RU has check for exit end ends as soon as the parsing.api ModuleInstall is called and the active indexer finishes (the Context passed to the indexer provides info about cancel status).
Comment 18 Jiri Rechtacek 2013-06-17 08:50:19 UTC
We got several P1 duplicates of this problem => increased to P1.
Comment 19 Jiri Rechtacek 2013-06-17 08:50:26 UTC
*** Bug 231331 has been marked as a duplicate of this bug. ***
Comment 20 Jiri Rechtacek 2013-06-17 08:50:34 UTC
*** Bug 231330 has been marked as a duplicate of this bug. ***
Comment 21 ecerichter 2013-06-17 10:20:09 UTC
The video recorded is available in (In reply to comment #15)
> Thanks for pointing me to the right steps and providing log file. I, however
> still can't reproduce the problem. Moreover I don't even see the "get warned
> about the running program AGAIN" behavior.
> 
> There is a note in your log saying
> "INFO [org.netbeans.core.execution.Install]: KILL_PENDING_TASKS"
> I have serious doubts you could generate such message when no application was
> running.
> 
> I don't know how to move forward. Try to reproduce again, elaborate on step #5
> (how do you stop the program) attach log and please also attach thread dump.

The video recorded is available in my original post.
If you need additional one, I'll be glad to provide.

Regards,

Edson
Comment 22 Jiri Rechtacek 2013-06-17 11:11:48 UTC
*** Bug 230815 has been marked as a duplicate of this bug. ***
Comment 23 Jaroslav Tulach 2013-06-18 06:51:40 UTC
I beg your pardon. Neither bug 231331, bug 231330 or bug 230815 contain any information (a stacktrace for example) that would confirm relation with this problem nor contribute to find a solution. Unless we can reproduce the problem (with logging and thread dump), there is not much to do about it.
Comment 24 Jaroslav Tulach 2013-06-18 07:13:20 UTC
> > I don't know how to move forward. Try to reproduce again, elaborate on step > > (how do you stop the program) attach log and please also attach thread dump.
> 
> The video recorded is available in my original post.
> If you need additional one, I'll be glad to provide.

By original post you likely mean bug 229365#c9 (it took a while to find that out). Video shows nicely what you have done, but I am missing the log (see comment #9) from that session and also dump of threads at the moment when the File/Exit stopped working.
Comment 25 everflux 2013-06-18 08:34:32 UTC
For messages log see my attachments in #230272 - I assume it is the same problem.

https://netbeans.org/bugzilla/show_bug.cgi?id=230272
Comment 26 Jiri Rechtacek 2013-06-18 10:20:31 UTC
Created attachment 135947 [details]
Full Thread Dump 7.4Beta(2013-06-13_22-01-06)
Comment 27 ecerichter 2013-06-18 10:25:39 UTC
Created attachment 135949 [details]
DEV 201306162301 - Video showing the issue
Comment 28 ecerichter 2013-06-18 10:26:31 UTC
Created attachment 135950 [details]
Thread dump with DEV 201306162301
Comment 29 ecerichter 2013-06-18 10:29:57 UTC
Well, I've wasted some time repeating my self, but attached there is the requested information: video showing step by step how to reproduce the problem in latest DEV and a full thread dump obtained after the second attemp to exit.

You will see that message dialog still show my web app is running besides it is not (shown in the video).

Just wondering: would the problem be related to Chrome Plugin still exchanging information with NetBeans (like browser log or browser DOM structures)? Would be the problem related to Chrome Plugin at this time?


Regards,

Edson
Comment 30 ecerichter 2013-06-18 10:31:31 UTC
Created attachment 135951 [details]
AGAIN: Log with the -J-Dorg.netbeans.core.NbLifecycleManager.level=FINE
Comment 31 Jaroslav Tulach 2013-06-18 11:12:28 UTC
(In reply to comment #26)
> Created attachment 135947 [details]
> Full Thread Dump 7.4Beta(2013-06-13_22-01-06)

@jrechtacek: OK, thanks. This looks like a bug in module system. If you can also generate the log file, I am sure we can make a progress.

@ecerichter: It looks like your case describes another bug unrelated to module system. If your inquiry has been closed as duplicate of this bug #230452, then it was an incorrect decision. Please reopen your original bug and continue to discuss your issue in there with owners of tomcat or ant or execution. Thanks.
Comment 32 ecerichter 2013-06-18 11:26:08 UTC
(In reply to comment #31)
> (In reply to comment #26)
> > Created attachment 135947 [details]
> > Full Thread Dump 7.4Beta(2013-06-13_22-01-06)
> 
> @jrechtacek: OK, thanks. This looks like a bug in module system. If you can
> also generate the log file, I am sure we can make a progress.
> 
> @ecerichter: It looks like your case describes another bug unrelated to module
> system. If your inquiry has been closed as duplicate of this bug #230452, then
> it was an incorrect decision. Please reopen your original bug and continue to
> discuss your issue in there with owners of tomcat or ant or execution. Thanks.

Thanks god you had the enlightenment to check this out.
Comment 33 Jiri Rechtacek 2013-06-18 12:03:02 UTC
Created attachment 135962 [details]
fine log

> @jrechtacek: OK, thanks. This looks like a bug in module system. If you can
> also generate the log file, I am sure we can make a progress.
messages.log from run with FINE level.
Comment 34 Jaroslav Tulach 2013-06-18 12:20:39 UTC
OK, this might be it. The order in this failure case is

NbLifeExit(2, 0, org.netbeans.TaskFuture@2730b778, org.netbeans.core.NbLifecycleManager$1@5ef4895e[Count = 1]) = org.netbeans.core.NbLifeExit@6f5d3b61
finishExitState Thread[AWT-EventQueue-0,6,IDE Main] clean: true
Showing dialog: java.awt.WaitDispatchSupport@4cbd0d3d
Disposing dialog: java.awt.WaitDispatchSupport@4cbd0d3d
About to block on org.netbeans.core.NbLifecycleManager$1@5ef4895e[Count = 1]

while on my computer, when shutdown succeeds it is

NbLifeExit(2, 0, org.netbeans.TaskFuture@3a93e, org.netbeans.core.NbLifecycleManager$1@158b5f9[Count = 0]) = org.netbean
s.core.NbLifeExit@5c5190
org.netbeans.core.NbLifeExit@5c5190.run()
NbLifeExit(3, 0, null, org.netbeans.core.NbLifecycleManager$1@158b5f9[Count = 0]) = org.netbeans.core.NbLifeExit@eeca40
finishExitState Thread[AWT-EventQueue-0,6,IDE Main] clean: true
org.netbeans.core.NbLifeExit@eeca40.run()
countDown for org.netbeans.core.NbLifecycleManager$1@158b5f9[Count = 0], hiding java.awt.WaitDispatchSupport@12049df
Showing dialog: java.awt.WaitDispatchSupport@12049df
Disposing dialog: java.awt.WaitDispatchSupport@12049df
About to block on org.netbeans.core.NbLifecycleManager$1@158b5f9[Count = 0]

The important missing message is "countDown for"
Comment 35 Jaroslav Tulach 2013-06-18 13:02:41 UTC
Few cleanup commits...

ergonomics#f1042cdb6e32
ergonomics#3442ccc85b7b
ergonomics#b26e70fdbbb1
ergonomics#575b66893fb2

...helped me realize that the problem is in WarmUp...

   java.lang.Thread.State: WAITING (on object monitor)
	at java.awt.EventQueue.invokeAndWait(EventQueue.java:1263)
	- locked <0x00000000f7e25590> (a java.awt.EventQueue$1AWTInvocationLock)
	at java.awt.EventQueue.invokeAndWait(EventQueue.java:1244)
	at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1349)
	at org.netbeans.core.ui.warmup.MenuWarmUpTask.run(MenuWarmUpTask.java:96)
	at org.netbeans.core.startup.WarmUpSupport.run(WarmUpSupport.java:98)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
	at org.openide.util.RequestProcessor$Processor.run

... waiting to enter EDT which is blocked by waiting on CountDownLatch never to be counted down because "Nb Exit" thread can't finish until WarmUp is over.
Comment 36 Jaroslav Tulach 2013-06-18 13:09:32 UTC
Created attachment 135971 [details]
Possible fix - use "hg unbundle 230452.hg"; "hg up -C a9006cd1a62d"
Comment 37 Jiri Rechtacek 2013-06-18 17:01:05 UTC
(In reply to comment #36)
> Created attachment 135971 [details]
> Possible fix - use "hg unbundle 230452.hg"; "hg up -C a9006cd1a62d"

The fix works.
Comment 40 everflux 2013-06-20 08:18:57 UTC
I understand that the same root cause is responsible for this and #229229 and #230672

As of today (NetBeans IDE Build 201306191709) I still have the problem that the installer gets stuck at 35% and at the end an Ubuntu crash report is generated.

I understand that the fixes are not yet applied to the nightly build branch, so I leave this bug in state resolved. If it should be fixed in the nightlies, though, it should be re-opened.
Comment 41 Quality Engineering 2013-06-22 02:08:46 UTC
Integrated into 'main-golden', will be available in build *201306212301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3442ccc85b7b
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #230452: onExit is supposed to be guarded by NbLifecycleManager.class. Thus isExitingMethod should be synchronized.