Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Crash using Find in Files on large repositories, Sprint 34 #6091

Closed
Krindi opened this issue Nov 23, 2013 · 13 comments
Closed

Crash using Find in Files on large repositories, Sprint 34 #6091

Krindi opened this issue Nov 23, 2013 · 13 comments
Assignees

Comments

@Krindi
Copy link

Krindi commented Nov 23, 2013

Using Control + Shift + F (Edit > Find in Files) in a large repository causes a program crash.

Sprint 34 with no extensions
Size of repository : 2.34 GiB, very image heavy, 2606 files in 310 folders
Live Preview : not being utilized
Site in question was originally written in ASP.NET from Visual Studio 2012, if that matters.

"The exception Breakpoint
A breakpoint has been reached.
(0x80000003) occurred in the application at location 0x55e758e0

Click on OK to terminate the program"

The error message doesn't always occur, sometimes just "Brackets has stopped working". When the Application Error message comes up, two hex numbers were the same 100% of the time.

Memory usage with the repository open is around 9 MB, during multiple attempts to find a .jpg in this repository the highest memory usage witnessed was 915 MB. Usually it hit's "not responding" when it clears 200 MB memory use, and crashes after some variable period of time.

Running the same test against a smaller repository of 277 MB, but still image heavy, showed interesting behavior. The "Find in Files" took 28 seconds to complete, and disk activity reached as high as 19 MB/s.

My system has 16 MB of RAM, and CPU utilization during the crash out doesn't exceed 12%. For comparison, the same search in Visual Studio 2012 takes less than 2 seconds and increases RAM utilization by approximately 3 MB, and there is no disk activity.

@Skaidon
Copy link

Skaidon commented Nov 23, 2013

I've come across this issue also, but with no shareable statistics other than I'm also running on 16GB of RAM.

@peterflynn
Copy link
Member

We have an upper limit for number of files indexed, but in this case it sounds like the problem is there's a smaller number of files but they are very large in size. At the very least we should filter out image files from Find in Files -- seems like that would help in this scenario.

@Krindi can you clarify though, what you mean by "multiple attempts to find a .jpg in this repository"? Find in Files searches for text within a file, so you couldn't use it to search for an image file (or any other non-text file). To search for files by file name, you should use Quick Open -- which is many, many times faster.

@ghost ghost assigned peterflynn Nov 23, 2013
@SgtPooki
Copy link

@peterflynn it does sound like he's trying to actually find a jpg. If images aren't already filtered out of find in files it definitely should be.

@Krindi
Copy link
Author

Krindi commented Nov 25, 2013

@peterflynn Sorry if I wasn't clear enough. I was using Find in Files to determine what file an image was used in, i.e. searching for text within text files. My suspicion was that non-text files (images and PDFs in my case) were impacting the search result.

