Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 187219 - sunstudio will not terminate when exiting IDE
sunstudio will not terminate when exiting IDE
Status: VERIFIED FIXED
Product: cnd
Classification: Unclassified
Component: Code Model
6.x
Sun Solaris
: P2 (vote)
: 6.x
Assigned To: Alexander Simon
issues@cnd
69patch1-verified
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-04 22:25 UTC by ivan
Modified: 2010-07-09 14:43 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
full dump of hung IDE (13.74 KB, text/plain)
2010-06-04 22:26 UTC, ivan
Details
my thread dump (20.03 KB, text/plain)
2010-06-16 09:06 UTC, Alexander Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ivan 2010-06-04 22:25:34 UTC
I ran sunstudio script from the cmdline (based on NB6.9rc2).
I did a remote build, and a remote debug. 
Then I exited the IDE using File->Exit.
The sunstudio script never returned back to the shell. A ^\
yielded this:

"AWT-EventQueue-1" prio=3 tid=0x00511400 nid=0x1d sleeping[0xf7efe000..0xf7effac0]
   java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.FileChannelImpl.size0(Native Method)
        at sun.nio.ch.FileChannelImpl.size(FileChannelImpl.java:312)
        - locked <0xb7f107e0> (a java.lang.Object)
        at org.netbeans.modules.cnd.repository.sfs.BufferedRWAccess.size(BufferedRWAccess.java:152)
        at org.netbeans.modules.cnd.repository.sfs.IndexedStorageFile.write(IndexedStorageFile.java:149)
        - locked <0xb7ef9470> (a org.netbeans.modules.cnd.repository.sfs.IndexedStorageFile$Lock)
        at org.netbeans.modules.cnd.repository.sfs.DoubleFileStorage.write(DoubleFileStorage.java:149)
        at org.netbeans.modules.cnd.repository.disk.UnitImpl.putPhysically(UnitImpl.java:153)
        at org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager.write(DiskRepositoryManager.java:168)
        at org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager.closeUnit2(DiskRepositoryManager.java:281)
        at org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager.closeUnit(DiskRepositoryManager.java:270)
        - locked <0xb68b6e10> (a org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager$NamedLock)
        at org.netbeans.modules.cnd.repository.impl.DelegateRepository.closeUnit(DelegateRepository.java:118)
        at org.netbeans.modules.cnd.modelimpl.repository.RepositoryUtils._closeUnit(RepositoryUtils.java:315)
        at org.netbeans.modules.cnd.modelimpl.repository.RepositoryUtils.closeUnit(RepositoryUtils.java:302)
        at org.netbeans.modules.cnd.modelimpl.repository.RepositoryUtils.closeUnit(RepositoryUtils.java:292)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase.dispose(ProjectBase.java:2027)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl.disposeProject(ModelImpl.java:310)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl.disposeProject(ModelImpl.java:297)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl.shutdown(ModelImpl.java:462)
        at org.netbeans.modules.cnd.modelimpl.platform.ModelSupport.shutdown(ModelSupport.java:185)
        at org.netbeans.modules.cnd.modelimpl.Installer.close(Installer.java:72)
        at org.netbeans.core.startup.NbInstaller.close(NbInstaller.java:696)
        at org.netbeans.ModuleManager.shutDown(ModuleManager.java:1619)
        at org.netbeans.core.startup.ModuleSystem.shutDown(ModuleSystem.java:308)
        at org.netbeans.core.NbLifecycleManager.doExit(NbLifecycleManager.java:167)
        at org.netbeans.core.NbLifecycleManager.access$000(NbLifecycleManager.java:75)
        at org.netbeans.core.NbLifecycleManager$ExitActions.run(NbLifecycleManager.java:123)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:137)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

A complete dump will follow.
Comment 1 ivan 2010-06-04 22:26:06 UTC
Created attachment 99832 [details]
full dump of hung IDE
Comment 2 ivan 2010-06-04 22:37:02 UTC
It turns out that it's not a hang, merely a very long shutdown.

