GWT app crashing on iOS 6

731 views
Skip to first unread message

Óscar Frías Barranco

unread,
Nov 6, 2012, 5:15:10 AM11/6/12
to google-we...@googlegroups.com
Hello.

Our GWT application crashes when running on an iPad with iOS 6.0.1.

This is not related to the POST caching issue because we already added Cache-Control and Expires headers to GWT RPC replies and now they are not cached.

We have "debugged" the app by adding Window.alert() calls and we have found that it crashes (randomly, not always) in places like:

HashSet.add() method
RootPanel.add() method (which includes a HashSet.add() call)
ConstantsWithLookup.getString()


It looks like iOS 6 Javascript engine has some issues, so maybe GWT is being bitten by these errors too:

http://stackoverflow.com/questions/12534409/ios-6-javascipt-intermittent-issues-with-object-defineproperty


Any ideas?

Thanks,
Oscar


Óscar Frías Barranco

unread,
Nov 6, 2012, 1:51:51 PM11/6/12
to google-we...@googlegroups.com
Hi again.

We have found that compiling with -XenableClosureCompiler hides the problem or at least mitigates it.

I have no idea about what Closure Compiler does to GWT generated javascript but apparently it is hiding iOS6 browser issues.

Oscar

Óscar Frías Barranco

unread,
Nov 7, 2012, 5:54:57 AM11/7/12
to google-we...@googlegroups.com
Just let me clarify that the ClosureCompiler does not fix the issue, it just makes it less frequent.

The issue is so weird that you can load a GWT page without any error and then just reload the same page to find that now GWT javascript crashes.  And then reload again and its OK.  It's completely random.

Daniel Kurka

unread,
Nov 7, 2012, 8:39:15 AM11/7/12
to google-we...@googlegroups.com
Do you have a uncaught exception handler in place so that we could maybe get at least a JavaScript error?

-Daniel

Óscar Frías Barranco

unread,
Nov 7, 2012, 11:01:46 AM11/7/12
to google-we...@googlegroups.com
Yes, the error that we are gettting is a ClassCastException.

Oscar

Jens

unread,
Nov 7, 2012, 11:24:11 AM11/7/12
to google-we...@googlegroups.com
Can you:

1.) compile your app in PRETTY mode so you can read JS source code easily
2.) enable iOS inspector and use Safari 6 on Mac OS to connect to your iphone/ipad for remote debugging (http://moduscreate.com/enable-remote-web-inspector-in-ios-6/)
3.) In Safari 6 web inspector go to "breakpoints" and activate "all exceptions" or "uncaught exceptions" and then check the call stack once the exception occurs. 

Maybe that gives you some hints which generated JS code exactly causes the unexpected exception.


-- J. 

Óscar Frías Barranco

unread,
Nov 7, 2012, 12:39:34 PM11/7/12
to google-we...@googlegroups.com
Hi.

Unfortunately I don't have a Mac.  But I compiled in PRETTY mode without ClosureCompiler and I have isolated one of the points where iOS 6 crashes.  In this case there is no exception thrown.  Javascript just halts.

In the following code, the first alert ('before PriceEvol') is displayed, but not the second one.  The original Java code for this fragment is:

  Window.alert("before PriceEvol");
  sidePriceEvolutionBox = RootPanel.get("PriceEvolutionLink");
  Window.alert("after PriceEvol");


And the compiled code is:

  alert_0('before PriceEvol');
  sidePriceEvolutionBox = get_1('PriceEvolutionLink');
  alert_0('after PriceEvol');



With the function defined as:

function get_1(id){
  $clinit_RootPanel();
  var elem, rp;
  rp = dynamicCast(rootPanels.get(id), Q$RootPanel);
  elem = null;
  if (id != null) {
    if (!(elem = $getElementById($doc, id))) {
      return null;
    }
  }
  if (rp) {
    if (!elem || rp.element == elem) {
      return rp;
    }
  }
  if (rootPanels.size_1() == 0) {
    addCloseHandler(new RootPanel$2_0);
    ($clinit_LocaleInfo() , false) && setDirectionOnElement($doc, ($clinit_HasDirection$Direction() , RTL));
  }
  !elem?(rp = new RootPanel$DefaultRootPanel_0):(rp = new RootPanel_0(elem));
  rootPanels.put(id, rp);
  $add_15(widgetsToDetach, rp);
  return rp;
}



Óscar



--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/0KYVMl5jLpIJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

mkn

unread,
Jan 14, 2013, 2:54:41 PM1/14/13
to google-we...@googlegroups.com
Hi

Could you solve your problem in the meantime?

Óscar Frías Barranco

unread,
Jan 15, 2013, 4:53:40 AM1/15/13
to google-we...@googlegroups.com
No.  It still persists.

Are you facing a similar problem ?

Oscar

mkn

unread,
Jan 15, 2013, 5:03:29 AM1/15/13
to google-we...@googlegroups.com
Yes. The problem is that I cannot reproduce the crash every time. I have a view which sometimes crashes (safari just closes), but there is no specific way to reproduce the crash. It just sometimes happens. When I look at the crash report of the ipad, it just says invalid memory access. It looks like that the safari browser allocates to much space (javascript runtime size I guess) and then safari frees something up, which is being read afterwards causing the crash.

Remote debugging does also not help here, because as soon as the browser crashes, the remote debugging window shuts down too.

mkn

unread,
Jan 16, 2013, 7:42:30 AM1/16/13
to google-we...@googlegroups.com
So how do you handle the situation? 

Óscar Frías Barranco

unread,
Jan 16, 2013, 10:33:35 AM1/16/13
to google-we...@googlegroups.com
We haven't done anything else for the moment.  We hope iOS 6.1 or the next version of GWT fixes it.

By the way, probably related bug:

http://code.google.com/p/google-web-toolkit/issues/detail?id=7831

Maybe if you (and more people) star it the GWT team will prioritize it (and will either fix it or chase Apple team to fix it).

Óscar
Reply all
Reply to author
Forward
0 new messages