emscripten-core / emscripten-core/emscripten

Running the compiled wasm program will cause an error:'memory fault'

Aperta
#21,079 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
27.6k
Fork
3.6k
Merge medio
1g 14h
PR unite (30g)
125

Descrizione

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.51 (c0c2ca1314672a25699846b4663701bcb6f69cca)
clang version 18.0.0git (https://github.com/llvm/llvm-project f2464ca317bfeeedddb7cbdea3c2c8ec487890bb)
wasmtime-cli 16.0.0 (6613acd1e 2023-12-20)
wasmedge version 0.13.5

the source code is:
[fasta.gcc-2.txt](https://github.com/emscripten-core/emscripten/files/13930523/fasta.gcc-2.txt)

the command is:
emcc fasta.gcc-2.c -o fasta.gcc-2.wasm
wasmtime fasta.gcc-2.wasm 1000

then it shows:
Error: failed to run main module `fasta.gcc-2.wasm`

Caused by:
0: failed to invoke command default
1: error while executing at wasm backtrace:
0: 0xa09 - !
1: 0x905 - !
2: 0x144b - !
3: 0x13c5 - !
2: memory fault at wasm address 0x10000fdec in linear memory of size 0x1000000
3: wasm trap: out of bounds memory access

if I use wasmedge to run fasta.gcc-2.wasm, it also shows:
wasmedge fasta.gcc-2.wasm 1000
[error] execution failed: out of bounds memory access, Code: 0x88
[error] Accessing offset from: 0x10000fdec to: 0x10000fdef , Out of boundary: 0x00ffffff
[error] In instruction: i32.store (0x36) , Bytecode offset: 0x00000a09
[error] When executing function name: "_start"

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con il codice sorgente allegato fasta.gcc-2.txt e riproduci il problema usando emcc fasta.gcc-2.c -o fasta.gcc-2.wasm, quindi esegui il risultato con wasmtime e WasmEdge. Traccia l’accesso fuori dai limiti segnalato nella posizione del backtrace wasm e determina se ha origine nella compilazione o nella configurazione del runtime; il lavoro è completato quando l’esempio viene eseguito senza il fault di memoria segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c, wasm
Ambito
compilers
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.