emscripten-core / emscripten-core/emscripten

runtime_debug/checkInt overly aggressive when ASSERTIONS=2

Abierto
#19,655 4 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
27.6k
Forks
3.6k
Merge medio
1 d 14 h
PR fusionados (30 d)
125

Descripción

When I run my emscripten app for debugging after compiling it with ASSERTIONS=2, the app aborts after calling stat, and after calling fillMouseEventData.

- In stat, the stat.rdev instance member is 'undefined', which causes an abort. (library_workerfs.js:85)
- In fillMouseEventData, 'e.clientX - rect.left' resolves to a float, not an int, which also causes an abort. (library_html5.js:439)

I believe this pull request is the breaking change for me: https://github.com/emscripten-core/emscripten/pull/19251

I've reverted to ASSERTIONS=1, but I'd love to debug with a higher assertion level.

**Console output**
t RuntimeError: Aborted(Assertion failed: attempt to write non-integer (undefined) into integer heap)
at abort (cskyclasses-debug.js:836:10)
at assert (cskyclasses-debug.js:615:3)
at checkInt (cskyclasses-debug.js:1074:2)
at checkInt32 (cskyclasses-debug.js:1085:27)
at setValue_safe (cskyclasses-debug.js:5460:3)
at SAFE_HEAP_STORE (cskyclasses-debug.js:564:2)
at Object.doStat (cskyclasses-debug.js:4697:3)
at ___syscall_stat64 (cskyclasses-debug.js:5807:19)
at fstatat (fstatat.c:148:9)
at stat (stat.c:6:9)

**Version of emscripten/emsdk:**
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.41 (71634e036d20209a5d81c2b2171e145b44de1e12)
clang version 17.0.0 (https://github.com/llvm/llvm-project 88421ea973916e60c34beb26597a5fc33f83dd8f)
Target: wasm32-unknown-emscripten
Thread model: posix

**Full link command and output with `-v` appended:**
Output of link is attached.
[ssww_emcc_link_log_2023-06-19.txt](https://github.com/emscripten-core/emscripten/files/11807360/ssww_emcc_link_log_2023-06-19.txt)

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con checkInt en el runtime generado e inspecciona los sitios indicados en library_workerfs.js:85 y library_html5.js:439. Reproduce las rutas stat y fillMouseEventData con ASSERTIONS=2; se considera terminado cuando esas llamadas ya no se abortan ante los valores undefined o float indicados.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, wasm
Área
compilers
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.