Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Wizer truncates data segment count to 10000, resulting in out-of-bounds indices

Aperta
#126 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust, wasm

Direzione di ricerca

Riproduci il problema con un file WebAssembly contenente più di 10.000 segmenti di dati, quindi traccia la gestione di data-count e naming-section da parte di Wizer. Verifica che la correzione preservi il conteggio completo dei segmenti di dati, mantenga coerenti gli indici e produca un output accettato da wasm-dis e wasm-opt.

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

Descrizione

I am running wizer on a large wasm file with 80390 data segments (I can provide it on request). The file output by wizer does preserve my data segments but the count value is truncated to 10000, resulting in a malformed wasm file according to tools like wasm-dis and wasm-opt since the naming section is still referring to the old indices.

Before:

   0x11a8c | 09 c4 a6 05 | element section
   0x11a90 | 01          | 1 count
   0x11a91 | 00          | element table[None]
   0x11a92 | 41 01       | i32_const value:1
   0x11a94 | 0b          | end
   0x11a95 | e3 81 02    | 32995 items [indices]
... 32995 lines removed ...
   0x26dd4 | 0c 03       | data count section
   0x26dd6 | 86 f4 04    | data count 80390
   0x26dd9 | 0a fa ef ca | code section
           | 06         
   0x26dde | 95 f8 02    | 48149 count

After:

   0x11a78 | 09 c4 a6 05 | element section
   0x11a7c | 01          | 1 count
   0x11a7d | 00          | element table[None]
   0x11a7e | 41 01       | i32_const value:1
   0x11a80 | 0b          | end
   0x11a81 | e3 81 02    | 32995 items [indices]
... 32995 lines removed ...
   0x26dc0 | 0c 02       | data count section
   0x26dc2 | 90 4e       | data count 10000
   0x26dc4 | 0a fa ef ca | code section
           | 06         
   0x26dc9 | 95 f8 02    | 48149 count

Causing tools like wasm-dis to output this warning:

warning: data index out of bounds in name section: .rodata.10000 at index 10000

And wasm-opt to fail more explosively with this:

wasm-opt: /b/s/w/ir/cache/builder/emscripten-releases/binaryen/src/wasm/wasm.cpp:1833: void wasm::Module::updateDataSegmentsMap(): Assertion `dataSegmentsMap.size() == dataSegments.size()' failed.

Since the resulting file still contains up to this:

 0x267d509 | 85 f4 04 0d | Naming { index: 80389, name: ".rodata.80389" }
           | 2e 72 6f 64
           | 61 74 61 2e
           | 38 30 33 38
           | 39         

I guess there might be a bug that it doesn't rewrite the indices, but I would question why there is such a small limit to begin with.

Lingua principale
Rust
Stelle
1.1k
Fork
64
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bytecodealliance/wizer

Tutte le issue di bytecodealliance/wizer

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.