Identifying the cause of WebGL crashes on IoS/Android devices - javascript

I’ve been developing a game which uses WebGL for rendering, and while on PC I get no crashes, on Android/IoS devices I get random crashes during gameplay.
I don’t see any particular areas that would cause crashes, however it still does.
Considering the conditions and frequency that it occurs, I’m thinking it could be a memory leak or allocation failure, but I can’t find a way to analyze this for sure.
I’ve tried changing browsers, so on Chrome/Firefox/Safari it crashes, but on Opera or Armorfly it doesn’t. Additionally, according to the browser the symptoms are different.
I’m using textures (about DreawCall: 70~100, createTexture: 120~200) which draws over 500MB of VRAM, so I’m also thinking it could be that the GPU’s garbage collection isn’t doing its job in time.
The problem is that I can’t find any sort of values or logs anywhere to help me diagnose the problem.
I’ll list the symptoms more closely here:
On Android, while using Chrome, on the Android Debug Bridge’s logcat the error does not show up in the log.
On crash, no error codes or anything appear on the screen.
When I try to remotely debug it using Developer Tool on my PC, again no errors appear in the console.
Similarly, when using IoS and Safari, nothing in Instrument’s log.
So here are my questions:
In this situation, how am I meant to debug and find the problem?
Is there anybody that’s had these sorts of problems? If so, how did you solve it?
Is there any advice I can be given that I can pay more closer attention to when developing the program?
Thanks

Related

How to identify the cause of a Safari crash on iOS?

We have a webapp that is very javascript intensive - a lot of activity with custom markers on google maps and potentially a lot of items on the page.
Intermittently and unpredictably, Safari on iOS will give the 'A problem occurred with this webpage so it was reloaded' error.
The majority of the time, this happens after a photo has been input and resized by the broswer - an upload hasn't happened yet.
In researching potential issues, I've found the following links
https://discussions.apple.com/thread/6707626?tstart=0
https://www.quora.com/When-Safari-says-A-problem-occurred-with-this-webpage-so-it-was-reloaded-what-sort-of-problem-has-likely-occurred
The real question is how do I identify the cause of the crash? This never occurs on desktop so working out if it's an iOS limitation, a memory issue, a resizing problem or another cause is incredibly difficult.
I've connected an iPhone to a Mac to run the web inspector on the phone but this crash just terminates the whole process without logging any errors so there is no help there either.
Also, there is no reliable way to reproduce the issue - it just happens 'sometimes' with no consistent feature as to what the cause may be.
Thanks in advance.
You've tried this? :
connect your Phone to your Mac and
start xcode
open Window->Organizer->Devices tab->Console and see if there are Errors while reproducing the issue.

How do I use Glimpse to find out what is causing my ASP.NET MVC application to hang?

I have an ASP.NET MVC application that makes pretty heavy use of javascript and JQuery for both administrative functions as well as customer-facing functions. Recently I reorganized the administrative screens to be able to more cleanly fit administrative controls for some new features.
I tested using IE and Chrome and found that there was a slight, but acceptable hang in one of the busier pages. However, the main person who uses the admin pages uses Firefox and kept reporting an unacceptable hang. I finally checked it out and found that what hangs in Chrome and IE for 2-3 seconds hangs in Firefox for 10-12 seconds, which is no good.
Not knowing where to turn, I wound up installing Glimpse and got it configured and running just fine, but I'm still having trouble figuring out how to drill into it to find out what area of the page is causing trouble. All I can tell so far is that it is definitely something with how the client (Firefox) is rendering. To be clear, it happens on all browsers, but for some reason it is way more pronounced in Firefox.
Can someone please give me some pointers on how to get started on diagnosing the issue? I'm not married to the idea of using Glimpse, but it seems like a pretty decent tool from what I can tell.
Thanks for your help.
Based on what you're describing, the problem appears to be client side. With that said, Glimpse may not be as well-suited as using Firefox's own profiler.
SHIFT+F5 will bring up the web developer performance screen. From there, you can begin/end a performance analysis and gain more insight into what may be taking longer than expected.
It may also be worthwhile to look at the network tab and make sure assets are loading in a timely manner.
Keep in mind as well that add-ins could play into the latency. If the end-user has a setup that performs post-page processing (such as Greasemonkey scripts or (recalling an earlier add-in) a Skype plugin that used to transform phone numbers on the page to direct-dial links), that would also play a part in the performance. A good way to rule these out is to hold down SHIFT while starting up Firefox (effectively running it in Safe Mode), which would determine if it's Firefox itself or an add-in that's to blame.