Perhaps having an option in Find in Files to specify a set of file types to search within? (That's customizable?)

@Krindi Krindi closed this as completed Nov 25, 2013
@Krindi
Copy link
Author

Krindi commented Nov 25, 2013

Clicked wrong button and closed by accident.

@Krindi Krindi reopened this Nov 25, 2013
@Skaidon
Copy link

Skaidon commented Nov 25, 2013

In my case I was searching for "string_based_name" in all files within a project/folder.

1700+ files, including images but my intention was to search within text based files.

Just in case that helps.

@marcelgerber
Copy link
Contributor

I don't know any reason why to search within pictures, as the raw output isn't human-readable normally, so maybe we should ignore images at all (not only as a setting).

@peterflynn
Copy link
Member

@Krindi Does this issue still happen in recent versions of Brackets? We should no longer be reading image files during a search operation.

Closing for now on that assumption, but please let me know if you're still seeing problems and I'll reopen this.

@Krindi
Copy link
Author

Krindi commented Mar 19, 2014

@peterflynn It's sort of resolved now. The addition of a filter helped narrow down the problem.
I pulled down Sprint 37 experimental build 0.37.0-12014 and ran the same test that I had done previously and the results were virtually identical.

i.e. Sometimes "Brackets has stopped working" pops up, sometimes it's also accompanied with an Application Error:
The exception Breakpoint
A breakpoint has been reached.
(0x80000003) occurred in the application at location 0x5b9558e0.

In either case, the program closes after interacting with the dialog box. The project I'm searching within has 2842 files.

I did some more testing, and if I filter it to exclude ".svn" and "*.pdf" then the Find in Files works not just correctly, but almost instantly - the behavior I had originally expected. So that's a work around for now. If I only have one or the other filtered then the program still crashes. Whether or not image files are filtered has no effect, so seems to be correctly filtering those out.

Some relevant details on the project I was testing with:
pdf - 74 files at 942mb
.svn - 1787 files at 1.28gb

peterflynn added a commit that referenced this issue Mar 21, 2014
* Recognize a wider variety of HTML templates embedded in script tags
* Remove generic "clike" language declaration that no files map to - seems
unneeded, and clutters the dropdown in PR #6409
* Add missing commenting syntax to Scala language
* Automatically filter out a variety of common binary file types from Find
in Files (it already checks isBinary) - note that this does not affect Mac,
where all binary file IO fails automatically. Helps reduce bugs like #6091.
Leaves the ProjectManager.isBinary() API in place for now, since it also
excludes files from Quick Open and other getAllFiles() clients that don't
yet check isBinary via LanguageManager.
* Fix incorrect code in Find in Files that only narrowly avoids creating
bugs where filtered-out files are incorrectly added to search results.
@peterflynn
Copy link
Member

@Krindi Are you sure the .svn part is required in your filter? Brackets should be filtering out .svn folders automatically (you shouldn't even see it listed in the project folder tree, for example). If filtering *.pdf alone isn't enough to fix this, please let me know -- I'd like to reopen and do some investigation about why .svn isn't getting excluded automatically.

@Krindi
Copy link
Author

Krindi commented Mar 21, 2014

On 3/21/2014 3:19 PM, Peter Flynn wrote:

@Krindi https://github.com/Krindi Are you sure the .svn part is
required in your filter? Brackets should be filtering out .svn folders
automatically (you shouldn't even see it listed in the project folder
tree, for example). If filtering *.pdf alone isn't enough to fix this,
please let me know -- I'd like to reopen and do some investigation
about why .svn isn't getting excluded automatically.


Reply to this email directly or view it on GitHub
#6091 (comment).

@peterflynn You're correct, repeating the test today indicates that the
.svn filter is not required, only the *.pdf filter. I could've sworn
when I tested with *.pdf only previously that it crashed out, but it's
not being an issue today.

@peterflynn
Copy link
Member

Whew! I'm glad to hear it :-) Fwiw, I'm trying to get a fix into the next build to be smarter about auto-excluding common binary types like .pdf (currently we only exclude images, which are probably the most common binary type in web projects, but far from the only -- as you've demonstrated).

@peterflynn
Copy link
Member

PR #7290 should prevent this particular case from recurring, and this user story should help block binary files from taking up memory more generally.

turhothgor-dev pushed a commit to turhothgor-dev/brackets that referenced this issue Mar 29, 2014
* Recognize a wider variety of HTML templates embedded in script tags
* Remove generic "clike" language declaration that no files map to - seems
unneeded, and clutters the dropdown in PR adobe#6409
* Add missing commenting syntax to Scala language
* Automatically filter out a variety of common binary file types from Find
in Files (it already checks isBinary) - note that this does not affect Mac,
where all binary file IO fails automatically. Helps reduce bugs like adobe#6091.
Leaves the ProjectManager.isBinary() API in place for now, since it also
excludes files from Quick Open and other getAllFiles() clients that don't
yet check isBinary via LanguageManager.
* Fix incorrect code in Find in Files that only narrowly avoids creating
bugs where filtered-out files are incorrectly added to search results.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants