New Error caused by recent Chrome Update: RangeError: Maximum call stack size exceeded

1,805 views
Skip to first unread message

Joshb

unread,
Dec 16, 2015, 12:11:10 PM12/16/15
to GWT Contributors
Hi all.

We have a fairly large GWT application (~20MB OBF).  Recently (last week I believe) we started to encounter a RangeError: Maximum call stack size exceed in Chrome in our deployed application.  The error does not occur in FF or IE.  I downloaded older versions of Chromium and confirmed that the application still works, so I'm guessing there was a recent update to Chrome (47) that caused the issue.   

There is no problem in SDM, and after playing around with the optimization level, found that at level '0', the app loads.  At 1-9, the exception is thrown, and from what I can tell by setting a breakpoint on exception, it does not appear to be too deep in a call stack.

I realize that this is not a bug per-se of GWT, but I would think (hope) that the GWT compiler could account for browser limitations when performing optimizations, to not optimize otherwise working code into code that won't run.

Would love to supply more information if needed.  I'm hoping others have discovered the same issue, and that there is an easy solution that can squeeze into the 2.8 release.

Thanks in advance,

Josh

Gilberto Torrezan Filho

unread,
Jan 17, 2016, 11:58:52 AM1/17/16
to GWT Contributors
Hi, I have a large GWT app deployed too, and didn't notice any problem with the new Chrome. Do you use any large GWT framework, such as Vaadin or GXT? Or any framework/lib outside GWT on the client side? Or maybe any native component?

Joshb

unread,
Jan 22, 2016, 12:18:01 PM1/22/16
to GWT Contributors
Gilberto,

I've done some more digging.  Starting Chrome with --js-flags="--stack-size 60000" makes the application work.  I haven't played with the stack size to see what level breaks it.  

Interestingly, I've tried smaller modules, and the problem persists.  We are using Errai, but the reason I think the issue is more to do with GWT is that 

  • it works in SDM
  • It works when optimizations are set to 0.  In fact, the output is over 70MB and it still works.
  • it fails when optimizations are >0
This makes me think that some optimization being done by the GWT compiler is generating a stack too deep for Chrome (works fine on IE, FF, and Safari, as well as Chrome pre 47).  

My understanding of one of the promises of GWT is that it compiles separate version for different browsers.  I wouldn't think that code that otherwise works could be broken in the compilation process.  

Dominique L.

unread,
Feb 8, 2016, 11:25:37 AM2/8/16
to GWT Contributors
Hi,

I have also a large GWT application. Recently, a strange error does occur only with a recent Chrome (48 ?) : "com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'className' of null".
To fix it, we just catch the exception silently... But i am a little worried about that, because i don't know what happen.

We use GWT-2.5.1, without large GWT framework.

Other GWT users have strange errors with recent versions of Chrome?

Dominique.

Thomas Broyer

unread,
Feb 8, 2016, 11:37:12 AM2/8/16
to GWT Contributors


On Monday, February 8, 2016 at 5:25:37 PM UTC+1, Dominique L. wrote:
Hi,

I have also a large GWT application. Recently, a strange error does occur only with a recent Chrome (48 ?) : "com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'className' of null".
To fix it, we just catch the exception silently... But i am a little worried about that, because i don't know what happen.

We use GWT-2.5.1, without large GWT framework.

First thing I'd try is to update to GWT 2.7.0 (and plan an update to 2.8 when it's out).
2.5.1 is nearing 3 years old already (that's 22 versions of Chrome and counting!)

Marius Gerwinn

unread,
Mar 28, 2016, 6:01:41 AM3/28/16
to GWT Contributors
Hi Josh,

Just wan't to let you know that we're facing the same issue here. We also have a quite large app, using Errai and only experiencing the issue in the newer Chrome version.
No workaround except disabling the optimisation yet. If you found something or want some more info about our setup for better understanding I'm very happy to help.

Colin Alworth

unread,
Mar 28, 2016, 8:55:35 AM3/28/16
to GWT Contributors
The only issue I know of that causes this is https://github.com/gwtproject/gwt/issues/8233 (and also apparently https://github.com/gwtproject/gwt/issues/8229), which is fixed in GWT 2.7. This issue was caused by invoking a method with many arguments, rather than wrapping those arguments in a list and invoking with the list itself. It is possible that you haven't had enough items in the list to cause this, but that Chrome has changed the size of its stack (or some other implementation detail) and you are now tickling it.

Just a guess, but if it is the case, upgrading will solve it. If not, is it possible to get a stack trace out of the error?

--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/b996f740-4b03-4e65-ab54-b1182154256a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joshb

unread,
Mar 29, 2016, 4:37:55 PM3/29/16
to GWT Contributors

Hi Colin,

The biggest problem is that Chrome doesn't give ANY stacktrace, nor does it allow for breaking on error.  I've tried compiling with 'pretty' so I could breakpoint on error and figure out the offending code, but it won't work.

We are using GWT 2.8-beta1, but I have the same issue using 2.7.

On Monday, March 28, 2016 at 8:55:35 AM UTC-4, Colin Alworth wrote:
The only issue I know of that causes this is https://github.com/gwtproject/gwt/issues/8233 (and also apparently https://github.com/gwtproject/gwt/issues/8229), which is fixed in GWT 2.7. This issue was caused by invoking a method with many arguments, rather than wrapping those arguments in a list and invoking with the list itself. It is possible that you haven't had enough items in the list to cause this, but that Chrome has changed the size of its stack (or some other implementation detail) and you are now tickling it.

Just a guess, but if it is the case, upgrading will solve it. If not, is it possible to get a stack trace out of the error?

To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.

Joshb

unread,
Mar 29, 2016, 5:14:12 PM3/29/16
to GWT Contributors
One Idea I had was to see if it was possible to reduce the stack size in Safari or Firefox (or event IE) and see if it would give a better debug option (actually pause on exception).  Does anyone know how to do that (change the call stack size) for one of those browsers?


On Monday, March 28, 2016 at 8:55:35 AM UTC-4, Colin Alworth wrote:
The only issue I know of that causes this is https://github.com/gwtproject/gwt/issues/8233 (and also apparently https://github.com/gwtproject/gwt/issues/8229), which is fixed in GWT 2.7. This issue was caused by invoking a method with many arguments, rather than wrapping those arguments in a list and invoking with the list itself. It is possible that you haven't had enough items in the list to cause this, but that Chrome has changed the size of its stack (or some other implementation detail) and you are now tickling it.

Just a guess, but if it is the case, upgrading will solve it. If not, is it possible to get a stack trace out of the error?

To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.

Jens

unread,
Mar 29, 2016, 5:36:29 PM3/29/16
to GWT Contributors

The biggest problem is that Chrome doesn't give ANY stacktrace, nor does it allow for breaking on error.  I've tried compiling with 'pretty' so I could breakpoint on error and figure out the offending code, but it won't work.

Chrome can pause on any JavaScript error thrown, caught and uncaught ones. Go to the sources tab in Chrome DevTools, hit the small "pause" icon on the right side and check the "pause on caught exceptions" checkbox. Chrome should then pause on ANY exception thrown, so you would need to check if its the "RangeError: Maximum call stack size exceed" or not. 

If Chrome still does not pause even though you get the mentioned error then you have to talk to the Chrome guys by opening an issue to ask them how to debug that situation. Adding lots of log statements doesn't seem to be the solution.

-- J.


Joshb

unread,
Mar 29, 2016, 6:27:50 PM3/29/16
to GWT Contributors
Thanks Jens,

I'm familliar with the small 'pause' icon.  It isn't being triggered.  I actually think that the error is being thrown before Chrome starts running the code.  Does that even make any sense?  
In the chrome debugger, if I go to sources, the <CACHED>.js file doesn't even show up under the js tab.  

I realize this is getting a little (or a lot) beyong GWT discussion.  I really don't understand why it is capped so low.  Firefox is like 50k, and it runs in every other browser.

Jens

unread,
Mar 29, 2016, 7:32:57 PM3/29/16
to GWT Contributors

I'm familliar with the small 'pause' icon.  It isn't being triggered.  I actually think that the error is being thrown before Chrome starts running the code.  Does that even make any sense?  
In the chrome debugger, if I go to sources, the <CACHED>.js file doesn't even show up under the js tab.  

I realize this is getting a little (or a lot) beyong GWT discussion.  I really don't understand why it is capped so low.  Firefox is like 50k, and it runs in every other browser.

As its reproducible in your app I would suggest uploading your app (compiled using -style PRETTY) somewhere so it can be accessed by Chrome people and then open a Chrome issue. Without a JS stack trace we can't really do anything to workaround it in GWT.

-- J.
Reply all
Reply to author
Forward
0 new messages