microsoft / microsoft/vscode

ripgrep follows symlinks to directories above workspace, 800% CPU and gigabytes of logs

Open
#336,327 0 comments 0 reactions 1 assignee Claimed by @osortega View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Yes

- VS Code Version: Insiders 1.139.0
- OS Version: EndeavourOS current

Steps to Reproduce:

1. Enable the npm or typescript-language-features extensions
2. Add a directory to a workspace
3. In that directory, create a symlink to `/`
4. Save and close the workspace
5. Reopen the workspace, which triggers task provider scans (e.g. [npm searches for `**/package.json`](https://github.com/microsoft/vscode/blob/642d3e2735e47bcb58658dbb6290c45abddf758f/extensions/npm/src/tasks.ts#L409), [ts searches for `**/tsconfig*.json`](https://github.com/microsoft/vscode/blob/642d3e2735e47bcb58658dbb6290c45abddf758f/extensions/typescript-language-features/src/task/tsconfigProvider.ts#L37), etc) and `workspaceContains` to [search for globs](https://github.com/microsoft/vscode/blob/642d3e2735e47bcb58658dbb6290c45abddf758f/src/vs/workbench/services/extensions/common/workspaceContains.ts#L113) in extension activation events.
6. Observe `rg` processes consuming multiple cores at 100%, logging hundreds of thousands of lines of stderr about not being able to read /proc and /dev, etc.

Upstream fix PRs:

https://github.com/BurntSushi/ripgrep/pull/3534
https://github.com/BurntSushi/walkdir/pull/220

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.