On Sun, Mar 17, 2013 at 5:13 AM, Marcos Scriven <
mar...@scriven.org> wrote:
> Hi
>
> Just to give a bit of background, there were two issues preventing me
> getting valid asm.js:
>
> A '_raise' funciton, which it turned out was coming from GMP lib - that was
> simple to remove by switching off HAVE_RAISE macro
> Having removed that there were a a number of validation issues (as reported
> here
https://github.com/kripken/emscripten/issues/951). However, they all
> seemed to be in code that wasn't used, so
>
>
> Now that I'm getting valid asm.js, I'm getting a weird error (in FF nightly
> 22.0a1 (2013-03-06)):
>
>>> [12:01:42.344] Error: Successfully compiled asm.js code
>>>
>>> [12:01:44.986] uncaught exception: 5640992 - Exception catching is
>>> disabled, this exception cannot be caught. Compile with -s
>>> DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.
>>>
>>> [12:01:44.997] The character encoding of the HTML document was not
>>> declared. The document will render with garbled text in some browser
>>> configurations if the document contains characters from outside the US-ASCII
>>> range. The character encoding of the page must be declared in the document
>>> or in the transfer protocol. @
>>> file:///Users/marcosscriven/Desktop/converter.html
>
>
> So points to ask/raise:
>
> Why does it say 'Error: Successfully ...' - is that just a log
> misclassification in FF nightly? Which was it? Successful, or error?
That should be a warning (it should probably not be even that, but
just a log message). How are you viewing that? Web console or error
console?
> What is the exception '5640992'? That can't refer to a line number, as even
> un-minified my JS has 'only' 561371 lines. Obviously with asm.js I can't use
> the disable options anyway.
It's the address in memory of the C++ exception being thrown. Not very
useful... But you can print out a stack trace from where it is thrown
(search for 'throw'), which could help in a -g (debug info) build.
> What's especially odd is that deliberately making the very same JS file
> invalid asm.js (by just adding the _raise function stub back), it will fail
> the asm.js validation, and work fine.
>
You can prevent asm.js optimizations by just removing the "use asm"
string. Do you get different results when you do that? If so it's a
bug, please file it with your codebase and steps to reproduce.
- azakai