Memory out of bounds when builing WebHare 5.6

40 views
Skip to first unread message

Robin Leenheer

unread,
Nov 22, 2024, 5:00:33 AM11/22/24
to General WebHare developers discussion
I am currently trying to build WebHare 5.6 and during this build i encounter the error "RuntimeError: memory acces out of bounds". I get no errors when i go back to 5.5, however i would still like to upgrade to 5.6. 

Does anyone know if this is fixable and how to fix this? 

Error message fixbbuild:
RuntimeError: memory access out of bounds
    at blex-test-wasm.wasm.strlen (wasm://wasm/blex-test-wasm.wasm-009f6462:wasm-function[63]:0x2aa1)
    at blex-test-wasm.wasm.std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>* std::__2::__uninitialized_allocator_copy_impl[abi:ne180100]<std::__2::allocator<std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>>, char**, char**, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>*>(std::__2::allocator<std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>>&, char**, char**, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>*) (wasm://wasm/blex-test-wasm.wasm-009f6462:wasm-function[295]:0x1c87d)
    at blex-test-wasm.wasm.Blex::InvokeMyMain(int, char**, int (*)(std::__2::vector<std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>, std::__2::allocator<std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>>> const&)) (wasm://wasm/blex-test-wasm.wasm-009f6462:wasm-function[1650]:0x207567)
    at blex-test-wasm.wasm.main (wasm://wasm/blex-test-wasm.wasm-009f6462:wasm-function[1484]:0xa247d)
    at blex-test-wasm.wasm (wasm://wasm/blex-test-wasm.wasm-009f6462:wasm-function[1696]:0x209b86)
    at ret.<computed> (/Users/admin/projects/whbuild/release-webhare/bin/blex-test-wasm:1:97326)
    at Module._main (/Users/admin/projects/whbuild/release-webhare/bin/blex-test-wasm:1:100782)
    at callMain (/Users/admin/projects/whbuild/release-webhare/bin/blex-test-wasm:1:101329)
    at doRun (/Users/admin/projects/whbuild/release-webhare/bin/blex-test-wasm:1:101786)
    at run (/Users/admin/projects/whbuild/release-webhare/bin/blex-test-wasm:1:101958)

Node.js v23.3.0
gmake: *** [/Users/admin/projects/webhare/builder/base_makefile:672: success.wasm-blex] Error 1

Make failed with errorcode 2

Arnold Hendriks

unread,
Nov 22, 2024, 5:30:22 AM11/22/24
to General WebHare developers discussion, Robin Leenheer
I think this may be either
- emscripten being broken (either the current version of emscripten or the combination of emscripten with node)
- the wrong version of esmcripten being used (ie webhare not installing the right one)
- be caused by a build artifact not being updated 

What does `emcc -v` say ?

You could try a `wh make clean` first (or discard the build cache completely, usually ~/projects/whbuild) 

Robin Leenheer

unread,
Nov 22, 2024, 5:49:01 AM11/22/24
to General WebHare developers discussion, Arnold Hendriks, Robin Leenheer
I tried the 'wh make clean' and completely removing the build cache but with no result, i get the same error message. 

'emcc -v' returns the following:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.72-git
clang version 20.0.0git
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /usr/local/Cellar/emscripten/3.1.72/libexec/llvm/bin

Op vrijdag 22 november 2024 om 11:30:22 UTC+1 schreef Arnold Hendriks:

Arnold Hendriks

unread,
Nov 22, 2024, 5:53:09 AM11/22/24
to General WebHare developers discussion
Are you on an Intel or ARM mac? Is everything else up to date?

Can't reproduce it here with node 23.3.0 and the same emcc

(A WebHare commit is incoming which will allow it to print all relevant versions on a make failure - I now have:

Versions: procs=13 wh=5.7.0 commit=edge/arnoldhendriks@aefd6055cf19211535058a64d434eb4de6524176 make=4.4.1 npm=10.9.0 arch=arm64/Darwin/24.1.0 whnode=v22.11.0 systemnode=v23.3.0

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.60 (42a6ea2052f19f70d7d994e8c324bcad2f1f8939)

clang version 19.0.0git (https:/github.com/llvm/llvm-project bc9823cf60bf91cc8b45248c4205cd2c67b2a3d5)

Target: wasm32-unknown-emscripten

Thread model: posix

InstalledDir: /Users/arnold/projects/webhare/vendor/emsdk/upstream/bin

)

Arnold Hendriks

unread,
Nov 22, 2024, 5:55:42 AM11/22/24
to General WebHare developers discussion, Arnold Hendriks
Oh wait, interesting. My emcc -v matched your version, but the one in WebHare is still older.

You could try: brew uninstall emscripten
to ensure that it can't use 3.1.72 but has to use the 3.1.60 shipped with webhare

Robin Leenheer

unread,
Nov 22, 2024, 6:22:38 AM11/22/24
to General WebHare developers discussion, Arnold Hendriks
My mac has an Intel i7. I have uninstalled the emscripten and ensured my Node (and npm) version is the same as yours. 
But, unfortunately, still the same error on both mic and fixbuild while also using the 'wh make clean'. 

Op vrijdag 22 november 2024 om 11:55:42 UTC+1 schreef Arnold Hendriks:

Arnold Hendriks

unread,
Nov 22, 2024, 6:35:31 AM11/22/24
to General WebHare developers discussion
And you're definitely not building against emscripten 3.1.72 because then you would see

TypeError: WebAssembly.Suspending is not a constructor
    at Object.instrumentWasmImports (/Users/arnold/projects/whbuild/release-webhare/bin/blex-test-wasm:1:88763)
    at getWasmImports (/Users/arnold/projects/whbuild/release-webhare/bin/blex-test-wasm:1:6870)
    at createWasm (/Users/arnold/projects/whbuild/release-webhare/bin/blex-test-wasm:1:6995)
    at Object.<anonymous> (/Users/arnold/projects/whbuild/release-webhare/bin/blex-test-wasm:1:92237)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Object..js (node:internal/modules/cjs/loader:1689:10)
    at Module.load (node:internal/modules/cjs/loader:1318:32)
    at Function._load (node:internal/modules/cjs/loader:1128:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)

which if I'm not mistaken has to do with node 22 not supporting emscripten 3.1.72 - the primary reason we're keeping it at 3.1.60

I've run out of suggestions so far.... As far as I know Rob has the same versions and none of these issues. 

If you update to the current WebHare master branch now, wh make should give more version information

(BTW: I was assuming you're trying to build the master branch, not the release/5.6 branch)

Robin Leenheer

unread,
Nov 22, 2024, 8:28:31 AM11/22/24
to General WebHare developers discussion, Arnold Hendriks
wh make on latest master commit doesn't result in an error and is buildable too, however when i use 'wh fixmodules' it returns the following:
Uncaught rejection Error: No assetpacks match masks: *
    at getBundles (/Users/admin/projects/webhare/whtree/modules/system/scripts/whcommands/assetpack.ts:140:11)
    at async Command.<anonymous> (/Users/admin/projects/webhare/whtree/modules/system/scripts/whcommands/assetpack.ts:51:21)
wh assetpack recompile --onlyfailed failed with errorcode 1


Op vrijdag 22 november 2024 om 12:35:31 UTC+1 schreef Arnold Hendriks:

Arnold Hendriks

unread,
Nov 22, 2024, 8:36:36 AM11/22/24
to General WebHare developers discussion, Robin Leenheer, Arnold Hendriks
Is WebHare already running? What does 'wh assetpack list' say ?

Robin Leenheer

unread,
Nov 22, 2024, 8:45:38 AM11/22/24
to General WebHare developers discussion, Arnold Hendriks, Robin Leenheer
Yes, WebHare is running. 
wh assetpack gives OK for all assetpacks. 

Op vrijdag 22 november 2024 om 14:36:36 UTC+1 schreef Arnold Hendriks:

Arnold Hendriks

unread,
Nov 26, 2024, 2:00:27 AM11/26/24
to General WebHare developers discussion, Robin Leenheer, Arnold Hendriks
Looks like that happens when all assetpacks are actually fine

moe:modules arnold$ wh assetpack compile --onlyfailed "*"

Uncaught rejection Error: No assetpacks match masks: *

Will fix that, but at least it shouldn't  indicate a problem

Reply all
Reply to author
Forward
0 new messages