Skip to content

fix: remove incorrect caller_already_converted for re-exporter adapters#90

Merged
avrabe merged 1 commit intomainfrom
fix/remove-reexporter-caller-converted
Apr 5, 2026
Merged

fix: remove incorrect caller_already_converted for re-exporter adapters#90
avrabe merged 1 commit intomainfrom
fix/remove-reexporter-caller-converted

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 5, 2026

Summary

Remove the re-exporter caller_already_converted logic from PR #81. With handle tables disabled (PR #89), re-exporters pass canonical handles through wasmtime's built-in handle table. The downstream adapter must call resource.rep to convert handles to representations.

Root cause found via wasmtime 43: the error was misaligned pointer dereference: address must be a multiple of 0x8 but is 0x3 — the adapter passed handle index 3 directly to the leaf's code which expected an 8-byte-aligned heap pointer.

The 3 resource chain tests now get past the pointer conversion layer. Remaining failure is Option::unwrap() on None in the leaf's internal ResourceTable lookup.

Part of #69.

Test plan

  • 276 tests pass, 0 failures
  • No regressions

🤖 Generated with Claude Code

The re-exporter caller_already_converted logic (PR #81) was designed
for handle tables, marking all borrow params from re-exporter
components as pre-converted. With handle tables disabled (PR #89),
re-exporters pass canonical handles (not reps), so the downstream
adapter MUST call resource.rep to convert.

Removing this fixes the "misaligned pointer dereference: address must
be a multiple of 0x8 but is 0x3" crash — the adapter was passing
handle index 3 directly to the leaf's code which expected a heap
pointer.

The 3 resource chain tests now get past pointer conversion (was:
misaligned pointer trap). Remaining: leaf's ResourceTable::get
returns None — needs further adapter/resource-lifecycle investigation.

Part of #69, closes #73.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 6fb5916 into main Apr 5, 2026
4 checks passed
@avrabe avrabe deleted the fix/remove-reexporter-caller-converted branch April 5, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant