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

Error: "Maximum call stack size exceeded" for getCommitTree #19839

Closed
mungojam opened this issue Sep 15, 2020 · 8 comments · Fixed by #21383
Closed

Error: "Maximum call stack size exceeded" for getCommitTree #19839

mungojam opened this issue Sep 15, 2020 · 8 comments · Fixed by #21383

Comments

@mungojam
Copy link

Describe what you were doing when the bug occurred:

  1. Clicking back to go back through the frames following a profile session. I think I got to zero and then clicked it again and then it errored

Please do not remove the text below this line

DevTools version: 4.8.2-fed4ae024

Call stack: at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17661:26)
at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)
at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)
at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)
at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)
at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)
at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)
at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)
at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)
at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)

Component stack: at CommitRankedAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:31963:48)
at div
at div
at div
at SettingsModalContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:26139:23)
at Profiler_Profiler (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:33363:48)
at ErrorBoundary (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:27172:5)
at PortaledContent (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:27303:32)
at div
at div
at ProfilerContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:30463:23)
at TreeContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:22538:23)
at SettingsContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:23040:27)
at ModalDialogContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:28328:23)
at DevTools_DevTools (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:33797:21)

@engprodigy
Copy link

@mungojam Please how do I replicate this? I don't seem to be able to replicate it.

@mungojam
Copy link
Author

sorry, I won't have time to create a mre. I was doing a recording on a site with a lot of components and a lot of frames in the recording. I ended up going to maybe frame 30 then clicking back rapidly to get back to 0 and I guess went to far or something. Feel free to close this, I thought that the logs might be enough and it was encouraging me to submit the issue.

@omarsy
Copy link
Contributor

omarsy commented Sep 26, 2020

Can I have a look ?

@omarsy
Copy link
Contributor

omarsy commented Sep 26, 2020

Maybe change this recursive function


And use a loop going to correct the issue. If it is ok, i can work on it.

@ramyatrouny
Copy link

@omarsy can you share how you were able to replicate the issue?

@bvaughn bvaughn changed the title Error: "Maximum call stack size exceeded" Error: "Maximum call stack size exceeded" for getCommitTree Apr 28, 2021
@bvaughn
Copy link
Contributor

bvaughn commented Apr 28, 2021

I think for there to be a stack overflow from getCommitTree calling itself, it would need to have profiling data with thousands (?) of commits. This function only recurses (at most) once per commit when processing data, and then, too, only if you jump through commits you haven't yet processed (so 0 -> N would recurse N times).

That being said, it seems like we could also rewrite this function to be iterative without too much trouble. Done in PR #21383!

@mungojam
Copy link
Author

I think for there to be a stack overflow from getCommitTree calling itself, it would need to have profiling data with thousands (?) of commits.

That's quite possible actually. The issue I was trying to diagnose was high CPU usage on an app that has spreadsheet like functionality, i.e. lots of components so I was trying to see exactly what was taking all the CPU time.

Thanks for the PR. Hopefully next time this crops up it will solve it.

@bvaughn
Copy link
Contributor

bvaughn commented Apr 28, 2021

Great 🙇🏼 Should be released sometime in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants