Mysterious exception in callMain

10 views
Skip to first unread message

キャロウ マーク

unread,
Jul 11, 2020, 5:04:19 PM7/11/20
to emscripten-discuss
My app (using standard Emscripten .html shell) is always getting an exception in callMain:

exception thrown: 5792936 es3loadtests.html:1246:19

The number (string of digits?) is different every time I run the app. I cannot see where this is happening. There is a _main in Module but it does not appear to be being called as some fprintfs I added are not appearing on the console. The exception is being thrown in the wasm code for main. As I’ve not been able to get source mapping working properly, it is hard to debug.

This is a build problem not an application problem. The same code compiled with make files generated from GYP via CMake works fine. I’m converted to pure CMake so now have manually create CMakeLists, etc. I have compared the compile and link options several times and I have been unable to spot the difference.

I am hoping somebody on this list can give me a hint as to how to debug this or can explain what can cause an exception that does not look like an exception. It appears to just be a number.

Regards

    -Mark

signature.asc

キャロウ マーク

unread,
Jul 11, 2020, 7:50:33 PM7/11/20
to emscripten-discuss
Solved with the ever helpful but time consuming laying down of skid marks.

The fundamental problem was that —preload-files in my new build was putting files in the wrong place in the virtual file system which led to my app throwing an exception. The file that catches this exception was not compiled with -s DISABLE_EXCEPTION_CATCHING=0 due to it having been moved into a different sub package. Hopefully this will help someone else wondering why they have very strange looking exceptions.

Regards

    -Mark
signature.asc
Reply all
Reply to author
Forward
0 new messages