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 208111 - a lot of "shared access to .../test3_testLinesBeforeFunction.h@54457628:16b336c (probably opened for writing)." exceptions
Summary: a lot of "shared access to .../test3_testLinesBeforeFunction.h@54457628:16b33...
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.2
Hardware: PC Solaris
: P2 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on: 208160
Blocks:
  Show dependency tree
 
Reported: 2012-02-07 08:39 UTC by soldatov
Modified: 2012-05-14 14:03 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log (24.69 KB, text/plain)
2012-02-07 08:43 UTC, soldatov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2012-02-07 08:39:32 UTC
a lot of tests fails with such exceptions:

Caused: org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot get shared access to /export1/hudson/workspace/ss-test-intel-S2-3/tests/build/test/qa-functional/data/cnd/formatting/TestFormattingOptions/testLinesBeforeFunction/test3_testLinesBeforeFunction.h@54457628:16b336c (probably opened for writing).
	at org.netbeans.modules.masterfs.filebasedfs.utils.FSException.io(FSException.java:118)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.MutualExclusionSupport.addResource(MutualExclusionSupport.java:96)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getInputStream(FileObj.java:188)
Caused: java.io.FileNotFoundException
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getInputStream(FileObj.java:215)
	at org.openide.filesystems.MIMESupport$CachedFileObject.getInputStream(MIMESupport.java:414)
	at org.netbeans.modules.openide.filesystems.declmime.FileElement$Type$FilePattern.match(FileElement.java:310)
	at org.netbeans.modules.openide.filesystems.declmime.FileElement$Type.accept(FileElement.java:630)
	at org.netbeans.modules.openide.filesystems.declmime.FileElement$Type.access$200(FileElement.java:152)
[catch] at org.netbeans.modules.openide.filesystems.declmime.FileElement.resolve(FileElement.java:95)
	at org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl$Impl.findMIMEType(MIMEResolverImpl.java:427)
	at org.openide.filesystems.MIMESupport$CachedFileObject.resolveMIME(MIMESupport.java:383)
	at org.openide.filesystems.MIMESupport$CachedFileObject.getMIMEType(MIMESupport.java:324)
	at org.openide.filesystems.MIMESupport.findMIMEType(MIMESupport.java:135)
	at org.openide.filesystems.FileUtil.getMIMEType(FileUtil.java:1481)
	at org.openide.filesystems.FileObject.getMIMEType(FileObject.java:587)
	at org.netbeans.modules.cnd.source.CppEditorSupport.getGuardedSectionsProvider(CppEditorSupport.java:258)
	at org.netbeans.modules.cnd.source.CppEditorSupport.saveFromKitToStream(CppEditorSupport.java:225)
	at org.openide.text.CloneableEditorSupport$1SaveAsReader.run(CloneableEditorSupport.java:1079)
	at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1336)
	at org.openide.text.CloneableEditorSupport.saveDocument(CloneableEditorSupport.java:1147)
	at org.openide.text.DataEditorSupport.superSaveDoc(DataEditorSupport.java:608)
	at org.openide.text.DataEditorSupport$SaveImpl.run(DataEditorSupport.java:1306)
	at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
	at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:566)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:580)
	at org.openide.text.DataEditorSupport.saveDocument(DataEditorSupport.java:604)
	at org.netbeans.modules.cnd.source.CppEditorSupport$1.save(CppEditorSupport.java:101)
	at org.openide.loaders.DataObject$DOSavable.handleSave(DataObject.java:1314)
	at org.netbeans.spi.actions.AbstractSavable.save(AbstractSavable.java:107)
	at org.openide.actions.SaveAction.performAction(SaveAction.java:132)
	at org.openide.actions.SaveAction.performAction(SaveAction.java:109)
Comment 1 soldatov 2012-02-07 08:43:22 UTC
Created attachment 115500 [details]
log
Comment 2 Vladimir Voskresensky 2012-02-07 08:57:39 UTC
very strange how file test3_testLinesBeforeFunction.h
 with extension can be passed to sniffy resolver

I will add diagnostic to find problematic resolver
Comment 3 Vladimir Voskresensky 2012-02-07 09:00:03 UTC
more logging
http://hg.netbeans.org/cnd-main/rev/b23f3a104af6
Comment 4 soldatov 2012-02-08 07:54:09 UTC
New line is
INFO [org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl]: IOException in resolver FileElement(fast-check(patterns:[UNCOVER, 9, false], ) null Result:text/x-osscoverage
Comment 5 soldatov 2012-02-08 08:04:43 UTC
INFO [org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl]: IOException in resolver FileElement(fast-check(patterns:[PREVISE, 9, false], ) null Result:text/x-ossstatic
Comment 6 soldatov 2012-02-08 08:05:49 UTC
INFO [org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl]: IOException in resolver FileElement(fast-check(patterns:[DISCOVER, 10, false], ) null Result:text/x-ossdynamic
Comment 7 Vladimir Voskresensky 2012-02-08 09:24:50 UTC
Thanks!
Comment 8 Vladimir Voskresensky 2012-02-08 09:52:15 UTC
saveFromKitToStream is called from 
CloneableEditorSupport$1SaveAsReader.run(CloneableEditorSupport.java:1079)
and previous operation is 
os = new BufferedOutputStream(cesEnv().outputStream());
which write-lock environment/fileobject 
=> 
nobody can call getMimeType for file object associated with document from 
saveFromKitToStream
which looks like very strong restriction.
Comment 9 Vladimir Voskresensky 2012-02-08 11:13:11 UTC
another issue:
mix of annotation based registration and layer based registrations causes incorrect ordering of resolvers
Comment 10 Vladimir Voskresensky 2012-02-08 12:43:10 UTC
(In reply to comment #9)
> another issue:
> mix of annotation based registration and layer based registrations causes
> incorrect ordering of resolvers
filed as issue #208160
Comment 11 Vladimir Voskresensky 2012-02-08 12:43:32 UTC
(In reply to comment #8)
> saveFromKitToStream is called from 
> CloneableEditorSupport$1SaveAsReader.run(CloneableEditorSupport.java:1079)
> and previous operation is 
> os = new BufferedOutputStream(cesEnv().outputStream());
> which write-lock environment/fileobject 
> => 
> nobody can call getMimeType for file object associated with document from 
> saveFromKitToStream
> which looks like very strong restriction.
filed as issue #208161
Comment 12 Vladimir Voskresensky 2012-02-08 12:46:25 UTC
workaround which does not use fo.getMimeType
http://hg.netbeans.org/cnd-main/rev/b2bea9e1cc98
Comment 13 Vladimir Kvashin 2012-02-08 14:45:10 UTC
I checked that the fix does not break blacktie functionality.
Transplanted to balcktie: rev/af073fc07686
Comment 14 soldatov 2012-02-09 08:28:40 UTC
verified in latest build
Comment 15 Vladimir Kvashin 2012-02-10 11:35:01 UTC
transplanted into release71_fixes
http://hg.netbeans.org/releases/rev/e1339e44d83a
Comment 16 Quality Engineering 2012-02-11 02:52:55 UTC
Integrated into 'releases', will be available in build *201202102200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/e1339e44d83a
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixed #208111 - a lot of "shared access to ..." exceptions
- do not use fo.getMimeType (see issue #208161)
(transplanted from b2bea9e1cc985208a40046c915e9effeab233855)
Comment 17 Alexander Pepin 2012-02-27 13:28:16 UTC
verified in 7.1.1 rc1 build (20120214)
Comment 18 Alexander Pepin 2012-05-14 14:03:36 UTC
verified in NB 7.0.1 patch3 candidate (build 201205021427)