Skip to content

setExtra on objects with circular references causes out of memory exception #2178

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

Closed
1 task done
jameshulse opened this issue Jul 25, 2019 · 2 comments · Fixed by #2404
Closed
1 task done

setExtra on objects with circular references causes out of memory exception #2178

jameshulse opened this issue Jul 25, 2019 · 2 comments · Fixed by #2404

Comments

@jameshulse
Copy link

Package + Version

  • @sentry/browser

Version:

5.2.0 but can't see a fix to affected line in master

Description

An error is being thrown and using the Vue integration I believe it is automatically collecting prop data. Inside the scope.ts setExtra call we are hitting an infinite loop / out of memory exception because the object passed is very large or has circular references.

It appears that the solution would be to pass a 'depth' parameter to the normalize function. It appears that a similar issue has been raised and fixed before for bread crumbs and it was decided to hard code the depth to 2. I assume the fix will be similar.

Thanks

@vandamm
Copy link

vandamm commented Sep 5, 2019

Also happens for us. Seems like normalize function already accepts a depth param, but it's not used in setExtra call

@kamilogorek
Copy link
Contributor

cc @HazAT I think limiting any scope data (extra, contexts, user) to 3 levels deep sounds reasonable, as more than this would be hard to display in the UI anyway.
We could make it configurable somehow as well in one way or another.

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