Stream: wasmtime

Topic: breakpoint regression - windows


view this post on Zulip Steve Williams (Oct 13 2025 at 08:12):

k, after that confusion, have reproduced the regression I wanted. with latest everything, breakpoints using wasmtime work, breakpoints using c-api/dll don't. repro incoming.

view this post on Zulip Steve Williams (Oct 13 2025 at 08:39):

think the problem is picking up wrong version of wasmtime.dll or system can't find it. debug is really sensitive with that stuff, so most robust way seems to be to build c-api static.

gpt doesn't know how to do that, current tree, it says do this then build as normal.

set WASMTIME_STATIC_LIB=1
set WASMTIME_STATIC=1

... but trying to bind to that output get a bunch of unresolved.

view this post on Zulip Notification Bot (Oct 13 2025 at 08:39):

Steve Williams has marked this topic as unresolved.

view this post on Zulip Steve Williams (Oct 13 2025 at 09:01):

got static c-api test working. need to define
WASM_API_EXTERN=;WASI_API_EXTERN=

& bind libs no longer pulled from dll we're no longer referencing.

#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "advapi32.lib")
#pragma comment(lib, "userenv.lib")
#pragma comment(lib, "ntdll.lib")
#pragma comment(lib, "shell32.lib")
#pragma comment(lib, "ole32.lib")
#pragma comment(lib, "bcrypt.lib")

or however.

view this post on Zulip Steve Williams (Oct 13 2025 at 09:05):

breakpoints not working for me, static c-api also, but from wasmtime.exe they work.

view this post on Zulip Steve Williams (Oct 13 2025 at 09:25):

just a minute, this could be false alarm too. my test broken. sorry :)

view this post on Zulip Steve Williams (Oct 13 2025 at 13:12):

.

view this post on Zulip Steve Williams (Oct 13 2025 at 13:47):

as of right now c-api debugging using wasm instead of wasmtime interfaces not working for me on windows.
it could still be user error, but growing increasingly confident there's an issue. repro to follow

view this post on Zulip Steve Williams (Oct 13 2025 at 14:24):

this : https://docs.wasmtime.dev/c-api/

doesn't explain how to build c-api static or how to bind to it. process is above, as far as I can figure.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:11):

looking for a c-api app that loads fizzbuzz.wasm with debug
PastedText.txt

view this post on Zulip Steve Williams (Oct 13 2025 at 16:12):

output there - same wasm, run from wasmtime & c_api app. wasmtime can break, c_api app cannot.
repro in a minute.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:19):

repro: http://advance-software.com/misc/test_breakpoint.zip

view this post on Zulip Steve Williams (Oct 13 2025 at 16:20):

to reproduce, build your wasmtime.exe & put it in dist subdirectory. there's a 0 length placeholder there right now.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:21):

Platform: Windows 11/64

should then be able to : lldb -- .\wasmtime.exe -D debug-info --invoke app_init .\breakable.wasm
(lldb) b app_init
(lldb) r

& that works (for me)

view this post on Zulip Steve Williams (Oct 13 2025 at 16:23):

then build the c-api test in host, using visual studio 2022 : a couple of hardwired paths in there to change but its mostly portable. resulting .exe should end up in dist subdir, overwriting the 0 length placeholder.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:24):

run it directly to verify it works (from dist) : .\test_wasmtime_debug_api.exe .\breakable.wasm
should get result : 42

view this post on Zulip Steve Williams (Oct 13 2025 at 16:25):

then run under lldb : lldb -- .\test_wasmtime_debug_api.exe .\breakable.wasm
(lldb) b app_init
(lldb) r

breakpoint not hit. that's the bug.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:25):

source to breakable.wasm is in wasm subdir - its trivial.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:26):

tried c-api buiit static & dynamic. static my preference.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:30):

difference (guess) : wasmtime likely uses wasmtime API, the C API test uses the wasm API.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:33):

If anything isn't clear or anyone spots an obvious error, please just say.

view this post on Zulip Chris Fallin (Oct 13 2025 at 16:35):

@Steve Williams thanks for your interest. I've given this feedback in a few different ways before but I'll be more blunt this time: Zulip is not the place for a stream of consciousness. If you have specific questions, feel free to ask them, but a haphazard sequence of ~50 messages just from you, with no conversation, is not the appropriate use of this forum.

To your specific topic, native debugging is known to be unreliable and we're working on an alternative, but it isn't ready yet. That's the whole update, sorry.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:35):

dude, it's a repro for a regression.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:36):

its unreliable bcoz dll sensitivity on windows, that's why I'm trying to get it running static.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:37):

debugging does work. via wasmtime, it works. it doesn't work c-api. so whatever wasmtime is doing, c-api needs to. if I need to personally debug it, I guess that's tomorrow's job.

view this post on Zulip Chris Fallin (Oct 13 2025 at 16:42):

Please file an issue on GitHub then. Your stream-of-consciousness Zulip topics are difficult to follow and waste maintainers' time. Thanks.

view this post on Zulip Steve Williams (Oct 13 2025 at 16:58):

https://github.com/bytecodealliance/wasmtime/issues/11846

Test Case Repro: http://advance-software.com/misc/test_breakpoint.zip) Steps to Reproduce - Windows Build your wasmtime.exe & put it in repro dist subdirectory. (there's a 0 length placeholder ther...

view this post on Zulip Steve Williams (Oct 14 2025 at 06:38):

k, so it's debug time. grok says this triggers breakpoints. posting my thoughts here coz AI isn't always right so please correct if you know better.

https://x.com/i/grok/share/SFAEuYFH7BNfZc3Ui5EMzqBwI

view this post on Zulip Steve Williams (Oct 14 2025 at 06:58):

it would be helpful to know if breakpoints have regressed from C API all platforms. I don't think this is a Windows specific issue but it may be.

view this post on Zulip Steve Williams (Oct 14 2025 at 07:20):

Grok thinks it's identified the cause but AIs talk a lot of nonsense & I'm not familiar with the code, so who knows.
Maybe this helps.

https://x.com/i/grok/share/jTIYTmNBMlYB5YUFqS0VJvpes

view this post on Zulip Steve Williams (Oct 14 2025 at 07:25):

https://github.com/bytecodealliance/wasmtime/issues/9909

According to the documentation it should be possible to use a source/line debugger with guest code running inside the wasmtime VM. This works well for rust embeddings, but when using the c-api (or ...

Last updated: Dec 06 2025 at 06:05 UTC