arm_semihosting.zig – could @constCast cause a HardFault on read‑only memory?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- zig
- 領域
- embedded-iot
調査の方向性
Read core/src/core/arm_semihosting.zig lines 89–96 and trace callers to determine whether the data slice can refer to read-only memory or is guaranteed writable. Check how the function modifies and restores the final byte, then assess whether the current behavior is safe for flash-backed input. Done means the safety assumption is established and, if needed, a safe approach is agreed on.
索引モデルが issue の本文から書いたものです。
説明
core/src/core/arm_semihosting.zig
Lines: 89–96
Hi,I was looking at this piece of code and I have a question about safety.
The function receives data as []const u8, but then uses @constCast to turn it into []u8 and modifies the last byte (first setting it to 0, later restoring the original value).
In embedded systems, the caller might pass a string literal that lives in flash (read‑only memory). If that happens, wouldn’t that write operation trigger a HardFault? Or is the caller expected to always provide a buffer in RAM?
I’m not sure if I’m missing something – maybe the design assumes that the input is always writable? If not, would it be safer to copy the data to a temporary buffer before modifying it?
I’d appreciate your thoughts on this. Thanks!
- 主要言語
- Zig
- スター
- 2.3k
- フォーク
- 198
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 37
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ZigEmbeddedGroup/microzig のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
ZigEmbeddedGroup/microzig#1086 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 69/100
ZigEmbeddedGroup/microzig#1085 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ZigEmbeddedGroup/microzig#1061 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ZigEmbeddedGroup/microzig#1059 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
regz: AVR peripherals generated at address 0 when the register-group name matches the module (ATDF)オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
ZigEmbeddedGroup/microzig#1072 ·
メンテナーはふだん 1 日以内に返信
ZigEmbeddedGroup/microzig の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
1 type: problem 2 scope: firmware 3 good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
SpaceTeam/STS1_COBC_SW#511 ·
-
documentation good first issue
難易度 2/5 半日 初心者へのやさしさ 60/100
imaaiagent/fumi#1 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
shane-mason/FieldStation42#693 · コメント 3 件 ·
-
[BUG] OTA Requestor accepts reserved provider endpoint 0xFFFF対応中かも @Chapoly1305 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
project-chip/connectedhomeip#74742 ·
メンテナーはふだん 1 日以内に返信