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.
Running a platform app with a minimal set of NB modules (see log), clean start is fine, but on restart, the exception in the log is thrown and startup halts. Not sure what to make of it, but there's none of my code involved, so perhaps this can happen to the IDE too? Everything in the stack trace after core.Main.start() is openide. The previous shutdown left two custom TopComponents open - an explorer view of a folder in SFS and a custom TopComponent associated with the single DataObject in the SFS folder. Note that core/ui is disabled, which is a little unusual.
Created attachment 25778 [details] log
Tim, please attach something to make it easier to reproduce the problem. I am not going to spend hours trying to get the same configuration you have.
Will attach a demo. It's a small paint program. Shut down NB with a couple image windows open, and restart a few times and you should see the same thing.
Created attachment 25886 [details] Module suite that reproduces the problem (use unzip -a if unzipping on unix to convert line terminators)
I cannot reproduce the problem, I am sorry. I opened few top components and tried to restart few times and nothing. Btw. the content is lost after restart even if I save a component...
You could change the persistence type in the TC if you want. But actually, it may be unrelated to TopComponents anyway. It seems to be reproducible randomly, a very small percentage of the time (1 out of maybe 200 startups). What I'd suggest is, change the persistence type if you want, and just run a script that will start it over and over again for a weekend. Go home. On Monday, you'll probably have a stalled instance of NetBeans with this problem. It is real.
Honza, were not you talking to me about a bug in MIME resolution related to AbstractLookup$ISE? Is not this bug the case you were describing? Thanks.
A but in MIMESupport I guess. done Checking in test/unit/src/org/openide/filesystems/MIMESupportResolversTest.java; /cvs/openide/fs/test/unit/src/org/openide/filesystems/MIMESupportResolversTest.java,v <-- MIMESupportResolversTest.java initial revision: 1.1 done Checking in src/org/openide/filesystems/MIMESupport.java; /cvs/openide/fs/src/org/openide/filesystems/MIMESupport.java,v <-- MIMESupport.java new revision: 1.3
Sorry, had to rollback; caused a stack overflow on second start of IDE: Checking in openide/fs/src/org/openide/filesystems/MIMESupport.java; /cvs/openide/fs/src/org/openide/filesystems/MIMESupport.java,v <-- MIMESupport.java new revision: 1.4; previous revision: 1.3 done
Created attachment 26725 [details] The stack overflow error - easily reproduced, just run IDE on fresh UD, shut down, restart (thanx to Trung for finding)
See bug 68318
New fix of MIMESupport that shall work after more restarts. However I still am able to generate the exception from time to time. I do not know where is the problem, maybe wrong synchronization in XMLDataObject or in entity resolver... Anyway I'm adding better logging. If you Time, can reproduce the problem enable: -Dorg.openide.loaders.XMLDataObject=-5 -Dorg.netbeans.core.filesystems=-5 -Dorg.netbeans.core.xml=-5 and attach output which is generated around the exception, so we can try to analyze the reasons that lead to the failure. Checking in core/src/org/netbeans/core/filesystems/MIMEResolverImpl.java; /cvs/core/src/org/netbeans/core/filesystems/MIMEResolverImpl.java,v <-- MIMEResolverImpl.java new revision: 1.16; previous revision: 1.15 done RCS file: /cvs/openide/fs/test/unit/src/org/openide/filesystems/MIMESupport68318Test.java,v done Checking in openide/fs/test/unit/src/org/openide/filesystems/MIMESupport68318Test.java; /cvs/openide/fs/test/unit/src/org/openide/filesystems/MIMESupport68318Test.java,v <-- MIMESupport68318Test.java initial revision: 1.1 done Checking in openide/loaders/src/org/openide/loaders/FolderLookup.java; /cvs/openide/loaders/src/org/openide/loaders/FolderLookup.java,v <-- FolderLookup.java new revision: 1.12; previous revision: 1.11 done Checking in openide/fs/src/org/openide/filesystems/MIMESupport.java; /cvs/openide/fs/src/org/openide/filesystems/MIMESupport.java,v <-- MIMESupport.java new revision: 1.5; previous revision: 1.4
"#66438: More logging found a race condition. The registerSwitches in LoggingTestCaseHid helped to simulate it and fix it. Now the problem shall be gone." Checking in core/src/org/netbeans/core/xml/FileEntityResolver.java; /cvs/core/src/org/netbeans/core/xml/FileEntityResolver.java,v <-- FileEntityResolver.java new revision: 1.28; previous revision: 1.27 done Checking in openide/loaders/src/org/openide/loaders/XMLDataObject.java; /cvs/openide/loaders/src/org/openide/loaders/XMLDataObject.java,v <-- XMLDataObject.java new revision: 1.22; previous revision: 1.21 done Checking in openide/loaders/test/unit/src/org/openide/loaders/LoggingControlTest.java; /cvs/openide/loaders/test/unit/src/org/openide/loaders/LoggingControlTest.java,v <-- LoggingControlTest.java new revision: 1.5; previous revision: 1.4 done Checking in openide/loaders/test/unit/src/org/openide/loaders/LoggingTestCaseHid.java; /cvs/openide/loaders/test/unit/src/org/openide/loaders/LoggingTestCaseHid.java,v <-- LoggingTestCaseHid.java new revision: 1.8; previous revision: 1.7 done RCS file: /cvs/openide/loaders/test/unit/src/org/openide/loaders/XMLDataObjectGetCookieTest.java,v done Checking in openide/loaders/test/unit/src/org/openide/loaders/XMLDataObjectGetCookieTest.java; /cvs/openide/loaders/test/unit/src/org/openide/loaders/XMLDataObjectGetCookieTest.java,v <-- XMLDataObjectGetCookieTest.java initial revision: 1.1
I was able to get the exception with logging once again. There is a race condition in FileEntityResolver.
Created attachment 27175 [details] The important part of the log showing the collision between two threads
cvs server: scheduling file `FileEntityResolver66438Test.java' for addition cvs server: use 'cvs commit' to add this file permanently Checking in test/unit/src/org/netbeans/core/xml/FileEntityResolverDeadlock54971Test.java; /cvs/core/test/unit/src/org/netbeans/core/xml/FileEntityResolverDeadlock54971Test.java,v <-- FileEntityResolverDeadlock54971Test.java new revision: 1.3; previous revision: 1.2 done RCS file: /cvs/core/test/unit/src/org/netbeans/core/xml/FileEntityResolver66438Test.java,v done Checking in test/unit/src/org/netbeans/core/xml/FileEntityResolver66438Test.java; /cvs/core/test/unit/src/org/netbeans/core/xml/FileEntityResolver66438Test.java,v <-- FileEntityResolver66438Test.java initial revision: 1.1 done Checking in src/org/netbeans/core/xml/FileEntityResolver.java; /cvs/core/src/org/netbeans/core/xml/FileEntityResolver.java,v <-- FileEntityResolver.java new revision: 1.29; previous revision: 1.28