Why would my app crash in Chrome if I refresh a few times?

I'm building a web app that does a lot of DOM manipulation and uses CSS3 effects.
I'm repeatedly refreshing the page, and on every 4th or 5th reload, Chrome displays the Aw, snap page indicating a tab crash. I think the page is consistently crashing around that many refreshes, so I don't think it's a probabilistic thing, but rather stems from something building up.
How can I examine Chrome crashes to find out some potential culprit causes? I've tried taking CPU profiles and heap snapshots, and it doesn't look like I'm accumulating much memory.
We to are experiencing the same thing in latest chrome version 40.0.2214.111 on multiple computers.
We logged a bug with Chromium here: https://code.google.com/p/chromium/issues/detail?id=456365
Feel free to add comments / star to help get on their radar.
It seems tough to debug as there is no crash data and running debug tools themselves will cause crashes.
We have not been able to re-produce in Chrome Canary.
We were having the same issue using last version of chrome (40.0.2214.111).
In our case the app is using SoundJS and if we disable webaudio api for this library, the app is working ok.
if (navigator && navigator.userAgent && navigator.userAgent.match("40.0.2214.111")) {
createjs.Sound.registerPlugins([createjs.HTMLAudioPlugin]);
} else {
createjs.Sound.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin, createjs.FlashPlugin]);
}
don't know if your are using SoundJS but just in case I wanted to add this comment.

Android Chrome constantly crashing with my HTML5 website -- How to debug it?

i have built a HTML5 web site (or rather webapp as you wish) and it works fine in Chrome and firefox. I would say the only thing out of the ordinary is, that it uses
Google Closure in some parts (the issue persists in the simplest, non-optimized mode)
HTML5 canvas for 2D drawing
Now I was curious whether it would run on my Galaxy Tab Tablett and indeed it does. I was able to set up the remote debugging facility https://developers.google.com/chrome-developer-tools/docs/remote-debugging?hl=de and debug my code to get rid of a few things that were not working properly. However I notice that android-chrome regulary crashes while I use my app. The console in my desktop browser then complains about websocket being closed (thats why I suspect it really is a problem of the tablet side).
I would like to know what makes my website crash and am a bit flubbergusted that my HTML/js site can crash a browser like chrome so easily. I would have thought that it should be more stable than that.
Now as I would like to have an "entry" point into debugging the issue:
is there a crash log of chrome for android that I can inspect somehow?
can I somehow make it (chrome or android in general) more verbose on error messages?
There are a couple of things that you can do:
chrome://crashes will list the crashes that it has caught when a tab crashes - you might need to turn on crash reporting in the settings. You won't be able to fix it but you will be able to report it us so we can see if it is an issue.
Use logcat and see if there are any specific issues in the tracing output, such as an out of error message.

A way to skip crash on iOS (iPhone, iPad)

It may be a newb questions, but still.
I'm working on iOS 6 application for iPhone and iPad, and i'm working on hybrid application Javascript\UIWebView + Objective C
The problem is that i have an internal exception in Private framework. This exception is caused by something that is inside a Javascript\UIWebView. And i don't know what Javascript code causing an exception.
So i wan't to do this:
1) Somehow "skip\shallow" crash
2) Using remote Safari debugger, get some info from application
So my question is, is there a way to "skip\shallow" crash, to make my application work for at least few seconds.
I think your only chance to deal with this is by placing log traces all over your javascript, so you can track down where the crash is happening.
To do this, you might find useful this S.O. post showing how you can have JS log to your Xcode console.

Categories