Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dlink-enabled web export broken with emscripten 3.1.45 (last known working version: 3.1.39) #82865

Closed
PgBiel opened this issue Oct 5, 2023 · 23 comments

Comments

@PgBiel
Copy link

PgBiel commented Oct 5, 2023

Godot version

4.2.dev [57a6813]

System information

Godot v4.2.dev (57a6813) - EndeavourOS #1 SMP PREEMPT_DYNAMIC Sat, 23 Sep 2023 22:55:13 +0000 - X11 - GLES3 (Compatibility) - llvmpipe (LLVM 16.0.6, 256 bits) () - AMD Ryzen 7 5700G with Radeon Graphics (8 Threads)

Issue description

Hello,
I've been trying to debug WASM export with GDExtensions after the release of v4.2.dev6 (in a Linux OS), but I was using the official web export templates which don't appear to include the engine's debug symbols, so I decided to compile a web export template from source, checking out at what appears to be the latest commit to be included in v4.2.dev6 (57a6813). However, when I use a dlink-enabled web template compiled from source at that commit, any project fails to run in the web (any project, even a very trivial and just created one, will do), displaying on the web browser console the errors I show below instead of the game (for both Chromium and Firefox). Disabling dlink_enabled works - a trivial project runs -, but then, of course, I can't test GDExtension without that option enabled.
Note that this occurs when compiling with or without debug symbols, with template_debug or template_release, and only when compiling from source (the official web export templates, downloaded through the v4.2.dev6 editor, appeared to be fine).

I've tested the export process throughout 3 different Linux distros (Debian 12 Podman container, EndeavourOS / Arch-based VM, NixOS bare metal), all with the same result. I've also tested compilation from source on both the Debian 12 container and on the EndeavourOS VM. I apologize in advance if I'm just missing some trivial flag or some other procedure (I'm mostly following the existing documentation).

The commands I've tried:

scons platform=web debug_symbols=yes dlink_enabled=yes target=template_debug
scons platform=web dlink_enabled=yes target=template_debug
scons platform=web dlink_enabled=yes target=template_release

Compiling with the command below does, however, work (produces a functional web export template):

scons platform=web target=template_debug

I've also compiled the editor at the same commit with:

scons platform=linuxbsd debug_symbols=yes target=editor

(Using the official v4.2.dev6 editor didn't work either.)

I'm using emsdk 3.1.45:

$ emcc --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.45 (ef3e4e3b044de98e1811546e0bc605c65d3412f4)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The errors which appear on my Ungoogled Chromium v117 browser's console when trying to run the game (served on localhost with the official serve.py script in the Godot repository) are the following (similar errors appear on Firefox v118.0.1):

index.worker.js:24 worker.js onmessage() captured an uncaught exception: RangeError: WebAssembly.Table.get(): invalid index 65417 into funcref table of size 7745
threadPrintErr @ index.worker.js:24
index.worker.js:24 RangeError: WebAssembly.Table.get(): invalid index 65417 into funcref table of size 7745
    at getWasmTableEntry (index.js:4164:47)
    at Object.invokeEntryPoint (index.js:4175:15)
    at handleMessage (:8060/index.worker.js:123:35)
threadPrintErr @ index.worker.js:24
index.worker.js:24 worker.js onmesage() captured an uncaught exception: RangeError: WebAssembly.Table.get(): invalid index 65417 into funcref table of size 7745
threadPrintErr @ index.worker.js:24
index.worker.js:24 RangeError: WebAssembly.Table.get(): invalid index 65417 into funcref table of size 7745
    at getWasmTableEntry (index.js:4164:47)
    at Object.invokeEntryPoint (index.js:4175:15)
    at handleMessage (:8060/index.worker.js:123:35)
threadPrintErr @ index.worker.js:24
index.js:54496 Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread
onPrintError @ index.js:54496
index.js:54496 Pthread 0x007b8a40 sent an error! http://localhost:8060/index.worker.js:155: Uncaught RangeError: WebAssembly.Table.get(): invalid index 65417 into funcref table of size 7745
onPrintError @ index.js:54496
index.js:3929 Uncaught ErrorEventisTrusted: truebubbles: falsecancelBubble: falsecancelable: truecolno: 5composed: falsecurrentTarget: Window {window: Window, self: Window, document: document, name: '', location: Location, …}defaultPrevented: falseerror: nulleventPhase: 0filename: "http://localhost:8060/index.worker.js"lineno: 155message: "Uncaught RangeError: WebAssembly.Table.get(): invalid index 65417 into funcref table of size 7745"returnValue: truesrcElement: Window {window: Window, self: Window, document: document, name: '', location: Location, …}target: Window {window: Window, self: Window, document: document, name: '', location: Location, …}timeStamp: 1225.2700000004843type: "error"[[Prototype]]: ErrorEvent
index.worker.js:155 Uncaught RangeError: WebAssembly.Table.get(): invalid index 65417 into funcref table of size 7745
    at getWasmTableEntry (index.js:4164:47)
    at Object.invokeEntryPoint (index.js:4175:15)
    at handleMessage (index.worker.js:123:35)
index.js:54496 Pthread 0x008569b8 sent an error! http://localhost:8060/index.worker.js:155: Uncaught RangeError: WebAssembly.Table.get(): invalid index 65417 into funcref table of size 7745
onPrintError @ index.js:54496
index.js:3929 Uncaught ErrorEvent
index.worker.js:155 Uncaught RangeError: WebAssembly.Table.get(): invalid index 65417 into funcref table of size 7745
    at getWasmTableEntry (index.js:4164:47)
    at Object.invokeEntryPoint (index.js:4175:15)
    at handleMessage (index.worker.js:123:35)

Steps to reproduce

  1. Clone this repository
  2. Ensure you have the necessary dependencies to build Godot (including emsdk 3.1.45, scons etc.)
  3. Checkout to 57a6813 with git checkout --detach 57a6813bb8bc2417ddef1058d422a91f0c9f753c
  4. Compile the editor with scons platform=linuxbsd target=editor (assuming Linux host)
  5. Compile the web export template with scons platform=web dlink_enabled=yes target=template_debug - you may have to rename the resulting bin/godot.web.template_debug.wasm32.dlink.zip file to bin/web_dlink_debug.zip.
  6. Open the editor, and either create a new project (Compatibility Renderer) or import TestProject.zip below
  7. Export the project to the web (don't forget to select your main scene, if creating a new project), selecting as custom Debug web export template the bin/web_dlink_debug.zip file (or place the file in the usual ~/.local/share/godot/export_templates/4.2.dev/web_dlink_debug.zip location). Ensure "Extensions Support" is checked.
  8. Serve the exported web files at localhost using the platform/web/serve.py script (e.g. cd to where the project's main HTML file was exported to and run python3 /path/to/godot/platform/web/serve.py -r "$(realpath .)").
  9. Open the game in your browser (preferably Chromium-based for more detailed errors) at 127.0.0.1:8060
  10. Expect it to run normally (show a spinning Godot icon), but instead it displays the errors listed above on the Web Developer console. (The exact error messages may differ depending on your browser, but should be at least similar.)

Minimal reproduction project

TestProject.zip

@akien-mga
Copy link
Member

Official templates are also built with production=yes, which enables LTO. This might be worth testing.

In godotengine/godot-cpp#1247 (comment) @Faless had different results based on whether LTO was enabled. But this should have been solved in 4.2-dev6 by #82633.

@PgBiel
Copy link
Author

PgBiel commented Oct 5, 2023

Official templates are also built with production=yes, which enables LTO. This might be worth testing.

In godotengine/godot-cpp#1247 (comment) @Faless had different results based on whether LTO was enabled. But this should have been solved in 4.2-dev6 by #82633.

Hello, thanks for the response! I compiled with production=yes (scons platform=web production=yes dlink_enabled=yes target=template_release and template_debug), and got different results, but still negative:

  1. For the minimal reproduction project, execution goes 'further' (displays some audio warning and stuff), but still fails to run (vs. official build with which it runs normally). Here are the results:
Browser Console Log (`template_debug`)

TestProject.js:54481 Godot Engine v4.2.dev.custom_build.57a6813bb - https://godotengine.org

TestProject.js:54481 OpenGL API OpenGL ES 3.0 (WebGL 2.0 (OpenGL ES 3.0 Chromium)) - Compatibility - Using Device: WebKit - WebKit WebGL

TestProject.js:54496 USER WARNING: Invalid mix rate of 0, consider reassigning setting 'audio/driver/mix_rate'. 
onPrintError @ TestProject.js:54496
put_char @ TestProject.js:1312
write @ TestProject.js:1264
write @ TestProject.js:3085
doWritev @ TestProject.js:18134
_fd_write @ TestProject.js:18225
$__stdio_write @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xaacf3
$__fwritex @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0x97c79
$out @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xe8c44
$printf_core @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xe8bf2
$__vfprintf_internal @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xe819e
$vfprintf @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xbfe48
$StdLogger::logv(char const*, void*, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476eed
$Logger::logf_error(char const*, ...) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0xc02994
$Logger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476c9b
$CompositeLogger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2477087
$_err_print_error(char const*, char const*, int, char const*, char const*, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28d330
$_err_print_error(char const*, char const*, int, String const&, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2ade43
$AudioDriver::_get_configured_mix_rate() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28d107
$AudioDriverWeb::init() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28ccc0
$Main::setup2() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x33f867
$Main::setup(char const*, int, char**, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2eeadc
$godot_web_main(int, char**) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e0e58
__Z14godot_web_mainiPPc @ TestProject.js:4989
$main @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xa9aff
callMain @ TestProject.js:53972
(anonymous) @ TestProject.js:54819
(anonymous) @ TestProject.js:54814
Promise.then (async)
(anonymous) @ TestProject.js:54813
Promise.then (async)
start @ TestProject.js:54792
(anonymous) @ TestProject.js:54855
Promise.then (async)
startGame @ TestProject.js:54854
(anonymous) @ TestProject.html:224
(anonymous) @ TestProject.html:244
TestProject.js:54496 Defaulting mix rate to value 44100.
onPrintError @ TestProject.js:54496
put_char @ TestProject.js:1312
write @ TestProject.js:1264
write @ TestProject.js:3085
doWritev @ TestProject.js:18134
_fd_write @ TestProject.js:18225
$__stdio_write @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xaacf3
$__vfprintf_internal @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xe81bd
$vfprintf @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xbfe48
$StdLogger::logv(char const*, void*, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476eed
$Logger::logf_error(char const*, ...) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0xc02994
$Logger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476c9b
$CompositeLogger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2477087
$_err_print_error(char const*, char const*, int, char const*, char const*, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28d330
$_err_print_error(char const*, char const*, int, String const&, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2ade43
$AudioDriver::_get_configured_mix_rate() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28d107
$AudioDriverWeb::init() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28ccc0
$Main::setup2() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x33f867
$Main::setup(char const*, int, char**, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2eeadc
$godot_web_main(int, char**) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e0e58
__Z14godot_web_mainiPPc @ TestProject.js:4989
$main @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xa9aff
callMain @ TestProject.js:53972
(anonymous) @ TestProject.js:54819
(anonymous) @ TestProject.js:54814
Promise.then (async)
(anonymous) @ TestProject.js:54813
Promise.then (async)
start @ TestProject.js:54792
(anonymous) @ TestProject.js:54855
Promise.then (async)
startGame @ TestProject.js:54854
(anonymous) @ TestProject.html:224
(anonymous) @ TestProject.html:244

TestProject.js:54496    at: _get_configured_mix_rate (servers/audio_server.cpp:126)
onPrintError @ TestProject.js:54496
put_char @ TestProject.js:1312
write @ TestProject.js:1264
write @ TestProject.js:3085
doWritev @ TestProject.js:18134
_fd_write @ TestProject.js:18225
$__stdio_write @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xaacf3
$__vfprintf_internal @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xe81bd
$vfprintf @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xbfe48
$StdLogger::logv(char const*, void*, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476eed
$Logger::logf_error(char const*, ...) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0xc02994
$Logger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476cbf
$CompositeLogger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2477087
$_err_print_error(char const*, char const*, int, char const*, char const*, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28d330
$_err_print_error(char const*, char const*, int, String const&, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2ade43
$AudioDriver::_get_configured_mix_rate() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28d107
$AudioDriverWeb::init() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28ccc0
$Main::setup2() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x33f867
$Main::setup(char const*, int, char**, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2eeadc
$godot_web_main(int, char**) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e0e58
__Z14godot_web_mainiPPc @ TestProject.js:4989
$main @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xa9aff
callMain @ TestProject.js:53972
(anonymous) @ TestProject.js:54819
(anonymous) @ TestProject.js:54814
Promise.then (async)
(anonymous) @ TestProject.js:54813
Promise.then (async)
start @ TestProject.js:54792
(anonymous) @ TestProject.js:54855
Promise.then (async)
startGame @ TestProject.js:54854
(anonymous) @ TestProject.html:224
(anonymous) @ TestProject.html:244

TestProject.js:54481  

TestProject.worker.js:24 worker.js onmessage() captured an uncaught exception: RangeError: WebAssembly.Table.get(): invalid index 8647 into funcref table of size 7743
threadPrintErr @ TestProject.worker.js:24
handleMessage @ TestProject.worker.js:150

TestProject.worker.js:24 RangeError: WebAssembly.Table.get(): invalid index 8647 into funcref table of size 7743
    at getWasmTableEntry (TestProject.js:4164:47)
    at Object.invokeEntryPoint (TestProject.js:4175:15)
    at handleMessage (TestProject.worker.js:123:35)
threadPrintErr @ TestProject.worker.js:24
handleMessage @ TestProject.worker.js:151

TestProject.js:54496 Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread
onPrintError @ TestProject.js:54496
warnOnce @ TestProject.js:4981
_emscripten_check_blocking_allowed @ TestProject.js:13303
$__pthread_cond_timedwait @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xb69db
$pthread_cond_wait @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xd70f0
$std::__2::__libcpp_condvar_wait[abi:v160004](pthread_cond_t*, pthread_mutex_t*) @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xfe3c2
$std::__2::condition_variable::wait(std::__2::unique_lock<std::__2::mutex>&) @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xfe38e
$tvg::Task::done() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x96b34e
$SvgLoader::paint() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x9789ce
$tvg::Picture::Impl::load() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x973a44
$tvg::PaintMethod<tvg::Picture::Impl>::update(tvg::RenderMethod&, tvg::RenderTransform const*, tvg::Array<void*>&, unsigned char, tvg::RenderUpdateFlag, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x973c25
$tvg::Paint::Impl::update(tvg::RenderMethod&, tvg::RenderTransform const*, tvg::Array<void*>&, unsigned char, tvg::RenderUpdateFlag, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x9716a3
$tvg::Canvas::Impl::update(tvg::Paint*, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x97ef24
$tvg::Canvas::push(std::__2::unique_ptr<tvg::Paint, std::__2::default_delete<tvg::Paint>>) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x97ee77
$ImageLoaderSVG::create_image_from_utf8_buffer(Ref<Image>, unsigned char const*, int, float, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x981aea
$ImageLoaderSVG::create_image_from_string(Ref<Image>, String, float, bool, HashMap<Color, Color, HashMapHasherDefault, HashMapComparatorDefault<Color>, DefaultTypedAllocator<HashMapElement<Color, Color>>> const&) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x982052
$fill_default_theme(Ref<Theme>&, Ref<Font> const&, Ref<Font> const&, Ref<Font> const&, Ref<Font> const&, Ref<Texture2D>&, Ref<StyleBox>&, float) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x1b013cc
$ThemeDB::initialize_theme() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x3a7e02
$Main::setup2() @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x34538f
$Main::setup(char const*, int, char**, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2eeadc
$godot_web_main(int, char**) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e0e58
__Z14godot_web_mainiPPc @ TestProject.js:4989
$main @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xa9aff
callMain @ TestProject.js:53972
(anonymous) @ TestProject.js:54819
(anonymous) @ TestProject.js:54814
Promise.then (async)
(anonymous) @ TestProject.js:54813
Promise.then (async)
start @ TestProject.js:54792
(anonymous) @ TestProject.js:54855
Promise.then (async)
startGame @ TestProject.js:54854
(anonymous) @ TestProject.html:224
(anonymous) @ TestProject.html:244

TestProject.js:54496 Invalid UTF-8 leading byte 0x00000098 encountered when deserializing a UTF-8 string in wasm memory to a JS string!
onPrintError @ TestProject.js:54496
worker.onmessage @ TestProject.js:3918

TestProject.js:54481 𦭀

TestProject.js:54481 ȕq

TestProject.js:54496 Invalid UTF-8 leading byte 0x000000f8 encountered when deserializing a UTF-8 string in wasm memory to a JS string!
onPrintError @ TestProject.js:54496
worker.onmessage @ TestProject.js:3918

TestProject.js:54481 

TestProject.js:54496 Output buffer has not enough frames! Skipping output frame.
onPrintError @ TestProject.js:54496
error @ TestProject.js:31752
node.port.onmessage @ TestProject.js:33427

TestProject.js:54496 Pthread 0x0165d6d0 sent an error! http://localhost:8060/TestProject.worker.js:155: Uncaught RangeError: WebAssembly.Table.get(): invalid index 8647 into funcref table of size 7743
onPrintError @ TestProject.js:54496
worker.onerror @ TestProject.js:3928
error (async)
(anonymous) @ TestProject.js:3923
loadWasmModuleToWorker @ TestProject.js:3885
loadWasmModuleToAllWorkers @ TestProject.js:3955
(anonymous) @ TestProject.js:3849
callRuntimeCallbacks @ TestProject.js:3978
preRun @ TestProject.js:430
run @ TestProject.js:53999
runCaller @ TestProject.js:53953
removeRunDependency @ TestProject.js:574
(anonymous) @ TestProject.js:4911
Promise.then (async)
loadDylibs @ TestProject.js:4909
receiveInstance @ TestProject.js:688
done @ TestProject.js:54565
Promise.then (async)
instantiateWasm @ TestProject.js:54568
createWasm @ TestProject.js:706
(anonymous) @ TestProject.js:37320
(anonymous) @ TestProject.js:54739
Promise.then (async)
(anonymous) @ TestProject.js:54737
doInit @ TestProject.js:54736
init @ TestProject.js:54753
startGame @ TestProject.js:54852
(anonymous) @ TestProject.html:224
(anonymous) @ TestProject.html:244

TestProject.js:3929 Uncaught ErrorEvent {isTrusted: true, message: 'Uncaught RangeError: WebAssembly.Table.get(): invalid index 8647 into funcref table of size 7743', filename: 'http://localhost:8060/TestProject.worker.js', lineno: 155, colno: 5, …}
worker.onerror @ TestProject.js:3929
error (async)
(anonymous) @ TestProject.js:3923
loadWasmModuleToWorker @ TestProject.js:3885
loadWasmModuleToAllWorkers @ TestProject.js:3955
(anonymous) @ TestProject.js:3849
callRuntimeCallbacks @ TestProject.js:3978
preRun @ TestProject.js:430
run @ TestProject.js:53999
runCaller @ TestProject.js:53953
removeRunDependency @ TestProject.js:574
(anonymous) @ TestProject.js:4911
Promise.then (async)
loadDylibs @ TestProject.js:4909
receiveInstance @ TestProject.js:688
done @ TestProject.js:54565
Promise.then (async)
instantiateWasm @ TestProject.js:54568
createWasm @ TestProject.js:706
(anonymous) @ TestProject.js:37320
(anonymous) @ TestProject.js:54739
Promise.then (async)
(anonymous) @ TestProject.js:54737
doInit @ TestProject.js:54736
init @ TestProject.js:54753
startGame @ TestProject.js:54852
(anonymous) @ TestProject.html:224
(anonymous) @ TestProject.html:244

TestProject.worker.js:155 Uncaught RangeError: WebAssembly.Table.get(): invalid index 8647 into funcref table of size 7743
    at getWasmTableEntry (TestProject.js:4164:47)
    at Object.invokeEntryPoint (TestProject.js:4175:15)
    at handleMessage (TestProject.worker.js:123:35)
getWasmTableEntry @ TestProject.js:4164
invokeEntryPoint @ TestProject.js:4175
handleMessage @ TestProject.worker.js:123

Browser Console Log (`template_release`)


TestProject.js:54496 USER WARNING: Invalid mix rate of 0, consider reassigning setting 'audio/driver/mix_rate'.
TestProject.js:54496 Defaulting mix rate to value 44100.
at: _get_configured_mix_rate (servers/audio_server.cpp:126)

TestProject.worker.js:24 worker.js onmessage() captured an uncaught exception: RangeError: WebAssembly.Table.get(): invalid index 8671 into funcref table of size 7743
threadPrintErr @ TestProject.worker.js:24
handleMessage @ TestProject.worker.js:150

TestProject.worker.js:24 RangeError: WebAssembly.Table.get(): invalid index 8671 into funcref table of size 7743
    at getWasmTableEntry (TestProject.js:4164:47)
    at Object.invokeEntryPoint (TestProject.js:4175:15)
    at handleMessage (TestProject.worker.js:123:35)
threadPrintErr @ TestProject.worker.js:24
handleMessage @ TestProject.worker.js:151

TestProject.js:54496 Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread
onPrintError @ TestProject.js:54496
warnOnce @ TestProject.js:4981
_emscripten_check_blocking_allowed @ TestProject.js:13303
$pthread_cond_timedwait @ 006d1dd6:0xb69db
$pthread_cond_wait @ 006d1dd6:0xd70f0
$_ZNSt3__221__libcpp_condvar_waitB7v160004EP14pthread_cond_tP15pthread_mutex_t @ 006d1dd6:0xfe3c2
$_ZNSt3__218condition_variable4waitERNS_11unique_lockINS_5mutexEEE @ 006d1dd6:0xfe38e
$func10965 @ 092cb0de:0x798378
$func11137 @ 092cb0de:0x7a59f8
$func11084 @ 092cb0de:0x7a0a6e
$func11088 @ 092cb0de:0x7a0c4f
$func11043 @ 092cb0de:0x79e6cd
$func11291 @ 092cb0de:0x7abf4e
$func11290 @ 092cb0de:0x7abea1
$func11312 @ 092cb0de:0x7ae56f
$func11313 @ 092cb0de:0x7aea87
$func53969 @ 092cb0de:0x164ac38
$func1877 @ 092cb0de:0x32fef3
$func1797 @ 092cb0de:0x2d678a
$func1333 @ 092cb0de:0x28dc52
$_Z14godot_web_mainiPPc @ 092cb0de:0x27fd5f
__Z14godot_web_mainiPPc @ TestProject.js:4989
$__main_argc_argv @ 006d1dd6:0xa9aff
callMain @ TestProject.js:53972
(anonymous) @ TestProject.js:54819
(anonymous) @ TestProject.js:54814
Promise.then (async)
(anonymous) @ TestProject.js:54813
Promise.then (async)
start @ TestProject.js:54792
(anonymous) @ TestProject.js:54855
Promise.then (async)
startGame @ TestProject.js:54854
(anonymous) @ TestProject.html:224
(anonymous) @ TestProject.html:244

TestProject.js:54496 Invalid UTF-8 leading byte 0x00000088 encountered when deserializing a UTF-8 string in wasm memory to a JS string!
onPrintError @ TestProject.js:54496
worker.onmessage @ TestProject.js:3918

TestProject.js:54481 𳥀
TestProject.js:54481 X|m
TestProject.js:54481 ␜ဠ

  1. It also fails to run my separate GDExtension testing project (where I'm experimenting with a Rust gdext-based GDExtension), where I'm getting an error I don't get with the official builds: it says it can't find the entry symbol, but a wasm-objdump run seems to reveal the .wasm file does contain the symbol. (Previously, without production=yes, I was getting the same error as the MRP, with funcref-related messages.) This could, of course, be a problem with gdext itself, but in the official builds I get an error which is probably unrelated to this issue (some stack overflow error which appears to occur inside some internal emscripten function). Here's the logs on my non-official build:
Browser Console Log (`template_debug`)

index.js:54496 USER ERROR: Can't resolve symbol gdext_rust_init. Error: Tried to lookup unknown symbol "gdext_rust_init" in dynamic lib: hello_gdext.wasm.
onPrintError @ index.js:54496
put_char @ index.js:1312
write @ index.js:1264
write @ index.js:3085
doWritev @ index.js:18134
_fd_write @ index.js:18225
$__stdio_write @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xaacf3
$__vfprintf_internal @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xe81bd
$vfprintf @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xbfe48
$StdLogger::logv(char const*, void*, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476eed
$Logger::logf_error(char const*, ...) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0xc02994
$Logger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476c9b
$CompositeLogger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2477087
$_err_print_error(char const*, char const*, int, char const*, char const*, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28d330
$_err_print_error(char const*, char const*, int, char const*, String const&, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2b0791
$OS_Unix::get_dynamic_library_symbol_handle(void*, String, void*&, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0xc016f1
$GDExtension::open_library(String const&, String const&) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2308ce0
$GDExtensionResourceLoader::load(String const&, String const&, Error*, bool, float*, ResourceFormatLoader::CacheMode) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x26ddad6
$ResourceLoader::_load(String const&, String const&, String const&, ResourceFormatLoader::CacheMode, Error*, bool, float*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x249bf1d
$ResourceLoader::_thread_load_function(void*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x24a2415
$ResourceLoader::_load_start(String const&, String const&, ResourceLoader::LoadThreadMode, ResourceFormatLoader::CacheMode) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x1972710
$ResourceLoader::load(String const&, String const&, ResourceFormatLoader::CacheMode, Error*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x3a2253
$GDExtensionManager::load_extension(String const&) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x334b3f
$Main::setup(char const*, int, char**, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e4363
$godot_web_main(int, char**) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e0e58
__Z14godot_web_mainiPPc @ index.js:4989
$main @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xa9aff
callMain @ index.js:53972
(anonymous) @ index.js:54819
(anonymous) @ index.js:54814
Promise.then (async)
(anonymous) @ index.js:54813
Promise.then (async)
start @ index.js:54792
(anonymous) @ index.js:54855
Promise.then (async)
startGame @ index.js:54854
(anonymous) @ (index):224
(anonymous) @ (index):244

index.js:54496    at: get_dynamic_library_symbol_handle (drivers/unix/os_unix.cpp:674)
onPrintError @ index.js:54496
put_char @ index.js:1312
write @ index.js:1264
write @ index.js:3085
doWritev @ index.js:18134
_fd_write @ index.js:18225
$__stdio_write @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xaacf3
$__vfprintf_internal @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xe81bd
$vfprintf @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xbfe48
$StdLogger::logv(char const*, void*, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476eed
$Logger::logf_error(char const*, ...) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0xc02994
$Logger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476cbf
$CompositeLogger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2477087
$_err_print_error(char const*, char const*, int, char const*, char const*, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28d330
$_err_print_error(char const*, char const*, int, char const*, String const&, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2b0791
$OS_Unix::get_dynamic_library_symbol_handle(void*, String, void*&, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0xc016f1
$GDExtension::open_library(String const&, String const&) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2308ce0
$GDExtensionResourceLoader::load(String const&, String const&, Error*, bool, float*, ResourceFormatLoader::CacheMode) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x26ddad6
$ResourceLoader::_load(String const&, String const&, String const&, ResourceFormatLoader::CacheMode, Error*, bool, float*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x249bf1d
$ResourceLoader::_thread_load_function(void*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x24a2415
$ResourceLoader::_load_start(String const&, String const&, ResourceLoader::LoadThreadMode, ResourceFormatLoader::CacheMode) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x1972710
$ResourceLoader::load(String const&, String const&, ResourceFormatLoader::CacheMode, Error*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x3a2253
$GDExtensionManager::load_extension(String const&) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x334b3f
$Main::setup(char const*, int, char**, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e4363
$godot_web_main(int, char**) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e0e58
__Z14godot_web_mainiPPc @ index.js:4989
$main @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xa9aff
callMain @ index.js:53972
(anonymous) @ index.js:54819
(anonymous) @ index.js:54814
Promise.then (async)
(anonymous) @ index.js:54813
Promise.then (async)
start @ index.js:54792
(anonymous) @ index.js:54855
Promise.then (async)
startGame @ index.js:54854
(anonymous) @ (index):224
(anonymous) @ (index):244

index.js:54496 USER ERROR: GDExtension entry point 'gdext_rust_init' not found in library ../rust/target/wasm32-unknown-emscripten/release/hello_gdext.wasm
onPrintError @ index.js:54496
put_char @ index.js:1312
write @ index.js:1264
write @ index.js:3085
doWritev @ index.js:18134
_fd_write @ index.js:18225
$__stdio_write @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xaacf3
$__vfprintf_internal @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xe81bd
$vfprintf @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xbfe48
$StdLogger::logv(char const*, void*, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476eed
$Logger::logf_error(char const*, ...) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0xc02994
$Logger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476c9b
$CompositeLogger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2477087
$_err_print_error(char const*, char const*, int, char const*, char const*, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28d330
$_err_print_error(char const*, char const*, int, String const&, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2ade43
$GDExtension::open_library(String const&, String const&) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2308dbe
$GDExtensionResourceLoader::load(String const&, String const&, Error*, bool, float*, ResourceFormatLoader::CacheMode) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x26ddad6
$ResourceLoader::_load(String const&, String const&, String const&, ResourceFormatLoader::CacheMode, Error*, bool, float*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x249bf1d
$ResourceLoader::_thread_load_function(void*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x24a2415
$ResourceLoader::_load_start(String const&, String const&, ResourceLoader::LoadThreadMode, ResourceFormatLoader::CacheMode) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x1972710
$ResourceLoader::load(String const&, String const&, ResourceFormatLoader::CacheMode, Error*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x3a2253
$GDExtensionManager::load_extension(String const&) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x334b3f
$Main::setup(char const*, int, char**, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e4363
$godot_web_main(int, char**) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e0e58
__Z14godot_web_mainiPPc @ index.js:4989
$main @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xa9aff
callMain @ index.js:53972
(anonymous) @ index.js:54819
(anonymous) @ index.js:54814
Promise.then (async)
(anonymous) @ index.js:54813
Promise.then (async)
start @ index.js:54792
(anonymous) @ index.js:54855
Promise.then (async)
startGame @ index.js:54854
(anonymous) @ (index):224
(anonymous) @ (index):244

index.js:54496    at: open_library (core/extension/gdextension.cpp:733)
onPrintError @ index.js:54496
put_char @ index.js:1312
write @ index.js:1264
write @ index.js:3085
doWritev @ index.js:18134
_fd_write @ index.js:18225
$__stdio_write @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xaacf3
$__vfprintf_internal @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xe81bd
$vfprintf @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xbfe48
$StdLogger::logv(char const*, void*, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476eed
$Logger::logf_error(char const*, ...) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0xc02994
$Logger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2476cbf
$CompositeLogger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2477087
$_err_print_error(char const*, char const*, int, char const*, char const*, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x28d330
$_err_print_error(char const*, char const*, int, String const&, bool, ErrorHandlerType) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2ade43
$GDExtension::open_library(String const&, String const&) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2308dbe
$GDExtensionResourceLoader::load(String const&, String const&, Error*, bool, float*, ResourceFormatLoader::CacheMode) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x26ddad6
$ResourceLoader::_load(String const&, String const&, String const&, ResourceFormatLoader::CacheMode, Error*, bool, float*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x249bf1d
$ResourceLoader::_thread_load_function(void*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x24a2415
$ResourceLoader::_load_start(String const&, String const&, ResourceLoader::LoadThreadMode, ResourceFormatLoader::CacheMode) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x1972710
$ResourceLoader::load(String const&, String const&, ResourceFormatLoader::CacheMode, Error*) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x3a2253
$GDExtensionManager::load_extension(String const&) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x334b3f
$Main::setup(char const*, int, char**, bool) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e4363
$godot_web_main(int, char**) @ godot.side.web.template_debug.wasm32.dlink.wasm-0cac5f0a:0x2e0e58
__Z14godot_web_mainiPPc @ index.js:4989
$main @ godot.web.template_debug.wasm32.dlink.wasm-00b368da:0xa9aff
callMain @ index.js:53972
(anonymous) @ index.js:54819
(anonymous) @ index.js:54814
Promise.then (async)
(anonymous) @ index.js:54813
Promise.then (async)
start @ index.js:54792
(anonymous) @ index.js:54855
Promise.then (async)
startGame @ index.js:54854
(anonymous) @ (index):224
(anonymous) @ (index):244
(index):212 table index is out of bounds
displayFailureNotice @ (index):212
Promise.then (async)
(anonymous) @ (index):239
(anonymous) @ (index):244

index.js:54496 Invalid UTF-8 leading byte 0x00000088 encountered when deserializing a UTF-8 string in wasm memory to a JS string!
onPrintError @ index.js:54496
worker.onmessage @ index.js:3918

index.js:54481 𶳀

index.js:54496 Invalid UTF-8 leading byte 0x000000a0 encountered when deserializing a UTF-8 string in wasm memory to a JS string!
onPrintError @ index.js:54496
worker.onmessage @ index.js:3918

index.js:54481 𙾀

Browser Console Log (`template_release`)

index.js:54496 USER ERROR: Can't resolve symbol gdext_rust_init. Error: Tried to lookup unknown symbol "gdext_rust_init" in dynamic lib: hello_gdext.wasm.
onPrintError @ index.js:54496
put_char @ index.js:1312
write @ index.js:1264
write @ index.js:3085
doWritev @ index.js:18134
_fd_write @ index.js:18225
$func914 @ 006d1dd6:0xaacf3
$__vfprintf_internal @ 006d1dd6:0xe81bd
$vfprintf @ 006d1dd6:0xbfe48
$func71097 @ 092cb0de:0x1de285d
$func13731 @ 092cb0de:0xa01ba1
$func71093 @ 092cb0de:0x1de2633
$func71099 @ 092cb0de:0x1de29f7
$func554 @ 092cb0de:0x239cd5
$func798 @ 092cb0de:0x25a4af
$func13722 @ 092cb0de:0xa00c58
$func68289 @ 092cb0de:0x1cc0955
$func80652 @ 092cb0de:0x1fdd961
$func71417 @ 092cb0de:0x1e041b8
$func71476 @ 092cb0de:0x1e09aac
$func47755 @ 092cb0de:0x14f6dce
$func1860 @ 092cb0de:0x32c7f9
$func1737 @ 092cb0de:0x2c7681
$func1333 @ 092cb0de:0x2847c7
$_Z14godot_web_mainiPPc @ 092cb0de:0x27fd5f
__Z14godot_web_mainiPPc @ index.js:4989
$__main_argc_argv @ 006d1dd6:0xa9aff
callMain @ index.js:53972
(anonymous) @ index.js:54819
(anonymous) @ index.js:54814
Promise.then (async)
(anonymous) @ index.js:54813
Promise.then (async)
start @ index.js:54792
(anonymous) @ index.js:54855
Promise.then (async)
startGame @ index.js:54854
(anonymous) @ (index):224
(anonymous) @ (index):244

index.js:54496    at: get_dynamic_library_symbol_handle (drivers/unix/os_unix.cpp:674)
onPrintError @ index.js:54496
put_char @ index.js:1312
write @ index.js:1264
write @ index.js:3085
doWritev @ index.js:18134
_fd_write @ index.js:18225
$func914 @ 006d1dd6:0xaacf3
$__vfprintf_internal @ 006d1dd6:0xe81bd
$vfprintf @ 006d1dd6:0xbfe48
$func71097 @ 092cb0de:0x1de285d
$func13731 @ 092cb0de:0xa01ba1
$func71093 @ 092cb0de:0x1de2657
$func71099 @ 092cb0de:0x1de29f7
$func554 @ 092cb0de:0x239cd5
$func798 @ 092cb0de:0x25a4af
$func13722 @ 092cb0de:0xa00c58
$func68289 @ 092cb0de:0x1cc0955
$func80652 @ 092cb0de:0x1fdd961
$func71417 @ 092cb0de:0x1e041b8
$func71476 @ 092cb0de:0x1e09aac
$func47755 @ 092cb0de:0x14f6dce
$func1860 @ 092cb0de:0x32c7f9
$func1737 @ 092cb0de:0x2c7681
$func1333 @ 092cb0de:0x2847c7
$_Z14godot_web_mainiPPc @ 092cb0de:0x27fd5f
__Z14godot_web_mainiPPc @ index.js:4989
$__main_argc_argv @ 006d1dd6:0xa9aff
callMain @ index.js:53972
(anonymous) @ index.js:54819
(anonymous) @ index.js:54814
Promise.then (async)
(anonymous) @ index.js:54813
Promise.then (async)
start @ index.js:54792
(anonymous) @ index.js:54855
Promise.then (async)
startGame @ index.js:54854
(anonymous) @ (index):224
(anonymous) @ (index):244

index.js:54496 USER ERROR: GDExtension entry point 'gdext_rust_init' not found in library ../rust/target/wasm32-unknown-emscripten/debug/hello_gdext.wasm
onPrintError @ index.js:54496
put_char @ index.js:1312
write @ index.js:1264
write @ index.js:3085
doWritev @ index.js:18134
_fd_write @ index.js:18225
$func914 @ 006d1dd6:0xaacf3
$__vfprintf_internal @ 006d1dd6:0xe81bd
$vfprintf @ 006d1dd6:0xbfe48
$func71097 @ 092cb0de:0x1de285d
$func13731 @ 092cb0de:0xa01ba1
$func71093 @ 092cb0de:0x1de2633
$func71099 @ 092cb0de:0x1de29f7
$func554 @ 092cb0de:0x239cd5
$func792 @ 092cb0de:0x257ef5
$func68289 @ 092cb0de:0x1cc0a1d
$func80652 @ 092cb0de:0x1fdd961
$func71417 @ 092cb0de:0x1e041b8
$func71476 @ 092cb0de:0x1e09aac
$func47755 @ 092cb0de:0x14f6dce
$func1860 @ 092cb0de:0x32c7f9
$func1737 @ 092cb0de:0x2c7681
$func1333 @ 092cb0de:0x2847c7
$_Z14godot_web_mainiPPc @ 092cb0de:0x27fd5f
__Z14godot_web_mainiPPc @ index.js:4989
$__main_argc_argv @ 006d1dd6:0xa9aff
callMain @ index.js:53972
(anonymous) @ index.js:54819
(anonymous) @ index.js:54814
Promise.then (async)
(anonymous) @ index.js:54813
Promise.then (async)
start @ index.js:54792
(anonymous) @ index.js:54855
Promise.then (async)
startGame @ index.js:54854
(anonymous) @ (index):224
(anonymous) @ (index):244

index.js:54496    at: open_library (core/extension/gdextension.cpp:733)
onPrintError @ index.js:54496
put_char @ index.js:1312
write @ index.js:1264
write @ index.js:3085
doWritev @ index.js:18134
_fd_write @ index.js:18225
$func914 @ 006d1dd6:0xaacf3
$__vfprintf_internal @ 006d1dd6:0xe81bd
$vfprintf @ 006d1dd6:0xbfe48
$func71097 @ 092cb0de:0x1de285d
$func13731 @ 092cb0de:0xa01ba1
$func71093 @ 092cb0de:0x1de2657
$func71099 @ 092cb0de:0x1de29f7
$func554 @ 092cb0de:0x239cd5
$func792 @ 092cb0de:0x257ef5
$func68289 @ 092cb0de:0x1cc0a1d
$func80652 @ 092cb0de:0x1fdd961
$func71417 @ 092cb0de:0x1e041b8
$func71476 @ 092cb0de:0x1e09aac
$func47755 @ 092cb0de:0x14f6dce
$func1860 @ 092cb0de:0x32c7f9
$func1737 @ 092cb0de:0x2c7681
$func1333 @ 092cb0de:0x2847c7
$_Z14godot_web_mainiPPc @ 092cb0de:0x27fd5f
__Z14godot_web_mainiPPc @ index.js:4989
$__main_argc_argv @ 006d1dd6:0xa9aff
callMain @ index.js:53972
(anonymous) @ index.js:54819
(anonymous) @ index.js:54814
Promise.then (async)
(anonymous) @ index.js:54813
Promise.then (async)
start @ index.js:54792
(anonymous) @ index.js:54855
Promise.then (async)
startGame @ index.js:54854
(anonymous) @ (index):224
(anonymous) @ (index):244

(index):212 null function or function signature mismatch

Overall, the most concerning part for me is that it still can't run the sample project which doesn't contain any GDExtension usage at all.
(If needed, I can share the source for that gdext-based project, though!)

Edit: if needed, here's the source for my gdext test project:
hello-gdext-wasm-main.zip

@Esption
Copy link

Esption commented Oct 6, 2023

I can reproduce this with the godot chess example and the same commit of (57a6813), emcc version 3.1.45
Interestingly, a template built with dlink turned off works perfectly fine. Switched over and tried a dlink export with 4.1.1 engine/template and it works just fine. Mind you, that project doesn't actually make use of gdextension, just purely using that box to enable it. It seems like something since 4.1.1 and dev has made enabling dlink fail at runtime.

@PgBiel
Copy link
Author

PgBiel commented Oct 6, 2023

Interesting observations @Esption . I decided to test the latest 4.1.x versions and (shiver me timbers!) they didn't seem to work either... at least with emsdk 3.1.45.

  • 4.1.2 (4.1.2-stable tag): With emsdk 3.1.45, built editor from source, and also production=yes dlink_enabled=yes web template, and got the same errors both with and without GDExtension usage (with some new errors on the test with GDExtension usage). (Still have to test emsdk 3.1.18.)
  • 4.1.1 (4.1.1-stable tag):
    • With emsdk 3.1.45: Built editor from source, and also production=yes dlink_enabled=yes web template, and same thing (errors on both tests).
    • With emsdk 3.1.18: Doing the same procedure as above, it worked! (The sample project ran.)

I haven't yet tested without LTO for those (maybe this could make a difference). I'll update this comment if I get to do those tests (they take a bit with all the compilation involved 😅).

If I understood correctly, however, it seems that something somewhere is fundamentally broken in the dlink_enabled=yes builds... though I don't have enough data to determine exactly how.

Update: Without LTO on 4.1.1, it errors due to imports exceeding the 100k limit.

Update: I added above that the test project does work in 4.1.1 when compiling with emsdk 3.1.18.

So perhaps this is a problem with the recent emsdk versions?

@Faless
Copy link
Collaborator

Faless commented Oct 6, 2023

So perhaps this is a problem with the recent emsdk versions?

Yep, I can confirm also the current 4.2-dev works when built with emsdk 3.1.18, but does not with 3.1.46.

@Faless Faless changed the title Dlink-enabled web export template built from source apparently broken Dlink-enabled web export broken with emscripten 3.1.45 (last known working version: 3.1.18) Oct 6, 2023
@Faless
Copy link
Collaborator

Faless commented Oct 6, 2023

Also please note that there seem to be a Firefox bug causing GDExtension not to work.
I.e. dlink_enabled builds runs, but if you actually use an extension the page doesn't load on Firefox. Only Chrome seems to work (safari is untested), see: webcompat/web-bugs#127798

@PgBiel
Copy link
Author

PgBiel commented Oct 7, 2023

Okay, I have bisected the problem to Emscripten 3.1.40 (v3.1.39 was the last working version on my tests). Others may want to confirm.

On each test, while having checked out 57a6813bb8 (the latest commit in 4.2-dev6) in my Debian 12 container, I compiled the web template with
scons platform=web production=yes dlink_enabled=yes debug_symbols=yes target=template_debug

  • 3.1.18: Couldn't compile (Godot wanted some LLVM 18 attribute or something. Maybe just too outdated now?)
  • 3.1.31: Compiled, test project worked.
  • 3.1.38: Compiled, test project worked.
  • 3.1.39: Compiled, test project worked.
  • 3.1.40 - 3.1.41: Compiled, test project gave bad table error.
  • 3.1.42 - 3.1.45: Compiled, test project couldn't find index.pck (? - the file is there).
    • No idea why I'm getting this on those versions now (this wasn't happening with 3.1.45 before). Could be some impurity regarding dependencies in my container, but that would require more tests.
    • Here are the full logs I got on one of these tests (the others are pretty much identical).
Logs for the index.pck problem

index.js:54814 USER ERROR: Cannot open resource pack 'index.pck'.
onPrintError @ index.js:54814
put_char @ index.js:1304
write @ index.js:1256
write @ index.js:3053
doWritev @ index.js:18188
_fd_write @ index.js:18279
$__stdio_write @ 00b36e7e:0xaade5
$__vfprintf_internal @ 00b36e7e:0xe83d3
$vfprintf @ 00b36e7e:0xbfe85
$StdLogger::logv(char const*, void*, bool) @ 0cb0f366:0x246e617
$Logger::logf_error(char const*, ...) @ 0cb0f366:0xbfc596
$Logger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ 0cb0f366:0x246e3c5
$CompositeLogger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ 0cb0f366:0x246e7b1
$_err_print_error(char const*, char const*, int, char const*, char const*, bool, ErrorHandlerType) @ 0cb0f366:0x29296d
$_err_print_error(char const*, char const*, int, char const*, String const&, bool, ErrorHandlerType) @ 0cb0f366:0x2bc4d7
$ProjectSettings::setup(String const&, String const&, bool, bool) @ 0cb0f366:0x32c24d
$Main::setup(char const*, int, char**, bool) @ 0cb0f366:0x2f125b
$godot_web_main(int, char**) @ 0cb0f366:0x2edbd8
__Z14godot_web_mainiPPc @ index.js:4960
$main @ 00b36e7e:0xa9bf1
callMain @ index.js:54290
(anonymous) @ index.js:55137
(anonymous) @ index.js:55132
Promise.then (async)
(anonymous) @ index.js:55131
Promise.then (async)
start @ index.js:55110
(anonymous) @ index.js:55173
Promise.then (async)
startGame @ index.js:55172
(anonymous) @ (index):224
(anonymous) @ (index):244

index.js:54814    at: _setup (core/config/project_settings.cpp:534)
onPrintError @ index.js:54814
put_char @ index.js:1304
write @ index.js:1256
write @ index.js:3053
doWritev @ index.js:18188
_fd_write @ index.js:18279
$__stdio_write @ 00b36e7e:0xaade5
$__vfprintf_internal @ 00b36e7e:0xe83d3
$vfprintf @ 00b36e7e:0xbfe85
$StdLogger::logv(char const*, void*, bool) @ 0cb0f366:0x246e617
$Logger::logf_error(char const*, ...) @ 0cb0f366:0xbfc596
$Logger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ 0cb0f366:0x246e3e9
$CompositeLogger::log_error(char const*, char const*, int, char const*, char const*, bool, Logger::ErrorType) @ 0cb0f366:0x246e7b1
$_err_print_error(char const*, char const*, int, char const*, char const*, bool, ErrorHandlerType) @ 0cb0f366:0x29296d
$_err_print_error(char const*, char const*, int, char const*, String const&, bool, ErrorHandlerType) @ 0cb0f366:0x2bc4d7
$ProjectSettings::setup(String const&, String const&, bool, bool) @ 0cb0f366:0x32c24d
$Main::setup(char const*, int, char**, bool) @ 0cb0f366:0x2f125b
$godot_web_main(int, char**) @ 0cb0f366:0x2edbd8
__Z14godot_web_mainiPPc @ index.js:4960
$main @ 00b36e7e:0xa9bf1
callMain @ index.js:54290
(anonymous) @ index.js:55137
(anonymous) @ index.js:55132
Promise.then (async)
(anonymous) @ index.js:55131
Promise.then (async)
start @ index.js:55110
(anonymous) @ index.js:55173
Promise.then (async)
startGame @ index.js:55172
(anonymous) @ (index):224
(anonymous) @ (index):244

index.js:54799 Error: Couldn't load project data at path ".". Is the .pck file missing?

index.js:54799 If you've renamed the executable, the associated .pck file should also be renamed to match the executable's name (without the extension).

index.js:54814 Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread
onPrintError @ index.js:54814
warnOnce @ index.js:4952
_emscripten_check_blocking_allowed @ index.js:13275
$__pthread_join @ 00b36e7e:0xd9798
$std::__2::__libcpp_thread_join[abi:v160004](unsigned long*) @ 00b36e7e:0x13abb0
$std::__2::thread::join() @ 00b36e7e:0x13ab8f
$Thread::wait_to_finish() @ 0cb0f366:0x2932f9
$IP::~IP() @ 0cb0f366:0xbf0b74
$unregister_core_types() @ 0cb0f366:0x34479e
$Main::setup(char const*, int, char**, bool) @ 0cb0f366:0x2f65bc
$godot_web_main(int, char**) @ 0cb0f366:0x2edbd8
__Z14godot_web_mainiPPc @ index.js:4960
$main @ 00b36e7e:0xa9bf1
callMain @ index.js:54290
(anonymous) @ index.js:55137
(anonymous) @ index.js:55132
Promise.then (async)
(anonymous) @ index.js:55131
Promise.then (async)
start @ index.js:55110
(anonymous) @ index.js:55173
Promise.then (async)
startGame @ index.js:55172
(anonymous) @ (index):224
(anonymous) @ (index):244

index.js:54814 Invalid UTF-8 leading byte 0x00000088 encountered when deserializing a UTF-8 string in wasm memory to a JS string!
onPrintError @ index.js:54814
worker.onmessage @ index.js:3883

index.js:54799 𰭀

@bobziuchkovski
Copy link

I've also been testing various emscripten versions for a c++ gdextension project. The only version of emscripten I've found that compiles, loads, and correctly executes my c++ gdextension is 3.1.28.

In my testing, emsdk versions up to 3.1.27 fail with null function or function signature mismatch while executing the c++ code in my gdextension, and versions 3.1.29 and beyond fail with Can't resolve symbol [my entry_symbol]. Error: Tried to lookup unknown symbol "[my entry_symbol]" in dynamic lib: [my extension].javascript.template_ debug.wasm32.wasm.

I tested a number of emsdk versions between 3.1.18 and 3.1.46 before finding 3.1.28 worked (manual binary search). In all of my tests, I left my project source the same and built templates against Godot 4.2 dev 6 (57a6813) and godot-cpp current master (ef2f63a), compiling the web templates with production=yes dlink_enabled=yes target=template_debug and godot-cpp with production=yes target=template_debug.

@PgBiel
Copy link
Author

PgBiel commented Oct 10, 2023

Thank you very much for finding this @bobziuchkovski ! I can confirm that, while doing tests with the Rust GDExtension bindings (gdext), using emscripten 3.1.28 seems to actually get past the extension initialization phase, unlike what I observed with 3.1.31 and later (I'd also receive an error regarding not being able to find the extension's entry symbol).

So, to recap, when compiling with dlink_enabled=yes:

  1. The last known working emscripten version which runs a basic project (without GDExtension usage) is 3.1.39. (For versions higher than that, the problem I report in this issue seems to occur.)
  2. The last known working emscripten version which (can) run a project with actual usage of GDExtension is 3.1.28 (for versions earlier than that, it seems to fail with different errors, such as the aforementioned null function or function signature mismatch; and, for versions later than that, it seems to fail due to not being able to find the entry symbol).

I'm not sure if problem 2 (related more to actual GDExtension usage) is 100% on-topic for this issue though, perhaps it deserves a separate one. I'll leave this decision up to Godot maintainers.

@bobziuchkovski
Copy link

bobziuchkovski commented Oct 11, 2023

I'm also interested in knowing whether the GDExtension stuff should be considered separate. I've tracked down the upstream emscripten change that breaks GDExtension w/3.1.29+, but I don't want to clutter this issue if that should be discussed elsewhere. 🤷‍♂️

@akien-mga
Copy link
Member

I think we can keep discussing the 3.1.29 regression in this issue.

Having dlink_enabled builds working without supporting GDExtension isn't really a goal, as the only reason to use a dlink_enabled build is to load extensions.

So the problems will only be solved once we have dlink_enabled builds working with GDExtensions (and of course also without, for good measure, but that's just a side effect).

@akien-mga akien-mga changed the title Dlink-enabled web export broken with emscripten 3.1.45 (last known working version: 3.1.18) Dlink-enabled web export broken with emscripten 3.1.45 (last known working version: 3.1.28) Oct 11, 2023
@bobziuchkovski
Copy link

Excellent. Then in that case, the 3.1.29 regression is caused by emscripten-core/emscripten#18382. In particular, this line. If you emsdk install/activate 3.1.29-3.1.33, commenting that line is enough to get GDExtension builds working. After 3.1.34, there's some additional restructuring in that file so that it's no longer a single line edit.

However, I think ultimately it's still interplay with that locateFile call. I'm still digging into why that's failing for godot/gdextension in particular. Any insight anyone has into this specifically on the godot side would be tremendously helpful. I'm still getting up-to-speed on godot internals (I'm a newcomer who took interest in godot after the Unity debacle).

@Faless
Copy link
Collaborator

Faless commented Oct 11, 2023

@bobziuchkovski thank you very much for tracking this down.

This appears to be indeed a problem on the Godot side then, we use a custom locateFile (defined here in the Godot sources) since some file names are hard coded at compile time by emscripten (unless this changed in recent versions).

That is probably messing up with loading the extensions, now that's being used for loading dynamic libraries too.

@bobziuchkovski
Copy link

@Faless I can confirm your changes from #83165 fix GDExtension with emscripten up to 3.1.39.

Emscripten 3.1.40 and beyond have other issues that I'm now working to track down. These probably coincide with the issues @PgBiel reported on vanilla/non-GDExtension builds using emscripten 3.1.40-3.1.45.

@bobziuchkovski
Copy link

bobziuchkovski commented Oct 12, 2023

The remaining issue (WebAssembly.Table.get(): invalid index [index] into funcref table of size [size]) is a regression caused by emscripten-core/emscripten#19390. This was introduced as part of the emscripten 3.1.40 release.

I can compile and successfully run my GDExtension project on emscripten 3.1.47 (latest stable) with that single commit reverted (using #83165).

I'm still trying to make sense of how, exactly, that shared side module logic is failing with respect to godot, though. LInking with -sDYLINK_DEBUG=1 -sPTHREADS_DEBUG=1 shows [project].worker.js starting, [project].side.wasm loading, [gdextension].wasm32.wasm loading, two new threads being created, and both threads failing almost immediately at invokeEntryPoint: [hex addr] with the hex addr matching the decimal value for index in invalid index [index] into funcref table of size [size].

@Faless Faless changed the title Dlink-enabled web export broken with emscripten 3.1.45 (last known working version: 3.1.28) Dlink-enabled web export broken with emscripten 3.1.45 (last known working version: 3.1.39) Oct 13, 2023
@bobziuchkovski
Copy link

There's a PR open in the emscripten-core repo that fixes this issue: emscripten-core/emscripten#19496. Hopefully that will land. I confirmed godot 4.2beta2 built against HEAD of emscripten works with the changes from emscripten-core/emscripten#19496 applied.

@akien-mga
Copy link
Member

For 4.2-beta3 and later I'm upgrading Emscripten from 3.1.18 (same version as used in 4.1 and earlier 4.2 builds) to 3.1.39, since it's the last known working version. We might stick to it for 4.2-stable.

@dsnopek
Copy link
Contributor

dsnopek commented Oct 26, 2023

Just copying from the linked Emscripten issue: it appears the problem is fixed by PR emscripten-core/emscripten#19496

That PR is still being actively reviewed and worked on.

akien-mga added a commit to akien-mga/godot that referenced this issue Nov 10, 2023
Due to godotengine#82865, newer versions can't be used for dlink-enabled Web builds.
This isn't a problem for CI which doesn't use dlink, but it's clearer for
users if our CI version matches the one we use for official builds.
@akien-mga akien-mga modified the milestones: 4.2, 4.3 Nov 14, 2023
YuriSizov pushed a commit to YuriSizov/godot that referenced this issue Jan 23, 2024
Due to godotengine#82865, newer versions can't be used for dlink-enabled Web builds.
This isn't a problem for CI which doesn't use dlink, but it's clearer for
users if our CI version matches the one we use for official builds.

(cherry picked from commit 51aff13)
GuybrushThreepwood-GitHub pushed a commit to GuybrushThreepwood-GitHub/godot that referenced this issue Jan 27, 2024
Due to godotengine#82865, newer versions can't be used for dlink-enabled Web builds.
This isn't a problem for CI which doesn't use dlink, but it's clearer for
users if our CI version matches the one we use for official builds.
@YuriSizov
Copy link
Contributor

YuriSizov commented Apr 30, 2024

As another point of reference, I get the same RangeError: WebAssembly.Table.get(): invalid index [...] into funcref table of size [...] error even with 3.1.39.

That's a build of master (4.3 dev) from a couple of months ago (start of March). With the official 4.3.dev5 template I get a more cryptic error, RuntimeError: null function or function signature mismatch. But I believe it's the same thing. Both errors point to invokeEntryPoint, as mentioned above. More specifically it happens when the IP class is trying to initialize its thread.

What I managed to figure out is that the wasm tables in the main thread and in a sub-thread are different. This index exists in the much bigger main-thread table, but not in the table of a sub-thread. Frustratingly, I can't get DWARF to work in Chrome, despite compiling with debug symbols (both the engine and the extension), so there isn't much more I can comprehend.

PS. I also tried a threads=no build of the same revision, but that produced new errors, and at this point I'm not willing to push further to figure it out.

@YuriSizov
Copy link
Contributor

YuriSizov commented May 16, 2024

A small update about my case. I confirmed the issue with https://github.com/godotengine/godot-cpp-template, and also confirmed that it works in 4.2 stable. 4.3 dev 6 is still broken, however a Dlink-enabled build of current master (5708a3a) actually exports! No changes to the project or the extension itself between runs. I haven't tried my actual project yet, but that's progress.

So I guess some recent changes (from Adam?) fixed it, even though I still have no idea what the source of the problem was.

Edit: The actual project works as well! It takes a while to load for some reason (the index.side.wasm appears to be loaded without browser cache like 8 times, totaling a few hundred megs), but eventually it does work (and I really love the new style for the loader):

https://humnom.net/demos/gdsion/

@adamscott
Copy link
Member

Good news everyone, emscripten-core/emscripten#19496 has been merged on the emscripten side. So, technically, 3.1.62 should be able to compile with dlink_enabled=yes.

Based on the release tempo, the 3.1.62 release should be imminent.

@PgBiel
Copy link
Author

PgBiel commented Jul 15, 2024

Now that emscripten 3.1.62 has been released with the patch, I've recently tested the changes from #93143 (which appear to be available since 4.3-beta2) with godot-rust, and it's been a success! GDExtensions are working even on Firefox now - wonderful! I've tested both with the official 4.3-beta2 builds, as well as with web export templates built from source (commit 26d1577) with emscripten 3.1.62.

The only problem I had, which I'll share in case others also face this, is that I didn't realize that, since Godot now uses the -sSUPPORT_LONGJMP=wasm emscripten option, GDExtensions have to use the same option when building as well (which was already done for godot-cpp, for example). As a result, we faced some rather cryptic errors of the form below:

Aborted(Assertion failed: undefined symbol 'invoke_v'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment)

I eventually found out that Emscripten only generates those invoke_ functions when -sSUPPORT_LONGJMP is not changed from its default value of "emscripten" (see https://github.com/emscripten-core/emscripten/blob/34c1aa36052b1882058f22aa1916437ba0872690/tools/emscripten.py#L995-L998), so GDExtensions which didn't change that option would wrongly expect those functions to exist and fail to initialize - but it took me a bit to get there :) (Full investigation here: godot-rust/gdext#438 (comment))

Perhaps that error could be improved, but I'm not sure if there's much for Godot to do here (maybe an issue could be raised on upstream?).

Worth noting as well that -sSUPPORT_LONGJMP=wasm isn't enough to solve it for Rust users specifically, since the compiler appears to override that option by default, unless you specify -Cllvm-args=-enable-emscripten-cxx-exceptions=0 (from rust-lang/rust#112195 (comment)).

With that out of the way, however, the (rather simple) GDExtensions I've tested seem to be working well on the web so far. 👍

@akien-mga
Copy link
Member

akien-mga commented Aug 8, 2024

This was indeed fixed in Emscripten 3.1.62, so closing.

For the record, we're using 3.1.64 for official 4.3-rc/stable builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants