Bug 149428 - Binary search thread tries to open Fifos
Summary: Binary search thread tries to open Fifos
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.0 M5   Edit
Assignee: Alain Magloire CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
: 208808 220163 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-03 03:23 EDT by Christoph Höger CLA
Modified: 2008-06-20 10:36 EDT (History)
4 users (show)

See Also:


Attachments
Don't try to parse files of 0 length. (918 bytes, patch)
2006-08-07 12:08 EDT, James Blackburn CLA
no flags Details | Diff
Patch to use EFS instead of java.io.file (4.30 KB, patch)
2006-08-23 17:23 EDT, James Blackburn CLA
no flags Details | Diff
2nd time lucky (4.90 KB, patch)
2006-08-23 17:47 EDT, James Blackburn CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Höger CLA 2006-07-03 03:23:35 EDT
Hi,

when I opened a simple C-Project this weekend Eclipse hung while "searching for binaries" A deeper look with the jdb showed that I had an Unix named pipe in the project directory and the thread tried to read data from it. This, of course, blocked it.
So I consider to first look at the filesize before opening a file, if it has 0 bytes it will propably not be executable.
Comment 1 James Blackburn CLA 2006-08-07 09:08:52 EDT
We have a similar problem.  One of our build trees contains a Linux fs for an embedded target - complete with device nodes...
The Binary Parser seems to deadlock nicely on this tree.  Should probably confirm that the file is a regular file before attempting to read it.
Comment 2 James Blackburn CLA 2006-08-07 12:08:10 EDT
Created attachment 47479 [details]
Don't try to parse files of 0 length.
Comment 3 Thomas Fletcher CLA 2006-08-17 16:59:02 EDT
Applied to HEAD
Comment 4 David Inglis CLA 2006-08-21 11:02:15 EDT
This should really use the EFS API in org.eclipse.core.filesystem, instead of java.io.File
Comment 5 Thomas Fletcher CLA 2006-08-21 11:39:20 EDT
(In reply to comment #4)
> This should really use the EFS API in org.eclipse.core.filesystem, instead of
> java.io.File

Very true ... I'll take this one back until I fix it.
Comment 6 James Blackburn CLA 2006-08-23 17:23:43 EDT
Created attachment 48528 [details]
Patch to use EFS instead of java.io.file

I changed the patch to use EFS and IFileStore/IFileInfo.  I think it's correct, but don't have a suitable build tree here to check.  Will confirm at work tomorrow.

There were also a couple of other instances of java.io.File.  I've replaced those with the equivalent EFS incantation, again unchecked - that said, the patch is trivial...

Of note there doesn't seem to be an equivalent java.io.File.isFile() method.  Instead I've checked for !isDirectory()  (which may or may not be equivalent http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#isFile() ...)
Comment 7 James Blackburn CLA 2006-08-23 17:47:02 EDT
Created attachment 48533 [details]
2nd time lucky

(struggling with bugzilla upload this evening...)
Comment 8 James Blackburn CLA 2006-08-24 11:48:13 EDT
Just to confirm: no problems with the Binary Parser on the dodgy source tree with the EFS patch.  (Haven't applied the other java.io.File patches to my tree... :P)
Comment 9 Alain Magloire CLA 2006-12-16 20:00:55 EST
Thanks for looking at this James, sorry it took so long.
Comment 10 Alain Magloire CLA 2006-12-16 20:02:37 EST
A slightly different version then the propose patch was committed to the head, we simply
use IFileInfo.getLength() == EFS.NONE to make the distinction.
Comment 11 Anton Leherbauer CLA 2007-11-06 03:48:04 EST
*** Bug 208808 has been marked as a duplicate of this bug. ***
Comment 12 Anton Leherbauer CLA 2008-03-25 06:14:35 EDT
*** Bug 220163 has been marked as a duplicate of this bug. ***