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 249569 - Do not read the entire file while filtering elf and MacOS executables in file chooser
Summary: Do not read the entire file while filtering elf and MacOS executables in file...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Remote (show other bugs)
Version: 8.0
Hardware: PC Solaris
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-30 13:57 UTC by Alexander Simon
Modified: 2015-01-14 09:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2014-12-30 13:57:08 UTC
MacOSXExecutableFileFilter and ElfExecutableFileFilter upload all files during mime resolving.
Step to reproduce:
- open create full remote project with existing sources.
- make sure that build result is empty.
- press run.
IDE shows dialog "Select Executable". Dialog will be in progress (still searching warning) long time. See remote cache: all files will be downloaded.

Stack:
"SelectExecutable" #111 daemon prio=1 os_prio=64 tid=0x000000000327b800 nid=0x6b waiting on condition [0xffff80ff943fe000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000000e4a7e110> (a java.util.concurrent.FutureTask)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
	at java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at org.netbeans.modules.remote.impl.fs.RemoteDirectory.ensureChildSync(RemoteDirectory.java:1507)
	at org.netbeans.modules.remote.impl.fs.RemotePlainFile.getInputStream(RemotePlainFile.java:337)
	at org.netbeans.modules.remote.impl.fs.RemoteFileObject.getInputStream(RemoteFileObject.java:394)
	at org.netbeans.modules.cnd.utils.filters.ElfExecutableFileFilter.checkElfHeader(ElfExecutableFileFilter.java:100)
	at org.netbeans.modules.cnd.utils.filters.ElfExecutableFileFilter.mimeAccept(ElfExecutableFileFilter.java:85)
	at org.netbeans.modules.cnd.utils.FileAndFileObjectFilter.accept(FileAndFileObjectFilter.java:83)
	at org.netbeans.modules.cnd.makeproject.ui.SelectExecutablePanel.addExecutables(SelectExecutablePanel.java:282)
	at org.netbeans.modules.cnd.makeproject.ui.SelectExecutablePanel.findAllExecutables(SelectExecutablePanel.java:234)
	at org.netbeans.modules.cnd.makeproject.ui.SelectExecutablePanel.access$300(SelectExecutablePanel.java:79)
	at org.netbeans.modules.cnd.makeproject.ui.SelectExecutablePanel$2.run(SelectExecutablePanel.java:142)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1425)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:59)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:294)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2038)
Comment 1 Alexander Simon 2014-12-30 13:58:41 UTC
Please do not download whole file if mime resolver read first bytes.
Comment 2 Quality Engineering 2015-01-14 03:14:02 UTC
Integrated into 'main-silver', will be available in build *201501140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/85d998a62097
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixed #249569 - Do not read the entire file while filtering elf and MacOS executables in file chooser
Comment 3 Vladimir Kvashin 2015-01-14 09:13:47 UTC
fixed in 
http://hg.netbeans.org/cnd-main/rev/85d998a62097