Sentry-javascript: setExtra on objects with circular references causes out of memory exception

Created on 25 Jul 2019  路  2Comments  路  Source: getsentry/sentry-javascript

Package + Version

  • [x] @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

Confirmed Bug

Most helpful comment

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

All 2 comments

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

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.

Was this page helpful?
0 / 5 - 0 ratings