Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File search can exceed max string length #11842

Closed
baoziv587 opened this issue Sep 11, 2016 · 12 comments
Closed

File search can exceed max string length #11842

baoziv587 opened this issue Sep 11, 2016 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority search Search widget and operation issues verified Verification succeeded

Comments

@baoziv587
Copy link

baoziv587 commented Sep 11, 2016

- VSCode Version: 1.5.1

- OS Version:mac OS X 10.11.6

Steps to Reproduce:

  1. open file search window (command+p)
  2. input something

I can not get any file search result in my project after updating The latest version of vscode(1.5.1).

And i noticed that when i am typing some keyword of file name ,CODE will generate some subprocess do these search job with 80 percent of the CPU cost

vs-pic

Function decodeData(invoked by Class FileWalker) always got same error('vs/workbench/services/search/node/fileSearch.ts').

I did not find out the reason , hope these info is helpful.

errinfo

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority search Search widget and operation issues labels Sep 11, 2016
@bpasero
Copy link
Member

bpasero commented Sep 11, 2016

@chrmarti fyi

@shaoshuai0102
Copy link

Same problem here. Find processes take nearly 100 percent of my CPU.

@chrmarti
Copy link
Contributor

The error appears to indicate the process ran out of memory. It looks like the find command doesn't always terminate or is spawned multiple times. Not sure if decoding might play a role here.

@baoziv587 could you run time (find -L . -type f | wc -c) in your project folder and paste the output here? That might allow us to assess if it is something with the find command itself.

@bpasero are there known issues with node's built-in string_decoder module, should I be using iconv-lite instead?

@baoziv587
Copy link
Author

@chrmarti

the output

672575727
( find -L . -type f | wc -c; ) 3.90s user 21.72s system 108% cpu 23.625 total

@bpasero
Copy link
Member

bpasero commented Sep 13, 2016

@chrmarti iconv is only used to decode non-utf8 to utf8 and when utf8 is set it falls back to use the node.js decoder. You think this is an encoding issue?

@chrmarti
Copy link
Contributor

Not encoding related then. That string is simply too long.

@baoziv587 Could you also run time (find -L . -type f | wc -l); echo $?? That will tell us how many files your project folder has and what exit code the find command has. This is to better understand why the output of find is so large.

@baoziv587
Copy link
Author

baoziv587 commented Sep 13, 2016

@chrmarti

the output


3285397
( find -L . -type f | wc -l; ) 2.43s user 19.93s system 103% cpu 21.554 total
0

@baoziv587
Copy link
Author

@chrmarti Perhaps because of these floders. If skip these folders ,there are alright

@shaoshuai0102 you also install node_modules with cnpm?

image

@chrmarti
Copy link
Contributor

Thanks @baoziv587. I will use this report to track the string size problem and #11874 the underlying problem that we retrieve the entire file list before applying the exclusion filters.

@chrmarti chrmarti changed the title file search service unstable on mac File search can exceed max string length Sep 13, 2016
@chrmarti
Copy link
Contributor

The underlying problem is fixed in the latest insiders build. Will still address this one.

@baoziv587
Copy link
Author

ok,thanks @chrmarti

@roblourens roblourens added the verified Verification succeeded label Oct 27, 2016
@roblourens
Copy link
Member

Verified by code review

@chrmarti chrmarti added this to the September 2016 milestone Feb 21, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority search Search widget and operation issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants