Rust codegen: takeRustHandle moves from shared storage even when refCount is greater than 1
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
valdi_core/src/valdi_core/cpp/Marshalling/RustValdi.hppから始め、ハンドルの解放と参照カウントのロジックと併せてtakeRustHandleを読みます。Issueでは、共有値で発生する不具合と対処すべき条件が説明されています。refCountが1を超える場合、コピー構築可能なTはコピーし、それ以外の場合はムーブ動作を維持します。共有所有者が元の値を保持すれば完了です。payloadには実行するテストが記載されていません。
索引モデルが issue の本文から書いたものです。
説明
Found while reviewing https://github.com/Snapchat/Valdi/pull/211 (native Rust code generation). Not blocking that PR.
takeRustHandle moves from shared storage even when refCount is greater than 1
File: valdi_core/src/valdi_core/cpp/Marshalling/RustValdi.hpp
If takeRustHandle is called on a ValdiRustHandle that has been retained by more than one owner, remaining handle holders observe a moved-from object (for example, a Valdi::Value reset to Null). This happens because takeRustHandle unconditionally applies std::move to getRustHandleValue<T>(handle) before calling valdi_rust_handle_release.
When handle->refCount is greater than 1, releasing the handle only decrements the reference count and leaves the underlying RustHandleStorage<T> alive for other owners, so moving out of it corrupts their shared value.
For copy-constructible T, copy getRustHandleValue<T>(handle) instead of moving when handle->refCount exceeds 1.
- 主要言語
- C++
- スター
- 16.4k
- フォーク
- 539
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Snapchat/Valdi のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
Rust codegen: RustMethodResolver fails to unwrap .nullable on optional interface/module methodsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
RTL-SDR: re-enumerating while streaming removes the in-use entry from the device selection dialog対応中かも @dpc00 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
throneproj/Throne#2227 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
deepseek-ai/DeepGEMM-Ascend#49 ·
メンテナーはふだん 1 日以内に返信