kripken/emscripten — Issue #159: Assertion when running code
Author: BrianJThomas
Created: 2012-01-05 02:39:29+00:00
State: open

The code I am compiling is here: http://codepad.org/cOVcXxtH
I am compiling using the following command: emcc forward.cpp -o forward.html -Wall
The expected result is the following (compiled with clang): http://i.imgur.com/cc5sN.png
The generated html is: http://pastebin.com/QU3KAK0z
I am unfamiliar with git, but I think I am using emscripten with the git hash: cf1d3bfc8e393900b1177b155520b9dca19385ed

I receive the following error in chrome (16.0.912.63 on osx):

Assertion failed: undefined:
Error at abort (file:///Users/bthomas/coding/smallpt/forward.html:364:25) at assert (file:///Users/bthomas/coding/smallpt/forward.html:371:5) at __ZNK6Sphere9intersectERK3Ray (file:///Users/bthomas/coding/smallpt/forward.html:3022:50) at __Z9intersectRK3RayRdRi (file:///Users/bthomas/coding/smallpt/forward.html:2056:17) at __Z8radianceRK3RayiPt (file:///Users/bthomas/coding/smallpt/forward.html:1225:17) at _main (file:///Users/bthomas/coding/smallpt/forward.html:2756:7) at Object.callMain (file:///Users/bthomas/coding/smallpt/forward.html:4346:10) at run (file:///Users/bthomas/coding/smallpt/forward.html:4375:18) at file:///Users/bthomas/coding/smallpt/forward.html:4391:13

If I increase TOTAL_STACK in the html file enough, then the code will execute properly as long as I compiled without optimizations.

The code is from http://kevinbeason.com/smallpt/. I ported the non-recursive version to work with SDL and emscripten.