Just to follow up - maybe the stack is getting corrupted? (In the sense
that a crash occurs on return from a function)
On Sunday, August 1, 2021 at 1:41:28 PM UTC+1 nickw wrote:
>
> Hi,
>
> Trying to debug a third-party application which I am attempting to convert
> to emscripten.
>
> Encountering a confusing 'Index out of bounds' error thrown from the
> JavaScript output of emscripten, specifically in the following code:
>
> function invoke_iiiiii(index,a1,a2,a3,a4,a5) {
> var sp = stackSave();
> try {
> return wasmTable.get(index)(a1,a2,a3,a4,a5);
> } catch(e) {
> stackRestore(sp);
> if (e !== e+0 && e !== 'longjmp') throw e;
> _setThrew(1, 0);
> }
> }
> The call to the function returned from wasmTable.get() throws the error.
> (I presume this is a call into WASM).
>
> Not sure what index is out of bounds, as the value of 'index' is less than
> the length of wasmTable, so I'm guessing that it's something in the C++.
>
> However the point at which the C++ crashes out with this error is not code
> which is attempting to do any indexing.
>
> It occurs when a given C++ function (BundleAdjust()) returns, to another
> C++ function (BundleAdjustAll()).
>
> As in, an error log message (written to stderr) at the end of
> BundleAdjust() does appear in the browser log, but another error log
> message in BundleAdjustAll(), immediately following the call to
> BundleAdjust(), does not.
>
> Any suggestions for a debug strategy on this? In other words, is it likely
> to be due to an index-out-of-bounds error somewhere in the compiled C++
> code?
>
> Thanks.
>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/emscripten-discuss/47a2d29c-2ed9-4df1-8767-e4afe6f0c7b5n%40googlegroups.com.