Stream: wasmtime

Topic: Debugging a wasm module in a hyperlight guest


view this post on Zulip bjorn3 (Jun 12 2025 at 11:04):

You are using the steps at https://github.com/hyperlight-dev/hyperlight/blob/main/docs/how-to-debug-a-hyperlight-guest.md to attach gdb to the guest process? You could try if enabling debug-builtins compiles. Also make sure to tell Wasmtime to generate debuginfo in the first place (config.debug_info(true)).

Hyperlight is a lightweight Virtual Machine Manager (VMM) designed to be embedded within applications. It enables safe execution of untrusted code within micro virtual machines with very low latenc...

view this post on Zulip Notification Bot (Jun 12 2025 at 11:05):

2 messages were moved here from #wasmtime > Debugging wasm with lldb/gdb by bjorn3.

view this post on Zulip Doru Blânzeanu (Jun 12 2025 at 11:21):

Yes, I am using the steps in Hyperlight, this is not related to hyperlight.
I am able to attach and debug the guest. However, when the guest tries to use the wasmtime runtime to execute a module, I am not able to make gdb/lldb interactively debug the wasm source code for the module

view this post on Zulip Doru Blânzeanu (Jun 12 2025 at 11:23):

I provided the config.debug_info(true) option to the wasmtime Engine Config.

view this post on Zulip Doru Blânzeanu (Jun 12 2025 at 14:40):

I am wondering whether the debug-builtins are needed for this to work.

view this post on Zulip bjorn3 (Jun 12 2025 at 19:02):

Yeah, I believe you need to enable debug-builtins.

view this post on Zulip Doru Blânzeanu (Jun 16 2025 at 14:30):

I've looked more thoroughly and tested and it does need the debug-builtins feature to allow debugger inspect the wasm module at runtime.
I cannot enable debug-builtins because it depends on the std feature and I am running in a no_std environment.
I've browsed the code that depends on the debug-builtins feature, and I am not sure, but it looks like that could be modified to run in a no_std env.

What do you think?

view this post on Zulip Alex Crichton (Jun 16 2025 at 14:45):

When no_std support was added most preexisting features were flagged as requiring std blindly. If debug-builtins works without std then that's great! If you're able to help out (which would be much appreciated!) the fix would look like configuring CI to test the feature here (e.g. adding it to the list of features already built) and then fixing up any issues that arise.

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant - bytecodealliance/wasmtime

view this post on Zulip Doru Blânzeanu (Jun 16 2025 at 14:50):

Thanks for the explanation, Alex!
I'll try make it not depend on std :smile:

view this post on Zulip Ralph (Jun 17 2025 at 09:35):

GO DORU GO

view this post on Zulip Doru Blânzeanu (Jul 22 2025 at 20:07):

I've submitted a PR regarding this no_std support for the debug-builtins feature, and I can't seem to figure out why cargo vet fails.

https://github.com/bytecodealliance/wasmtime/pull/11304

Description This PR takes care of enabling the compilation of gdb_jit_int module in the jit-debug crate to ensure the native debugging also works in no_std environments. The This work has been disc...

view this post on Zulip Doru Blânzeanu (Jul 23 2025 at 15:42):

We are targeting Wasmtime 36.0.0 LTS release to use for debugging wasm modules/components running in the no_std environment of a Hyperlight guest.

view this post on Zulip Doru Blânzeanu (Jul 30 2025 at 16:03):

Thanks for the help provided in merging this! It is in time for the v36.0.0 right?

view this post on Zulip Alex Crichton (Jul 30 2025 at 16:39):

It is indeed yeah, that'll branch next week


Last updated: Dec 06 2025 at 06:05 UTC