emscripten-core / emscripten-core/emscripten

Enabling SAFE_HEAP leads to wasm-validator errors

Open
#22,279 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

When setting the `-sSAFE_HEAP=1` flag, I end up getting dozens of errors like the following:
```
[wasm-validator error in function cv::hal::cpu_baseline::\28anonymous\20namespace\29::RGB2HSV_b::TablesSingleton::getInstance\28\29] unexpected false: call target must exist, on
(call $SAFE_HEAP_LOAD_i32_1_U_A
(local.get $2)
(i32.const 0)
)
```

Mostly in the cv namespace (we use OpenCV), mostly `SAFE_HEAP_LOAD_i32_1_U_A`, but there is also some stuff from the libc++ (e.g. `long\20long\20std::__2::__cxx_atomic_load\5babi:v160004\5d\28std::__2::__cxx_atomic_base_impl\20const*\2c\20std::__2::memory_order\29`) and with other functions, like `SAFE_HEAP_STORE_i64_8_A` or `SAFE_HEAP_LOAD_i64_8_A`.

Is there any way to get around those errors ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.