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

React Navigation routing performance tracking: 'Maximum call stack size exceeded' in the /utils library #5172

Closed
3 tasks done
gre opened this issue May 27, 2022 · 3 comments
Closed
3 tasks done
Labels
Package: core Issues related to the Sentry Core SDK Type: Bug

Comments

@gre
Copy link

gre commented May 27, 2022

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/react

SDK Version

6.19.2

Framework Version

3.4.2 (react-native)

Link to Sentry event

https://sentry.io/share/issue/12e378b1436545c0828853d15354b7c7/

Steps to Reproduce

When using the Performance tracking in combination with React Native and the automatic instrumentation defined in https://docs.sentry.io/platforms/react-native/performance/instrumentation/automatic-instrumentation/ for the React Navigation routing, if you have "recursive objects" passed as route parameter, Sentry will badly crashes with "Maximum call stack size exceeded".

(NB: was asked to report in a new issue from #2470 (comment) )

Expected Result

Unfortunately Sentry logic isn't very protective and not preventing infinite loop in objects. an object that have nested inside some reference of a parent will infinitely make dropUndefinedKeys loop https://github.com/getsentry/sentry-javascript/blob/master/packages/utils/src/object.ts#L197

There is nothing "wrong" with the user land code actually it's crashing inside Sentry logic (at least for us) as soon as you pass a recursive object in navigation.

Not exactly sure how to fix this in the utils logic, but one policy could be to have a max depth in the recursion.

Actual Result

it badly crash the app of our users when the performance monitoring is active for them. see attached event.

@lforst
Copy link
Member

lforst commented May 27, 2022

Hi @gre, thanks for raising this issue. I saw your comment in #2470 (comment).

We are currently working on a fix for the SDK to be more defensive when being passed objects with circular references.

You can track progress in:

The proper fix will probably be included in one of the first patches of version 7 so keep an eye out for that.

@lforst lforst added Status: In Progress Package: core Issues related to the Sentry Core SDK and removed Status: Untriaged labels May 27, 2022
@gre
Copy link
Author

gre commented May 27, 2022

@lforst awesome to hear. thanks

@lforst
Copy link
Member

lforst commented Jun 10, 2022

I'm gonna close this issue for now as we fixed this in 7.1.0. Please use 7.1.1 though as 7.1.0 was buggy.

Feel free to ping me if the problem persists on new versions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: core Issues related to the Sentry Core SDK Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants