Skip to content

fix: add defer pinner.Unpin()#1613

Merged
dicej merged 2 commits into
bytecodealliance:mainfrom
asteurer:bugfix
May 20, 2026
Merged

fix: add defer pinner.Unpin()#1613
dicej merged 2 commits into
bytecodealliance:mainfrom
asteurer:bugfix

Conversation

@asteurer
Copy link
Copy Markdown
Contributor

This fixes the following panic I'm getting when using async WIT functions:

 panic: runtime error: runtime.Pinner: found leaking pinned pointer; forgot to call Unpin()?

goroutine 6 [running]:
runtime.runFinalizers()
    /home/asteurer/.cache/componentize-go/v2/go-linux-amd64-bootstrap/src/runtime/mfinal.go:272 +0x5e
error while executing at wasm backtrace:
0: 0x11d931 - <unknown>!runtime.abort
1: 0x95f45 - <unknown>!runtime.fatalpanic
2: 0x113d55 - <unknown>!runtime.gopanic
3: 0x1201a8 - <unknown>!wasm_pc_f_loop_export
4: 0x18c0de - <unknown>!_async_lift_my_func

@dicej

Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, thanks for catching this.

Would you be up for adding a test case that covers this?

Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com>
@dicej dicej added this pull request to the merge queue May 20, 2026
Merged via the queue into bytecodealliance:main with commit 95995ce May 20, 2026
29 checks passed
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.

2 participants