what might be contributing is that I also have a large project open (dbx).
But I am debugging a separate smaller project.
I wait til the IDE has parsed the big project and run
"checking for external changes" before I exit.
And then I see the hang ... which eventually terminates.
Comment 3 Alexander Pepin 2010-06-07 14:36:49 UTC
see also bug #186897
Comment 4 ivan 2010-06-07 18:52:58 UTC
(In reply to comment #3)
> see also bug #186897

bug #186897 has been closed as a duplicate of bug #186655 the
focus of which is to improve the scan time.

This bug however brings up the need for terminating a scan that is no longer
needed (or maybe making sure it isn't even started).
Comment 5 Alexander Simon 2010-06-16 08:42:37 UTC
I can reproduce bug on sun ray (sr1-espb04-03):
Prepare to experiment:
- copy netbeans (development version) in the home directory
- start IDE
- add OracleSolarisStudio from /shared/dp/sstrunk/build27.0
- create project from existing code (I have mySQL 5.1.30), tool OracleSolarisStudio
- wait finishing parsing
- close project
- exit from IDE
Steps to reproduce bug:
- clear cnd cache
- start IDE
- d-n-d mysql-5.1.30/sql/mysqld into editor area
- create project
- wait finishing parsing
- delete project with sources
- exit IDE
Actual: IDE is not finishing for 3 minutes.
Expected: IDE is finishing for 3 seconds.
Comment 6 Alexander Pepin 2010-06-16 09:05:15 UTC
It should be investigated who starts "checking for external changes" for the just closed project and reassigned to platform if it's a bug in NB projects infrastructure.
Comment 7 Alexander Simon 2010-06-16 09:06:29 UTC
Created attachment 100118 [details]
my thread dump
Comment 8 Alexander Simon 2010-06-16 10:08:04 UTC
fixed in cnd-main, change set:
http://hg.netbeans.org/cnd-main/rev/488bd1111b6d
Vladimir Kvashin & Vladimir Voskresensky, please review fix to integrate in 6.9.1
Comment 9 ivan 2010-06-16 19:17:32 UTC
(In reply to comment #5)

> Steps to reproduce bug:
> - clear cnd cache
> - start IDE
> - d-n-d mysql-5.1.30/sql/mysqld into editor area
> - create project
> - wait finishing parsing
> - delete project with sources
> - exit IDE
> Actual: IDE is not finishing for 3 minutes.
> Expected: IDE is finishing for 3 seconds.

This is somewhat different from my scenario.
I don't close or delete any projects. The large project which
I suspect is holding things up is open.
Comment 10 Alexander Simon 2010-06-16 19:33:12 UTC
(In reply to comment #9)
> This is somewhat different from my scenario.
> I don't close or delete any projects. The large project which
> I suspect is holding things up is open.
Did you check fix on your use case?
Root of problem is a slow method sun.nio.ch.FileChannelImpl.size0() on NFS.
My fix removes a huge number of calls of sun.nio.ch.FileChannelImpl.size().
I believe that your use case has the same problem.
Comment 11 ivan 2010-06-16 19:36:56 UTC
(In reply to comment #10)

> Did you check fix on your use case?
> Root of problem is a slow method sun.nio.ch.FileChannelImpl.size0() on NFS.
> My fix removes a huge number of calls of sun.nio.ch.FileChannelImpl.size().
> I believe that your use case has the same problem.

Ok, I'll give it a try. However, I'm stied tied to a 6.9 release
and don't have a trunk handy. So it'll be a bit.
Comment 12 Alexander Simon 2010-06-16 19:45:34 UTC
To check fix you can replace one module:
- C/C++ Repository (org.netbeans.modules.cnd.repository.jar)
Comment 13 Quality Engineering 2010-06-17 03:21:05 UTC
Integrated into 'main-golden', will be available in build *201006170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/488bd1111b6d
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed BZ#187219 sunstudio will not terminate when exiting IDE
Comment 14 Alexander Simon 2010-06-17 13:34:50 UTC
fixed in release691:
488bd1111b6d transplanted to ad506829cbb8
Comment 15 rbalada 2010-06-17 14:16:17 UTC
Please mark bugs VERIFIED-FIXED before transplanting to release691.

Please verify this bugfix asap.

Thanks,
-R
Comment 16 rbalada 2010-06-21 16:01:15 UTC
Please verify bugfix for this bug, so it can be integrated into release691 repository.

Thanks,
-R
Comment 17 ivan 2010-06-21 20:31:27 UTC
I'll be able to verify it today.
I've been doing disk housekeeping and cleaning on my machine
so I can keep both a release69 and trunk NB repositories ...
Comment 18 ivan 2010-06-22 03:22:45 UTC
IDE will now shutdown in reasonable time in the following scenarios:
- shutdown after a "big project" has been parsed.
- shutdown during a bug parse (initiated via ReparseProject action)
Comment 19 Alexander Pepin 2010-07-09 14:43:20 UTC
verified in 6.9.1.

Ivan, please confirm.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo