Sentry-javascript: Infinite loop

Created on 17 Dec 2018  ·  15Comments  ·  Source: getsentry/sentry-javascript

Hi,

Following the fix of #1707, the issue (or an other one) is still active: there is an infinite loop somewhere that can be created in some situation.

I don't know how to reproduce and it but I know that addbreadcrumb is responsible for this infinite loop.
cf. https://ibb.co/KXcprWY to have more information, the function "standardizer" is called without ending.

It seems to be even worst than the previous version because I used this workaround to prevent browser crashing: initSentry({
dsn: #####,
beforeBreadcrumb(breadcrumb, hint) {
if(get( breadcrumb , "error.data.extra.arguments")) {
breadcrumb.error.data.extra.arguments = [];
}
return breadcrumb;
}
});

This workaround doesn"t work anymore, so I have to get back to the previous version. The problem is that with this workaround It seems impossible to have information about where errors happens in the code (line number etc).

Dorian

Needs Reproduction

Most helpful comment

Memory crash remains in 4.5.1 for me.
Now it's falling on safeNormalize
http://joxi.ru/GrqgYe3t4Gb1J2

Original error:

message: "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: [object Object]'. Current value: 'ngIf: true'."
stack: "Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: [object Object]'. Current value: 'ngIf: true'.↵ at viewDebugError (http://www.crexi.local:8080/vendor.js:80916:15)↵ at expressionChangedAfterItHasBeenCheckedError (http://www.crexi.local:8080/vendor.js:80904:12)↵ at checkBindingNoChanges (http://www.crexi.local:8080/vendor.js:81006:15)↵ at checkNoChangesNodeInline (http://www.crexi.local:8080/vendor.js:83877:9)↵ at checkNoChangesNode (http://www.crexi.local:8080/vendor.js:83866:9)↵ at debugCheckNoChangesNode (http://www.crexi.local:8080/vendor.js:84470:24)↵ at debugCheckDirectivesFn (http://www.crexi.local:8080/vendor.js:84398:13)↵ at Object.eval [as updateDirectives] (ng:///SignInPageModule/SignInPageComponent.ngfactory.js:86:9)↵ at Object.debugUpdateDirectives [as updateDirectives] (http://www.crexi.local:8080/vendor.js:84387:21)↵ at checkNoChangesView (http://www.crexi.local:8080/vendor.js:83765:14)↵ at callViewAction (http://www.crexi.local:8080/vendor.js:84004:21)↵ at execComponentViewsAction (http://www.crexi.local:8080/vendor.js:83966:13)↵ at checkNoChangesView (http://www.crexi.local:8080/vendor.js:83768:5)↵ at callViewAction (http://www.crexi.local:8080/vendor.js:84004:21)↵ at execEmbeddedViewsAction (http://www.crexi.local:8080/vendor.js:83987:17)↵ at checkNoChangesView (http://www.crexi.local:8080/vendor.js:83766:5)↵ at callViewAction (http://www.crexi.local:8080/vendor.js:84004:21)↵ at execComponentViewsAction (http://www.crexi.local:8080/vendor.js:83966:13)↵ at checkNoChangesView (http://www.crexi.local:8080/vendor.js:83768:5)↵ at callWithDebugContext (http://www.crexi.local:8080/vendor.js:84653:25)↵ at Object.debugCheckNoChangesView [as checkNoChangesView] (http://www.crexi.local:8080/vendor.js:84358:12)↵ at ViewRef_.push../node_modules/@angular/core/fesm5/core.js.ViewRef_.checkNoChanges (http://www.crexi.local:8080/vendor.js:82172:64)↵ at http://www.crexi.local:8080/vendor.js:78597:67↵ at Array.forEach ()↵ at ApplicationRef.push../node_modules/@angular/core/fesm5/core.js.ApplicationRef.tick (http://www.crexi.local:8080/vendor.js:78597:29)↵ at http://www.crexi.local:8080/vendor.js:78486:105↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://www.crexi.local:8080/polyfills.js:8609:26)↵ at Object.onInvoke (http://www.crexi.local:8080/vendor.js:77863:33)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://www.crexi.local:8080/polyfills.js:8608:32)↵ at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (http://www.crexi.local:8080/polyfills.js:8359:43)↵ at NgZone.push../node_modules/@angular/core/fesm5/core.js.NgZone.run (http://www.crexi.local:8080/vendor.js:77777:28)↵ at Object.next (http://www.crexi.local:8080/vendor.js:78486:81)↵ at SafeSubscriber.schedulerFn [as _next] (http://www.crexi.local:8080/vendor.js:74078:52)↵ at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (http://www.crexi.local:8080/vendor.js:231893:16)↵ at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (http://www.crexi.local:8080/vendor.js:231831:22)↵ at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (http://www.crexi.local:8080/vendor.js:231774:26)↵ at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (http://www.crexi.local:8080/vendor.js:231751:18)↵ at EventEmitter.push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next (http://www.crexi.local:8080/vendor.js:231516:25)↵ at EventEmitter.push../node_modules/@angular/core/fesm5/core.js.EventEmitter.emit (http://www.crexi.local:8080/vendor.js:74062:76)↵ at checkStable (http://www.crexi.local:8080/vendor.js:77832:35)↵ at Object.onHasTask (http://www.crexi.local:8080/vendor.js:77876:21)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.hasTask (http://www.crexi.local:8080/polyfills.js:8662:37)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate._updateTaskCount (http://www.crexi.local:8080/polyfills.js:8682:22)↵ at Zone.push../node_modules/zone.js/dist/zone.js.Zone._updateTaskCount (http://www.crexi.local:8080/polyfills.js:8506:34)↵ at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://www.crexi.local:8080/polyfills.js:8426:30)↵ at drainMicroTaskQueue (http://www.crexi.local:8080/polyfills.js:8816:35)"

All 15 comments

in my case this happens if react application in iframe with django grappelli

I have never seen this issue prior to version 4.4.2. My sentry project has a very clear transition to having a circular structor issue once 4.4.2 was released in my app. I'm reverting to 4.4.1 for now

Fixed in 4.5.0, everything is guarded for circular references now. Cheers!

Memory crash remains in 4.5.1 for me.
Now it's falling on safeNormalize
http://joxi.ru/GrqgYe3t4Gb1J2

Original error:

message: "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: [object Object]'. Current value: 'ngIf: true'."
stack: "Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: [object Object]'. Current value: 'ngIf: true'.↵ at viewDebugError (http://www.crexi.local:8080/vendor.js:80916:15)↵ at expressionChangedAfterItHasBeenCheckedError (http://www.crexi.local:8080/vendor.js:80904:12)↵ at checkBindingNoChanges (http://www.crexi.local:8080/vendor.js:81006:15)↵ at checkNoChangesNodeInline (http://www.crexi.local:8080/vendor.js:83877:9)↵ at checkNoChangesNode (http://www.crexi.local:8080/vendor.js:83866:9)↵ at debugCheckNoChangesNode (http://www.crexi.local:8080/vendor.js:84470:24)↵ at debugCheckDirectivesFn (http://www.crexi.local:8080/vendor.js:84398:13)↵ at Object.eval [as updateDirectives] (ng:///SignInPageModule/SignInPageComponent.ngfactory.js:86:9)↵ at Object.debugUpdateDirectives [as updateDirectives] (http://www.crexi.local:8080/vendor.js:84387:21)↵ at checkNoChangesView (http://www.crexi.local:8080/vendor.js:83765:14)↵ at callViewAction (http://www.crexi.local:8080/vendor.js:84004:21)↵ at execComponentViewsAction (http://www.crexi.local:8080/vendor.js:83966:13)↵ at checkNoChangesView (http://www.crexi.local:8080/vendor.js:83768:5)↵ at callViewAction (http://www.crexi.local:8080/vendor.js:84004:21)↵ at execEmbeddedViewsAction (http://www.crexi.local:8080/vendor.js:83987:17)↵ at checkNoChangesView (http://www.crexi.local:8080/vendor.js:83766:5)↵ at callViewAction (http://www.crexi.local:8080/vendor.js:84004:21)↵ at execComponentViewsAction (http://www.crexi.local:8080/vendor.js:83966:13)↵ at checkNoChangesView (http://www.crexi.local:8080/vendor.js:83768:5)↵ at callWithDebugContext (http://www.crexi.local:8080/vendor.js:84653:25)↵ at Object.debugCheckNoChangesView [as checkNoChangesView] (http://www.crexi.local:8080/vendor.js:84358:12)↵ at ViewRef_.push../node_modules/@angular/core/fesm5/core.js.ViewRef_.checkNoChanges (http://www.crexi.local:8080/vendor.js:82172:64)↵ at http://www.crexi.local:8080/vendor.js:78597:67↵ at Array.forEach ()↵ at ApplicationRef.push../node_modules/@angular/core/fesm5/core.js.ApplicationRef.tick (http://www.crexi.local:8080/vendor.js:78597:29)↵ at http://www.crexi.local:8080/vendor.js:78486:105↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://www.crexi.local:8080/polyfills.js:8609:26)↵ at Object.onInvoke (http://www.crexi.local:8080/vendor.js:77863:33)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://www.crexi.local:8080/polyfills.js:8608:32)↵ at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (http://www.crexi.local:8080/polyfills.js:8359:43)↵ at NgZone.push../node_modules/@angular/core/fesm5/core.js.NgZone.run (http://www.crexi.local:8080/vendor.js:77777:28)↵ at Object.next (http://www.crexi.local:8080/vendor.js:78486:81)↵ at SafeSubscriber.schedulerFn [as _next] (http://www.crexi.local:8080/vendor.js:74078:52)↵ at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (http://www.crexi.local:8080/vendor.js:231893:16)↵ at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (http://www.crexi.local:8080/vendor.js:231831:22)↵ at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (http://www.crexi.local:8080/vendor.js:231774:26)↵ at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (http://www.crexi.local:8080/vendor.js:231751:18)↵ at EventEmitter.push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next (http://www.crexi.local:8080/vendor.js:231516:25)↵ at EventEmitter.push../node_modules/@angular/core/fesm5/core.js.EventEmitter.emit (http://www.crexi.local:8080/vendor.js:74062:76)↵ at checkStable (http://www.crexi.local:8080/vendor.js:77832:35)↵ at Object.onHasTask (http://www.crexi.local:8080/vendor.js:77876:21)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.hasTask (http://www.crexi.local:8080/polyfills.js:8662:37)↵ at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate._updateTaskCount (http://www.crexi.local:8080/polyfills.js:8682:22)↵ at Zone.push../node_modules/zone.js/dist/zone.js.Zone._updateTaskCount (http://www.crexi.local:8080/polyfills.js:8506:34)↵ at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://www.crexi.local:8080/polyfills.js:8426:30)↵ at drainMicroTaskQueue (http://www.crexi.local:8080/polyfills.js:8816:35)"

