RuntimeError when encoding to UASTC with WASM
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- cmake, wasm
- Ambito
- build-system
Direzione di ricerca
Start with webgl/encoder/README.md to reproduce the WASM encoder build, then inspect webgl/encoder/CMakeLists.txt at the LINK_FLAGS setting named in the issue. Check how STACK_SIZE affects UASTC encoding and whether 10 MB is appropriate; done means the reported out-of-bounds memory error is resolved with a justified stack size.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
- Windows Version 10.0
- Clone the current state (this commit at the time of writing this)
- Clone the current emsdk (this commit at the time of writing this)
- Use LLVM version 12.0.0 (if that matters)
- Run the
emsdk_env.batto set up the PATH - Compile the encoder, as described in the
webgl/encoder/README.md
The result will be thebasis_encoder.jsandwasmfiles, attached here for reference:
basis_encoder-build.zip - Serve the
/webgldirectory with a local server - Visit
http://localhost:..../encode_test/ - Select the
UASTCcheck box - Hit 'Encode!'
The console shows
basis_encoder.wasm:0x36da2 Uncaught RuntimeError: memory access out of bounds
at basis_encoder.wasm:0x36da2
at basis_encoder.wasm:0x282a3
at basis_encoder.wasm:0x14223
at basis_encoder.wasm:0xb0c
at basis_encoder.wasm:0xd7983
at basis_encoder.wasm:0xd72a5
at ClassHandle.BasisFile$getFileDesc [as getFileDesc] (eval at newFunc (basis_encoder.js:8:81985), <anonymous>:8:10)
at dumpBasisFileDesc ((index):160:33)
at dataLoaded ((index):230:3)
at PNGDataLoaded ((index):471:3)
This happens on Chrome 116.0 and FireFox 117.0, and the same error appears when using the build output in Node.js, so it seems to be a general issue.
Possible solution
After a bunch of trial and error, I stumbled over https://github.com/emscripten-core/emscripten/issues/19268#issuecomment-1544298860 , and after changing the LINK_FLAGS in the CMakeLists.txt to include the STACK_SIZE like this...
LINK_FLAGS "--bind -s ALLOW_MEMORY_GROWTH=1 -O3 -s ASSERTIONS=0 -s INITIAL_MEMORY=299958272 -s MALLOC=emmalloc -s MODULARIZE=1 -s EXPORT_NAME=BASIS -s STACK_SIZE=10MB")
... the problem no longer appears.
If others confirm that this makes sense (or add details, like which other size than 10MB might be more appropriate), I can create a corresponding PR.
- Lingua principale
- C++
- Stelle
- 3.1k
- Fork
- 347
- Merge medio
- 4g 3h
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di BinomialLLC/basis_universal
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BinomialLLC/basis_universal#476 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
BinomialLLC/basis_universal#471 · 1 commento · 1 reazione ·
-
ktx2_transcoder::transcode_image_level asserts on a malformed uncompressedByteLength instead of returning falseForse già presa @albertrodriguezclo l’ha presa 24 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
BinomialLLC/basis_universal#472 · 2 commenti · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
BinomialLLC/basis_universal#465 ·
-
Support custom key/value pairs in KTX2 compressionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 54/100
BinomialLLC/basis_universal#454 · 1 commento ·
Tutte le issue di BinomialLLC/basis_universal
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
-
area:qmc bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
I maintainer di solito rispondono entro 3 giorni
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
ASGC-Game-Jam/asgc-gamejam-2026#563 ·
I maintainer di solito rispondono entro 1 giorno
-
area/ysql kind/bug priority/medium status/awaiting-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
yugabyte/yugabyte-db#37523 ·
I maintainer di solito rispondono entro 1 giorno
-
Let agents name their jobsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100