Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

AvoidReinterprets: `i32.atomic.load` under `f32.reinterpret_i32` loses its atomicity

オープン 初心者向け
#9,185 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
wasm
領域
compilers

調査の方向性

AvoidReinterprets パスの makeReinterpretedLoad から始め、提供された .wat モジュールを使って wasm-opt --avoid-reinterprets --print で問題を再現します。i32.atomic.load が非アトミックな f32.load に書き換えられず、元のアクセス動作が維持されれば完了です。

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

説明

Summary

makeReinterpretedLoad rebuilds the load from bytes/offset/align/ptr/type/memory and does not carry over isAtomic.

Root cause

The rebuilt load copies the listed fields only, so the original load's isAtomic is dropped.

Copying isAtomic is not a fix, because atomic loads exist only for i32 and i64 (the validator rejects other types) and the rebuilt load has type f32. The pass should skip atomic loads.

Affected passes

Only AvoidReinterprets.

Reproducer
(module (memory 1 1)
  (func (export "f") (param $p i32) (result f32)
    (f32.reinterpret_i32 (i32.atomic.load (local.get $p)))))
$ wasm-opt in.wat -all --avoid-reinterprets --print
 (func $0 (type $0) (param $p i32) (result f32)
  (f32.load
   (local.get $p)
  )
 )

The i32.atomic.load has become a plain f32.load.

Expected vs actual

An unaligned address that traps for the atomic access no longer traps, and on a shared memory the access is no longer atomic.

Version

Reproduced on upstream main at 4d8ac549e2ab9b283246ea95e79ebe139ca579ac (wasm-opt version 133).

AI was used as part of the process of finding this issue. I have manually checked and reproduced it.

主要言語
WebAssembly
スター
8.7k
フォーク
893
平均マージ
1日 14時間
マージ済み PR(30日)
77

環境構築

はじめの一歩

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

WebAssembly/binaryen のほかの issue

WebAssembly/binaryen の issue をすべて見る

似ている issue

Compilers の issue をもっと見る

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

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