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

Closing large outline Maximum call stack size exceeded #235889

Open
RedCMD opened this issue Dec 12, 2024 · 2 comments · May be fixed by #235893
Open

Closing large outline Maximum call stack size exceeded #235889

RedCMD opened this issue Dec 12, 2024 · 2 comments · May be fixed by #235893
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug perf tree-widget Tree widget issues
Milestone

Comments

@RedCMD
Copy link
Contributor

RedCMD commented Dec 12, 2024

Closing a file with a very large outline open causes a Max Call Stack Error

Steps to Reproduce:

  1. change json.maxItemsComputed to 50000000
"json.maxItemsComputed": 50000000
  1. open file 200k comments lag.json
  2. open outline
  3. close file
  4. notice max call stack errorImage

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

  • VS Code Version: 1.96.0
  • OS Version: Windows 11
faraon-bot added a commit to faraon-bot/vscode that referenced this issue Dec 12, 2024
Fixes microsoft#235889

Implement an iterative approach to manage the outline in the `OutlineModel` class.

* Add a stack to handle the children of the outline elements iteratively in the `_makeOutlineElement` method.
* Replace the recursive call with a loop that processes the stack in the `_makeOutlineElement` method.
* Add a stack to handle the children of the document symbols iteratively in the `_flattenDocumentSymbols` method.
* Replace the recursive call with a loop that processes the stack in the `_flattenDocumentSymbols` method.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/microsoft/vscode/issues/235889?shareId=XXXX-XXXX-XXXX-XXXX).
@jrieken jrieken added outline Source outline view issues tree-widget Tree widget issues bug Issue identified by VS Code Team member as probable bug and removed outline Source outline view issues new release labels Dec 12, 2024
@jrieken jrieken assigned benibenj and unassigned jrieken Dec 12, 2024
@benibenj benibenj added this to the January 2025 milestone Dec 12, 2024
@jrieken
Copy link
Member

jrieken commented Dec 12, 2024

@benibenj #235926 fixes the call size error (basically ...hugeArray ruins the stack) but there is more to it.

Once the doesn't fail anymore, you'll notice that getViewState is very slow, freezing the renderer 1.5sec. So, I'd suggest to keep this issue to fix the perf (maybe add an upper bound)

Image

@RedCMD
Copy link
Contributor Author

RedCMD commented Dec 12, 2024

how come the tree is being updated?
shouldn't it be getting destroyed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug perf tree-widget Tree widget issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants