11

I have a very basic Unity app that's essentially a test harness for a proprietary framework. It runs fine in Chrome, Firefox and Safari. Edge is a different story.

In Edge 12, with asm.js disabled, it takes a very long time to load - roughly 90 seconds, compared with 15-20 in other browsers.

In Edge 12 or 13 with asm.js enabled, it loads quickly, but crashes the tab immediately when the the Unity app starts up. I've been able to figure out that the "preRun" callback gets called, but the "postRun" callback does not.

I can't figure out how to start debugging this - Edge disables asm.js if the Dev Tools debugger is open, and detaching the debugger also disables the JS console. I'm unable to attach the Unity debugger because the crash seems to happen before I get to that point.

Is there some kind of log from Edge where I could find anything about the crash, maybe even a JS stack trace?

Daniel Schaffer
  • 52,912
  • 28
  • 108
  • 161
  • 2
    The exception code `0xc0000005` is an access violation. It's probably an attempt to dereference a null pointer. This seems like a bug in Edge, and not something that you can fix or that was (directly) caused by you. I guess if you could figure out what the JS was doing then maybe you could work around it, but it might be something in Unity. – Sam Jan 13 '16 at 00:55
  • 1
    can you share any of the code? I would be happy to pass this on to some of the engineers responsible for the asm work in Edge. Also, your Edge version is pretty old. Try running windows update to see if this still happens on Edge 13 (you are on 11) – Patrick Jan 13 '16 at 08:52
  • @Patrick - I work primarily on a Mac, and I'm currently at the mercy of whatever's on modern.ie, which right now, is a Win10 enterprise eval that's expired, and I haven't been able to get the Nov update on it. I have a few colleagues with 13 who are experiencing the same thing. If you don't mind, please contact me at dschaffer@gsngames.com and we can figure out what code to get to those engineers. – Daniel Schaffer Jan 13 '16 at 15:46

2 Answers2

3

This is due to a bug in Edge in our asm.js specialization code (which I am the owner of). Thanks for reporting the issue, I'll try to get a patch out to fix this soon! If anyone else is hitting a crash in asm.js, feel free to send me a message and I'll happily work with you to get a fix (and find a workaround in the meantime).

Michael Holman
  • 891
  • 9
  • 25
-1

I would like to specifically answer to your question - "Is there some kind of log from Edge where I could find anything about the crash, maybe even a JS stack trace?"

I really suggest you to use stacktrace.js - Here is their Github repo.

As long as you write Javascript code, to debug it across browsers, to find for any errors or exceptions, this is by far the best way to do it. It is very consistent and supports most browsers and even Edge.

One thing to note is- You need to know a little of Javascript Promises which is a part of ES6(again most latest browsers support is already).

Have a look at their documentation and use what exactly suits you. They say its a 5-in-1 package you can use.

You can handle errors when it occurs with code as simple as-

window.onerror = function(msg, file, line, col, error) {
    // callback is called with an Array[StackFrame]
    StackTrace.fromError(error).then(callback).catch(errback);
};

And Get Stacktrace from the error-

var error = new Error('BOOM!');

StackTrace.fromError(error).then(callback).catch(errback)
=> Promise(Array[StackFrame], Error);

Hope it helps. Happy coding! :)

bozzmob
  • 10,774
  • 15
  • 44
  • 67
  • Unfortunately, this won't work - when I say "crash", I don't mean that there's an unhandled JS exception that prevents the code from working. I mean that the Windows process running the tab actually crashes, resulting in a crash report in the Windows event log. I've already got a handler wired up to onerror with an "alert" call, but it seems to crash before it even gets to that point. That said, stacktrace.js is seems very helpful, and I could definitely use some more reliable JS error reporting, so thanks for linking that! – Daniel Schaffer Jan 20 '16 at 17:47