Deallocations causing real-time issues in UniformSourceIterator
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- rust
調査の方向性
Read src/source/uniform.rs around UniformSourceIterator::next and src/conversions/sample_rate.rs around SampleRateConverter::into_inner; the issue links the relevant lines and includes an RT-sanitizer stack trace. Trace why the iterator drops and rebuilds its inner source during next, then determine how that behavior can avoid deallocation in real-time context. Done means the reported unsafe free no longer occurs during real-time iteration.
索引モデルが issue の本文から書いたものです。
説明
While reviewing real-time issues in the source code of a custom Source, which uses UniformSourceIterator, RT-sanitizer noticed the following call to free, which is not real-time safe:
==3137==ERROR: RealtimeSanitizer: unsafe-library-call
Intercepted call to real-time unsafe function `free` in real-time context!
#0 0x558ee21b2218 in free /home/runner/work/rtsan-libs/rtsan-libs/llvm-project/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp:781:36
#1 0x558ee3f3f462 in _$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::hb7b789cbf687a464 /home/lino/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:406:18
#2 0x558ee3f0a31a in core::ptr::drop_in_place$LT$alloc..raw_vec..RawVec$LT$f32$GT$$GT$::hbbace72dc3778dc1 /home/lino/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:524:1
#3 0x558ee3f09f43 in core::ptr::drop_in_place$LT$alloc..vec..Vec$LT$f32$GT$$GT$::ha086ab91020cee54 /home/lino/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:524:1
#4 0x558ee2192d9a in rodio::conversions::sample_rate::SampleRateConverter$LT$I$GT$::into_inner::h1bd55bdb7682e840 /home/lino/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rodio-0.21.1/src/conversions/sample_rate.rs:96:5
#5 0x558ee204f660 in _$LT$rodio..source..uniform..UniformSourceIterator$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::ha02484dbde2a47d6 /home/lino/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rodio-0.21.1/src/source/uniform.rs:82:21
#6 0x558ee2081e56 in _$LT$rodio_scheduler..Scheduler$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::haca8445718b4f9eb /home/lino/prj/coop-editor/rodio_scheduler/src/lib.rs:404:28
(The callstack then continues a bit further, omitted for clarity...)
SUMMARY: RealtimeSanitizer: unsafe-library-call /home/lino/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:406:18 in _$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::hb7b789cbf687a464
I believe this is caused by the inner source of the UniformSourceIterator being dropped/taken and then bootstrapped again inside the body of UniformSourceIterator::next:
https://github.com/RustAudio/rodio/blob/47dab16f79f02fe1c327a89c814c3e3f8498647b/src/source/uniform.rs#L82-L85
However, this behaviour dates back to at least 2015 from the history I've seen.
Is there a reason behind this design? Ideally I'd like to send a PR fixing it, but I would need some pointers first.
- 主要言語
- Rust
- スター
- 2.5k
- フォーク
- 338
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RustAudio/rodio のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 73/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
-
WavDecoder::size_hint underflows (u32 wrap, ~4.29e9) after EOF, causes multi-GB Vec::collect() allocation対応中かも @marin-m が 2 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
RustAudio/rodio の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
plrigaux/sysd-manager#85 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dsx-ai-factory/infra-controller#8341 ·
メンテナーはふだん 1 日以内に返信
-
enhancement triage:deciding
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
open-telemetry/otel-arrow#4540 ·
メンテナーはふだん 2 日以内に返信
-
benchmark: CSV report files contain blank records on Windows対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンcomponent:benchmark
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
agentic-os-org/ANOLISA#9177 ·
メンテナーはふだん 1 日以内に返信
-
area/mcp area/modeling effort/s impact/few priority/p3 severity/low triaged type/bug urgency/this-quarter
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
cristim/AztecCraft#336 ·
メンテナーはふだん 1 日以内に返信