Closed skhaz closed 9 months ago
Do you have the full backtrack available? If you build with -sASSERTIONS
and--profiling-funcs
that should be enough to tell you where your code the bad call_indirect
happens.
Out of bounds call_indirect
normally means a bad function pointer in somewhere, likely due to memory corruption. You can also try building with -fsanitize=address
to help debug these types of errors.
As always, its also useful if you can share the full set of link flags that you used to build your module.
Thank you very much for your help, now I have a better understanding of the error.
However, I don't have a function called 'apply' in my code, so I imagine it must be from a 3rd party, right?
Unhandled Promise Rejection: RuntimeError: Out of bounds call_indirect (evaluating 'f.apply(null,arguments)')
Indeed, but the best way to track down the failure is going to be to get a full stack trace. Do you know why you don't see one? Are you able to reproduce in devtools?
Saddly I don't have any stack trace. Even with the flags and sanitizer that you recommended.
It's strange that it's only happening in Safari.
Are you able to reproduce in your browser with devtools open? What do you see in the console?
Perhaps install an Unhandled Promise Rejection
handler on your page and then set a breakpoint in there?
Perhaps try adding -sRUNTIME_DEBUG
to your link flags along with -sASSERTIONS=2
I came across something interesting in the handler, 'isTrusted' equals false. Does this mean that my binary is not considered safe by Apple, similar to binaries for macOS?
[Warning] UNHANDLED PROMISE REJECTION: RuntimeError: Out of bounds call_indirect (evaluating 'f.apply(null, arguments)') (trial.carimbo.cloud, line 40) [Warning] {"isTrusted":false} (trial.carimbo.cloud, line 41)
Sorry, I'm afraid I don't know what that means.
Were you able to get a backtrace?
Are you example to run simple emscripten example in this environment? e.g. emcc -o out.html test/hello_world.c
and then load out.html in your browser?
I am 98% sure that the problem is actually in the 3rd party library (if you are reading this and are interested to know, my guess is the Sol2 library, a C++ wrapper for Lua), because I commented out the part that calls it and it ran normally.
Thank you very much, @sbc100, for your help. Feel free to close.
@sbc100 FYI it is now working now, I haven't changed anything. It works on mobile and desktop Safari. Go figure out...
I have a project written in C++ with SDL that utilizes emsdk/3.1.44 for compiling to WebAssembly. It works seamlessly on Chrome and Firefox, but encounters issues on Safari 17. On desktop, I encounter the following error in the console.
It is possible to see here https://demo.carimbo.cloud
I don't change anything at all in the generated .js file, and this is my index.html.
Is it a known issue or is it on my side?
Thank you.