Assertion failure in `post_return()` for functions returning `error-context`

オープン
#1,413 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
40/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust, wasm

調査の方向性

まず最小の test.wit と wit-bindgen rust コマンドで panic を再現し、次に crates/core/src/abi.rs の 1316 行付近と post_return() パスを調査します。exported function が error-context を返す場合の Rust バインディング生成が assertion failure なしに完了すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Summary

wit-bindgen panics with "assertion failed: sig.retptr" when generating bindings for a WIT world that exports a function returning error-context.

Environment
  • wit-bindgen version: 0.47.0
  • Affected generator: Rust
  • OS: Ubuntu 22.04, x86-64
Steps to Reproduce
  1. Create a minimal WIT file

    Save the following as test.wit:

    package poc:demo;
    
    world retptr-bug {
      export get-error: func() -> error-context;
    }
    
  2. Run wit-bindgen

    wit-bindgen rust --out-dir /tmp/test test.wit
    
  3. Observe the panic

    thread 'main' panicked at /home/runner/work/wit-bindgen/wit-bindgen/crates/core/src/abi.rs:1316:9
    assertion failed: sig.retptr
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
主要言語
Rust
スター
1.5k
フォーク
306
平均マージ
1日 4時間
マージ済み PR(30日)
21

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bytecodealliance/wit-bindgen のほかの issue

bytecodealliance/wit-bindgen の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。