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 190319 - Assert in FolderObj.getChildren(FolderObj.java:150)
Summary: Assert in FolderObj.getChildren(FolderObj.java:150)
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 7.0
Hardware: All All
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 122295 182898 190354 190679 191074 191093 191142 191159 191173 191191 191199 191377 191395 191505 191682 191794 191813 191973 192116 192185 192223 192365 192492 192617 192678 192953 193019 193020 193383 193665 193698 193961 194395 194932 195140 195800 195891 195981 196059 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-12 22:54 UTC by javydreamercsw
Modified: 2011-02-27 13:27 UTC (History)
59 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 172658


Attachments
Dump (22.60 KB, application/octet-stream)
2010-09-12 22:56 UTC, javydreamercsw
Details
stacktrace (2.17 KB, text/plain)
2010-10-29 12:02 UTC, host
Details
Dump (166.94 KB, application/octet-stream)
2010-10-31 15:48 UTC, johnsonlau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description javydreamercsw 2010-09-12 22:54:56 UTC
Product Version = NetBeans IDE Dev (Build 201009120000)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_20
Runtime = Java HotSpot(TM) Client VM 16.3-b01

See attached dump
Comment 1 javydreamercsw 2010-09-12 22:56:05 UTC
Created attachment 101993 [details]
Dump
Comment 2 Jan Lahoda 2010-09-13 09:44:47 UTC
Seems like some kind of debugging assert in filesystems.
Comment 3 Jaroslav Tulach 2010-09-27 20:49:25 UTC
java.lang.AssertionError: FileName: c:\src\src\games\jwrestling\server\core\engine\db\controller\AgeJpaController.java@e810c5 
fo: MasterFileObject[c:\src\src\games\jwrestling\server\core\engine\db\controller\AgeJpaController.java@15d134d:14cb66e,valid=true]
at masterfs.filebasedfs.fileobjects.FolderObj.getChildren(FolderObj.java:150)
at org.openide.filesystems.FileObject.getChildren(FileObject.java:791)
at java.source.parsing.SourceFileManager.list(SourceFileManager.java:95)
Comment 4 Jaroslav Tulach 2010-09-29 06:16:08 UTC
*** Bug 190354 has been marked as a duplicate of this bug. ***
Comment 5 Jaroslav Tulach 2010-10-01 08:42:13 UTC
*** Bug 190679 has been marked as a duplicate of this bug. ***
Comment 6 Jaroslav Tulach 2010-10-01 08:43:06 UTC
Making P2, duplicates are counting and counting.
Comment 7 Petr Nejedly 2010-10-18 13:51:40 UTC
*** Bug 191074 has been marked as a duplicate of this bug. ***
Comment 8 Jan Lahoda 2010-10-19 15:02:15 UTC
*** Bug 191142 has been marked as a duplicate of this bug. ***
Comment 9 Petr Nejedly 2010-10-20 14:22:00 UTC
*** Bug 191093 has been marked as a duplicate of this bug. ***
Comment 10 Petr Nejedly 2010-10-20 14:36:20 UTC
*** Bug 191159 has been marked as a duplicate of this bug. ***
Comment 11 Petr Nejedly 2010-10-20 14:42:53 UTC
There seems to be a race condition in allocation of a file name fragments.
I have reproduced it in the case where a refresh (caused by external change) was running concurrently with PackageViewChildren.
I have added allocation stack traces to FileName and the collision looks like:

Assert problem, stack traces:
java.lang.Exception: Trace
	at org.netbeans.modules.masterfs.filebasedfs.naming.FileName.<init>(FileName.java:69)
	at org.netbeans.modules.masterfs.filebasedfs.naming.NamingFactory.createFileNaming(NamingFactory.java:229)
	at org.netbeans.modules.masterfs.filebasedfs.naming.NamingFactory.registerInstanceOfFileNaming(NamingFactory.java:172)
	at org.netbeans.modules.masterfs.filebasedfs.naming.NamingFactory.fromFile(NamingFactory.java:89)
	at org.netbeans.modules.masterfs.filebasedfs.children.ChildrenSupport.rescanChildren(ChildrenSupport.java:224)
	at org.netbeans.modules.masterfs.filebasedfs.children.ChildrenSupport.refresh(ChildrenSupport.java:163)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj$FolderChildrenCache.refresh(FolderObj.java:588)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.refreshImpl(FolderObj.java:373)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj.refresh(BaseFileObj.java:750)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.refresh(FolderObj.java:462)
	at org.openide.filesystems.FileObject.refresh(FileObject.java:1036)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory$AsyncRefreshAtomicAction.run(FileObjectFactory.java:794)
	at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:125)
	at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:566)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:563)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory.refreshFromGetter(FileObjectFactory.java:802)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory.issueIfExist(FileObjectFactory.java:282)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory.getFileObject(FileObjectFactory.java:193)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory.getValidFileObject(FileObjectFactory.java:680)
	at org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem.getFileObject(FileBasedFileSystem.java:137)
	at org.netbeans.modules.masterfs.filebasedfs.FileBasedURLMapper.getFileObjects(FileBasedURLMapper.java:134)
	at org.netbeans.modules.masterfs.MasterURLMapper.getFileObjects(MasterURLMapper.java:65)
	at org.openide.filesystems.URLMapper.findFileObject(URLMapper.java:216)
	at org.openide.filesystems.FileUtil.toFileObject(FileUtil.java:1014)
	at org.netbeans.modules.masterfs.watcher.Watcher$Ext.refreshRecursively(Watcher.java:128)
	at org.netbeans.modules.masterfs.ProvidedExtensionsProxy.refreshRecursively(ProvidedExtensionsProxy.java:299)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectKeeper.init(FileObjectKeeper.java:105)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.refreshImpl(FolderObj.java:456)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj.refresh(BaseFileObj.java:750)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.refresh(FolderObj.java:462)
	at org.openide.filesystems.FileObject.refresh(FileObject.java:1036)
	at org.netbeans.modules.masterfs.watcher.Watcher$1.run(Watcher.java:190)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1960)
and:
java.lang.Exception: Trace
	at org.netbeans.modules.masterfs.filebasedfs.naming.FileName.<init>(FileName.java:69)
	at org.netbeans.modules.masterfs.filebasedfs.naming.FolderName.<init>(FolderName.java:61)
	at org.netbeans.modules.masterfs.filebasedfs.naming.NamingFactory.createFileNaming(NamingFactory.java:232)
	at org.netbeans.modules.masterfs.filebasedfs.naming.NamingFactory.registerInstanceOfFileNaming(NamingFactory.java:172)
	at org.netbeans.modules.masterfs.filebasedfs.naming.NamingFactory.fromFile(NamingFactory.java:89)
	at org.netbeans.modules.masterfs.filebasedfs.children.ChildrenSupport.rescanChildren(ChildrenSupport.java:224)
	at org.netbeans.modules.masterfs.filebasedfs.children.ChildrenSupport.getChildren(ChildrenSupport.java:89)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj$FolderChildrenCache.getChildren(FolderObj.java:578)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.getChildren(FolderObj.java:138)
	at org.netbeans.spi.java.project.support.ui.PackageView.findNonExcludedPackages(PackageView.java:191)
	at org.netbeans.spi.java.project.support.ui.PackageView.findNonExcludedPackages(PackageView.java:219)
	at org.netbeans.spi.java.project.support.ui.PackageView.findNonExcludedPackages(PackageView.java:163)
	at org.netbeans.spi.java.project.support.ui.PackageViewChildren.findNonExcludedPackages(PackageViewChildren.java:281)
	at org.netbeans.spi.java.project.support.ui.PackageViewChildren.computeKeys(PackageViewChildren.java:273)
	at org.netbeans.spi.java.project.support.ui.PackageViewChildren.run(PackageViewChildren.java:218)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1960)
Comment 12 Petr Nejedly 2010-10-20 20:35:11 UTC
*** Bug 191173 has been marked as a duplicate of this bug. ***
Comment 13 Petr Nejedly 2010-10-21 12:18:53 UTC
*** Bug 191199 has been marked as a duplicate of this bug. ***
Comment 14 Petr Nejedly 2010-10-21 14:13:52 UTC
*** Bug 191191 has been marked as a duplicate of this bug. ***
Comment 15 Petr Nejedly 2010-10-27 14:02:37 UTC
*** Bug 191377 has been marked as a duplicate of this bug. ***
Comment 16 Petr Nejedly 2010-10-27 14:02:48 UTC
*** Bug 191395 has been marked as a duplicate of this bug. ***
Comment 17 host 2010-10-29 12:02:57 UTC
Created attachment 102708 [details]
stacktrace
Comment 18 johnsonlau 2010-10-31 15:48:09 UTC
Created attachment 102730 [details]
Dump
Comment 19 Petr Nejedly 2010-11-02 12:34:09 UTC
OK, no race condition, NamingFactory.fromFile is correctly synchronized and the subsequent code even asserts the lock held.

