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

Call stack size exceeded when calling setPaintProperty in a loop #5179

Closed
rychoo2 opened this issue Aug 22, 2017 · 5 comments
Closed

Call stack size exceeded when calling setPaintProperty in a loop #5179

rychoo2 opened this issue Aug 22, 2017 · 5 comments
Labels

Comments

@rychoo2
Copy link

rychoo2 commented Aug 22, 2017

Hello,

I am trying to imitate line animation updating line-dasharray property with a setInterval.
Here is the jsfiddle with animation step intentionally set to 1ms to speed up the error to occur:
https://jsfiddle.net/2mws8y3q/2/

The problem is that after several minutes of running, the mapbox crashes with error:

 mapbox-gl.js:307 Uncaught RangeError: Maximum call stack size exceeded
    at Array.toString (native)
    at StyleDeclaration.calculate (https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js:307:1044)
    at StyleTransition._calculateTargetValue (https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js:323:1422)
    at StyleTransition.calculate (https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js:323:970)
    at StyleTransition.calculate (https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js:323:1093)
    at StyleTransition.calculate (https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js:323:1093)
    at StyleTransition.calculate (https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js:323:1093)
    at StyleTransition.calculate (https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js:323:1093)
    at StyleTransition.calculate (https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js:323:1093)
    at StyleTransition.calculate (https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js:323:1093)

mapbox-gl-js version:0.39.1

Steps to Trigger Behavior

  1. Open JS Fiddle above
  2. Wait for ~10-15 mins
  3. See console log

Expected Behavior

Animation continues to run

Actual Behavior

Animation stops, mapbox GL crashes.

@rychoo2
Copy link
Author

rychoo2 commented Aug 27, 2017

Actually, for some reason I am not getting this error anymore. Anyone was able to reproduce the issue?
Could have been some temporary problem with my browser.

@jfirebaugh
Copy link
Contributor

It's definitely a bug, and can be reproduced by running the dancing buildings example for a while.

@rychoo2
Copy link
Author

rychoo2 commented Aug 30, 2017

Ok, I can confirm I got this error again a few more times. But it seems intermittent.

@rychoo2
Copy link
Author

rychoo2 commented Aug 31, 2017

As a workaround I added line-dasharray-transition property to set delay and duration to 0:

"line-dasharray-transition": {
"duration": 0,
"delay": 0
}

https://jsfiddle.net/2mws8y3q/3/

@mourner
Copy link
Member

mourner commented Jul 25, 2018

This is likely to have been fixed in #5682 or subsequent refactors, so let's close for now and reopen if there's an evidence of a similar error occurring again.

@mourner mourner closed this as completed Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants