Stream: git-wasmtime

Topic: wasmtime / PR #11392 Fix Out-of-memory in table-ops


view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2025 at 05:47):

khagankhan opened PR #11392 from khagankhan:OOM-bugs to bytecodealliance:main:

I placed clamping logic at the beginning of the to_wasm_binary method since the OOM issues originate in to_wasm_binary This relies on TableOp::fixup to ensure that values respect those clamped limits to avoid potential traps.

I previously added clamping at the start of TableOps::fixup but the OOM still occurred there.

I let it fuzz for a while, and it ran fine but I sense something might be missing.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2025 at 05:47):

khagankhan requested fitzgen for a review on PR #11392.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2025 at 05:47):

khagankhan requested wasmtime-fuzz-reviewers for a review on PR #11392.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2025 at 05:49):

khagankhan edited PR #11392:

I placed clamping logic at the beginning of the to_wasm_binary method since the OOM issues originate in to_wasm_binary This relies on TableOp::fixup to ensure that values respect those clamped limits to avoid potential traps.

I previously added clamping at the start of TableOps::fixup but the OOM still occurred there.

I let it fuzz for a while, and it ran fine but I sense something might be missing.

Related Issues: #11345 and #11346

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2025 at 07:47):

github-actions[bot] commented on PR #11392:

Subscribe to Label Action

cc @fitzgen

<details>
This issue or pull request has been labeled: "fuzzing"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2025 at 16:11):

fitzgen submitted PR review:

Looks good to me with the nitpick about println! below addressed.

I think we should also switch to calling fixup at the start of to_wasm_binary instead of after each particular mutation, since it has to process all ops and can't take advantage of our knowledge of which mutation we performed and where that mutation was anymore. This change will cut down on the number of call sites and also make it more obvious that the clamping in to_wasm_binary won't ever produce invalid Wasm binaries. (With this PR now, I think we could produce invalid Wasm binaries from to_wasm_binary's clamping due to deserializing some ops that haven't been fixup'd to work with the clamping yet.) This can happen in a follow up PR if you'd prefer.

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2025 at 16:11):

fitzgen created PR review comment:

This should be log::debug! and not a println!.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2025 at 16:18):

khagankhan commented on PR #11392:

Thanks! Yes that makes sense. Initially, I did that. Calling fixup in to_wasm_binary(). It hit assertion failure at for limit > 0. I guess after addressing it we can do that. I will make another PR where clamping happen at the beginning of fixup and fixup is called in encoding.

I forgot to remove println! :/

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2025 at 21:47):

khagankhan updated PR #11392.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 20 2025 at 18:38):

khagankhan commented on PR #11392:

I was not merged. @fitzgen do you know why this may happen :thinking:?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 20 2025 at 18:45):

fitzgen commented on PR #11392:

It looks like CI failed, you can see this via the "view details" button next to the "github-merge-queue bot removed this pull request from the merge queue due to failed status checks" notification.

In particular, this job failed: https://github.com/bytecodealliance/wasmtime/actions/runs/16817124055/job/47636482289

It looks like it is old enough that the logs were deleted however, so I will try re-enqueing this PR and if it fails again, you can see the failure via the method described above.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 20 2025 at 19:17):

fitzgen commented on PR #11392:

This failure looks like some spurious networking issue involving docker or something. Retrying once more.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 20 2025 at 20:09):

fitzgen commented on PR #11392:

Looks like this time there was an internal assertion inside the macos linker?? Retrying once more...

view this post on Zulip Wasmtime GitHub notifications bot (Aug 20 2025 at 20:20):

khagankhan commented on PR #11392:

Thanks!:fingers_crossed:

view this post on Zulip Wasmtime GitHub notifications bot (Aug 20 2025 at 20:34):

fitzgen merged PR #11392.


Last updated: Dec 06 2025 at 07:03 UTC