I have found a bug in the (quite hard to read, unnecessarily many ternary operators used where if() would be much cleaner) code of NamingFactory.registerInstanceOfFileNaming. The conversion from one direct referenced entry to a list of entries forgot to re-add the original entry.

The fix alone is a one-liner, though I'm still testing it a bit.
Comment 20 Petr Nejedly 2010-11-02 13:54:46 UTC
Root case identified, covered with a test and fixed:
http://hg.netbeans.org/core-main/rev/4835237b24bc
Comment 21 Petr Nejedly 2010-11-02 14:02:52 UTC
*** Bug 191505 has been marked as a duplicate of this bug. ***
Comment 22 henriquemoody 2010-11-02 21:25:54 UTC
Thanks for all!
Comment 23 Petr Nejedly 2010-11-10 14:49:03 UTC
*** Bug 191794 has been marked as a duplicate of this bug. ***
Comment 24 Petr Nejedly 2010-11-10 14:52:51 UTC
*** Bug 191682 has been marked as a duplicate of this bug. ***
Comment 25 Jan Lahoda 2010-11-11 09:11:40 UTC
*** Bug 191813 has been marked as a duplicate of this bug. ***
Comment 26 stefan79 2010-11-15 12:09:23 UTC
Please have a look at report #172658.

Bug occred at 201011150001!
Comment 27 Michel Graciano 2010-11-22 12:47:36 UTC
This is still valid. Take a look at the latest reports. I am not able to reproduce it every time but when switching between Project Groups it happens sometimes.
Comment 28 Jaroslav Tulach 2010-11-25 12:08:34 UTC
*** Bug 192116 has been marked as a duplicate of this bug. ***
Comment 29 stefan79 2010-11-26 13:55:44 UTC
Changed Priority to P1.
When I select an folder an the exception occures, I doesn´t see any java-File and I can´t open a Java-File.
Comment 30 Jaroslav Tulach 2010-11-26 19:26:03 UTC
Btw. just run with -da if you are too annoyed by this bug...
Comment 31 Jaroslav Tulach 2010-11-26 20:15:30 UTC
Rather than switching assertions off, I'd like you to use upgrade to new build and reproduce the failure again. I've enabled dump of allocation stacktraces (slow), but that is probably the only way to find out what is wrong: core-main#2f260f4b8d99
Comment 32 Tomas Zezula 2010-11-27 14:15:41 UTC
http://statistics.netbeans.org/analytics/exception.do?id=444909
Happened in dev build having Jarda's changes.
Comment 33 Quality Engineering 2010-11-28 06:15:33 UTC
Integrated into 'main-golden', will be available in build *201011280001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/2f260f4b8d99
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #190319: Dump allocation stacktrace when the assert fails
Comment 34 Jaroslav Tulach 2010-11-28 19:58:06 UTC
changeset:   f8b5f4a0abde
summary:     #190319: Dump also content of global map
Comment 35 Jaroslav Tulach 2010-11-29 07:28:58 UTC
I guess I got one idea of what can be wrong.
Comment 36 Jaroslav Tulach 2010-11-29 07:51:18 UTC
core-main#6c0055ccd3ed
Comment 37 asmotrich 2010-11-29 19:17:11 UTC
Just uploaded the dump, please see report #445749. Fresh IDE start with some projects loaded, I did not manipulate IDE at all - the assertion happened during the initial project scan.
Comment 38 Jaroslav Tulach 2010-11-29 22:26:57 UTC
*** Bug 192492 has been marked as a duplicate of this bug. ***
Comment 39 Jaroslav Tulach 2010-11-30 05:44:01 UTC
*** Bug 122295 has been marked as a duplicate of this bug. ***
Comment 40 Quality Engineering 2010-11-30 06:14:06 UTC
Integrated into 'main-golden', will be available in build *201011300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f8b5f4a0abde
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #190319: Dump also content of global map
Comment 41 Jan Lahoda 2010-12-01 06:31:37 UTC
The assertion seems to fail for a java.hints test in:
http://bertram.netbeans.org/hudson/job/jet-main/3235/testReport/junit/org.netbeans.modules.java.hints/IllegalInstanceOfTest/testIssue108246/

In build 3236, there is similar problem for a different test, so this does not seem to be a problem in the tests. The 3235 build contains both 6c0055ccd3ed and f8b5f4a0abde.
Comment 42 Jaroslav Tulach 2010-12-02 09:20:59 UTC
ergonomics#f568ff70892e
Comment 43 schkovich 2010-12-06 00:42:38 UTC
Does not appear to be fixed:

It has now been added to the database with id #448819. It has been classified as a duplicate of report #172658. 
This bug was already fixed.
Please update your build of NetBeans to the latest build of 7.0 where bug #190319 is fixed. If you are already using a newer build and your report meets certain criteria a new bug will be filed automatically.

I am running Build 201012050001 and bug was fixed and integrated in Build 201011300001.

Product Version: NetBeans IDE Dev (Build 201012050001)
Java: 1.6.0_22; Java HotSpot(TM) 64-Bit Server VM 17.1-b03
System: Linux version 2.6.35-23-generic running on amd64; UTF-8; en_US (nb)
Comment 44 Vladimir Voskresensky 2010-12-06 05:28:23 UTC
changeset is not propagated, i.e. still not in main-silver
http://hg.netbeans.org/main-silver/rev/f568ff70892e
Comment 45 Vladimir Voskresensky 2010-12-06 05:35:14 UTC
I've filed P1 issue #192901 which blocks propagation of this fix into production
Comment 46 Jaroslav Tulach 2010-12-06 10:30:50 UTC
*** Bug 191973 has been marked as a duplicate of this bug. ***
Comment 47 Jaroslav Tulach 2010-12-06 10:42:31 UTC
*** Bug 192365 has been marked as a duplicate of this bug. ***
Comment 48 Jaroslav Tulach 2010-12-06 10:44:27 UTC
*** Bug 182898 has been marked as a duplicate of this bug. ***
Comment 49 Jaroslav Tulach 2010-12-06 12:14:45 UTC
*** Bug 192678 has been marked as a duplicate of this bug. ***
Comment 50 Quality Engineering 2010-12-07 06:10:32 UTC
Integrated into 'main-golden', will be available in build *201012070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f568ff70892e
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #190319: Rather than using WeakHashMap let's implement the hashing manually and have more control over what it does
Comment 51 Jaroslav Tulach 2010-12-07 16:46:47 UTC
*** Bug 192953 has been marked as a duplicate of this bug. ***
Comment 52 Jaroslav Tulach 2010-12-08 15:02:32 UTC
*** Bug 193020 has been marked as a duplicate of this bug. ***
Comment 53 Jaroslav Tulach 2010-12-08 15:37:32 UTC
*** Bug 193019 has been marked as a duplicate of this bug. ***
Comment 54 Jaroslav Tulach 2010-12-08 15:37:42 UTC
*** Bug 192617 has been marked as a duplicate of this bug. ***
Comment 55 Jaroslav Tulach 2010-12-17 18:02:36 UTC
*** Bug 193383 has been marked as a duplicate of this bug. ***
Comment 56 Jaroslav Tulach 2011-01-03 08:50:45 UTC
*** Bug 193961 has been marked as a duplicate of this bug. ***
Comment 57 Jaroslav Tulach 2011-01-03 09:22:00 UTC
*** Bug 193665 has been marked as a duplicate of this bug. ***
Comment 58 Jaroslav Tulach 2011-01-20 17:00:18 UTC
*** Bug 194395 has been marked as a duplicate of this bug. ***
Comment 59 Jaroslav Tulach 2011-01-24 20:59:16 UTC
*** Bug 193698 has been marked as a duplicate of this bug. ***
Comment 60 Jaroslav Tulach 2011-01-31 20:37:09 UTC
*** Bug 192223 has been marked as a duplicate of this bug. ***
Comment 61 Jaroslav Tulach 2011-01-31 20:43:22 UTC
*** Bug 192185 has been marked as a duplicate of this bug. ***
Comment 62 Jaroslav Tulach 2011-02-01 12:41:57 UTC
*** Bug 194932 has been marked as a duplicate of this bug. ***
Comment 63 Vince Kraemer 2011-02-24 21:03:23 UTC
*** Bug 195140 has been marked as a duplicate of this bug. ***
Comment 64 Jaroslav Tulach 2011-02-25 19:53:57 UTC
*** Bug 195981 has been marked as a duplicate of this bug. ***
Comment 65 Jaroslav Tulach 2011-02-25 19:58:49 UTC
*** Bug 195800 has been marked as a duplicate of this bug. ***
Comment 66 Jaroslav Tulach 2011-02-26 15:23:02 UTC
*** Bug 195891 has been marked as a duplicate of this bug. ***
Comment 67 Jaroslav Tulach 2011-02-27 13:27:50 UTC
*** Bug 196059 has been marked as a duplicate of this bug. ***