I get the same error!

It seems that some really large environment extra arguments are causing this.
It was references to Angular classes for me.
Temporarily I have to reformat breadcrumbs to include only message, name and stack.

Sentry.init({
    beforeBreadcrumb: (breadcrumb, hint) => {

        if (breadcrumb.data && breadcrumb.data.extra && breadcrumb.data.extra.arguments) {

            breadcrumb.data.extra.arguments = breadcrumb.data.extra.arguments.map((arg: any) => {

                return {
                    message: arg.message,
                    name: arg.name,
                    stack: arg.stack
                }

            });

        }
        return breadcrumb;

    }
});

4.5.2 has been released, this version should fix the issue. Closing this for now.

Works now, thank you

Issue is reproduced in version 4.6.3 (current version at the moment) in Angular project.
Call stack:

assign (object.js:194)
decycle (object.js:282)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
decycle (object.js:294)
(anonymous) (object.js:311)
safeNormalize (object.js:320)
push../node_modules/@sentry/hub/dist/scope.js.Scope.addBreadcrumb (scope.js:183)
push../node_modules/@sentry/core/dist/baseclient.js.BaseClient.addBreadcrumb (baseclient.js:180)
push../node_modules/@sentry/hub/dist/hub.js.Hub.invokeClient (hub.js:49)
push../node_modules/@sentry/hub/dist/hub.js.Hub.addBreadcrumb (hub.js:224)
push../node_modules/@sentry/browser/dist/index.js.Breadcrumbs.addBreadcrumb (index.js:3998)
(anonymous) (index.js:3715)
View_UserDropdownComponent_6 (UserDropdownComponent.html:25)
push../node_modules/@angular/core/fesm5/core.js.DebugContext_.logError (core.js:22708)
push../node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError (core.js:14624)
dispatchEvent (core.js:19105)
(anonymous) (core.js:19548)
(anonymous) (platform-browser.js:993)
sentryWrapped (index.js:3219)
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
onInvokeTask (core.js:16126)
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:496)
invokeTask (zone.js:1540)
globalZoneAwareCallback (zone.js:1566)

@HazAT I've checked, the latest workable version is 4.5.3 at the moment

@feorex Angular attaches debug context in their development environment which is enormous object. We found the issue and patched it. Release is processing now. Will ping you (few minutes) once it's up.

@feorex could you please give a 4.6.4 a try and let us know if everything is fixed for you?

@kamilogorek Just tried 4.6.4, and I can confirm that issue is fixed for my case. Thank you very much for a quick fix!

Was this page helpful?
0 / 5 - 0 ratings