AvoidReinterprets: `i32.atomic.load` under `f32.reinterpret_i32` loses its atomicity
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 76/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- wasm
- Bereich
- compilers
Rechercherichtung
Beginne im Pass AvoidReinterprets bei makeReinterpretedLoad und reproduziere das Problem mit dem bereitgestellten .wat-Modul unter Verwendung von wasm-opt --avoid-reinterprets --print. Erledigt ist die Aufgabe, wenn ein i32.atomic.load nicht in einen nicht-atomaren f32.load umgeschrieben wird und das ursprüngliche Zugriffsverhalten erhalten bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- WebAssembly
- Sterne
- 8.7k
- Forks
- 893
- Ø Merge
- 1 T. 14 Std.
- Gemergte PRs (30 T.)
- 77
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus WebAssembly/binaryen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
WebAssembly/binaryen#9135 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 76/100
WebAssembly/binaryen#9018 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
TupleOptimization: tuple swap is miscompiledEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
WebAssembly/binaryen#9210 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
WebAssembly/binaryen#9186 ·
Maintainer antworten meist innerhalb von 1 Tag
-
LoopInvariantCodeMotion: `struct.new` is hoisted out of a loop, so all iterations share one objectOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
WebAssembly/binaryen#9184 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in WebAssembly/binaryen
Ähnliche Issues
-
I-prioritize needs-triage regression-from-stable-to-beta T-lang
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
rust-lang/rust#163830 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
rubys/roundhouse#444 ·
Maintainer antworten meist innerhalb von 1 Tag
-
crash llvm:codegen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
llvm/llvm-project#229064 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:lowering kind:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
vxc prints a debug line '[flat-codegen] emitted module via the flat path' on every compileEvtl. vergeben @YodHeVauHe hat das heute übernommen. Offendevex good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag