shuidi9527-source opened issue #12691:
Test Case
A minimal Rust WASM module (no thread/atomic code or dependencies) targeting wasm32-wasip1:
// src/lib.rs #[no_mangle] pub extern "C" fn add(a: i32, b: i32) -> i32 { a + b }Compile to WASM: cargo build --target wasm32-wasip1 --releaseOutput: target/wasm32-wasip1/release/test.wasm
Steps to Reproduce
- Compile WASM to aarch64-linux-android cwasm using Wasmtime v42.0.1 CLI:
wasmtime compile \ --target aarch64-linux-android \ -o test.cwasm \ ./target/wasm32-wasip1/release/test.wasm
- Deserialize test.cwasm using Wasmtime C++ API (v42.0.1 Android static library)
#include <wasmtime.hh> #include <vector> #include <fstream> int main() { std::ifstream file("test.cwasm", std::ios::binary | std::ios::ate); std::streamsize size = file.tellg(); file.seekg(0, std::ios::beg); std::vector<uint8_t> cwasm_bytes(size); file.read((char*)cwasm_bytes.data(), size); wasmtime::Config config; config.wasm_threads(false); config.wasm_bulk_memory(true); wasmtime::Engine engine(config); auto module_res = wasmtime::Module::deserialize(engine, cwasm_bytes); if (!module_res) { std::cerr << "Error: " << module_res.err().message() << std::endl; return 1; } return 0; }
- Compile C++ with NDK 26.x for Android aarch64 and run on device.
- Etc...
Expected Results
Deserialization succeeds with no errors.
Actual Results
Deserialization fails with error:
Module was compiled with concurrency support but it is not enabled for the hostProgram crashes:
libc++abi: terminating due to uncaught exception of type std::runtime_errorVersions and Environment
- Wasmtime version or commit: v42.0.1 (buggy), v41.0.0 (partial bug), v40.0.0 (working)
- Operating system (compile cwasm): macOS aarch64
- Operating system (run cwasm): Android 13 (API 33) aarch64
- Architecture: aarch64-linux-android (cwasm target), wasm32-wasip1 (Wasm source)
Extra Info
v40.0.0: works correctly (no concurrency flag)
shuidi9527-source added the bug label to Issue #12691.
fitzgen commented on issue #12691:
You need to configure with
-W threads=n/config.wasm_threads(false)when pre-compiling the Wasm if you want to run that pre-compiled Wasm with-W threads=n/config.wasm_threads(false). Wasmtime will not keep track of which Wasm features a binary actually uses, only which Wasm features were enabled at compilation time.
shuidi9527-source closed issue #12691:
Test Case
A minimal Rust WASM module (no thread/atomic code or dependencies) targeting wasm32-wasip1:
// src/lib.rs #[no_mangle] pub extern "C" fn add(a: i32, b: i32) -> i32 { a + b }Compile to WASM: cargo build --target wasm32-wasip1 --releaseOutput: target/wasm32-wasip1/release/test.wasm
Steps to Reproduce
- Compile WASM to aarch64-linux-android cwasm using Wasmtime v42.0.1 CLI:
wasmtime compile \ --target aarch64-linux-android \ -o test.cwasm \ ./target/wasm32-wasip1/release/test.wasm
- Deserialize test.cwasm using Wasmtime C++ API (v42.0.1 Android static library)
#include <wasmtime.hh> #include <vector> #include <fstream> int main() { std::ifstream file("test.cwasm", std::ios::binary | std::ios::ate); std::streamsize size = file.tellg(); file.seekg(0, std::ios::beg); std::vector<uint8_t> cwasm_bytes(size); file.read((char*)cwasm_bytes.data(), size); wasmtime::Config config; config.wasm_threads(false); config.wasm_bulk_memory(true); wasmtime::Engine engine(config); auto module_res = wasmtime::Module::deserialize(engine, cwasm_bytes); if (!module_res) { std::cerr << "Error: " << module_res.err().message() << std::endl; return 1; } return 0; }
- Compile C++ with NDK 26.x for Android aarch64 and run on device.
- Etc...
Expected Results
Deserialization succeeds with no errors.
Actual Results
Deserialization fails with error:
Module was compiled with concurrency support but it is not enabled for the hostProgram crashes:
libc++abi: terminating due to uncaught exception of type std::runtime_errorVersions and Environment
- Wasmtime version or commit: v42.0.1 (buggy), v41.0.0 (partial bug), v40.0.0 (working)
- Operating system (compile cwasm): macOS aarch64
- Operating system (run cwasm): Android 13 (API 33) aarch64
- Architecture: aarch64-linux-android (cwasm target), wasm32-wasip1 (Wasm source)
Extra Info
v40.0.0: works correctly (no concurrency flag)
shuidi9527-source commented on issue #12691:
I tried it, but it didn't work.
shuidi9527-source deleted a comment on issue #12691:
I tried it, but it didn't work.
shuidi9527-source commented on issue #12691:
I tried it, but it didn't work.
shuidi9527-source reopened issue #12691:
Test Case
A minimal Rust WASM module (no thread/atomic code or dependencies) targeting wasm32-wasip1:
// src/lib.rs #[no_mangle] pub extern "C" fn add(a: i32, b: i32) -> i32 { a + b }Compile to WASM: cargo build --target wasm32-wasip1 --releaseOutput: target/wasm32-wasip1/release/test.wasm
Steps to Reproduce
- Compile WASM to aarch64-linux-android cwasm using Wasmtime v42.0.1 CLI:
wasmtime compile \ --target aarch64-linux-android \ -o test.cwasm \ ./target/wasm32-wasip1/release/test.wasm
- Deserialize test.cwasm using Wasmtime C++ API (v42.0.1 Android static library)
#include <wasmtime.hh> #include <vector> #include <fstream> int main() { std::ifstream file("test.cwasm", std::ios::binary | std::ios::ate); std::streamsize size = file.tellg(); file.seekg(0, std::ios::beg); std::vector<uint8_t> cwasm_bytes(size); file.read((char*)cwasm_bytes.data(), size); wasmtime::Config config; config.wasm_threads(false); config.wasm_bulk_memory(true); wasmtime::Engine engine(config); auto module_res = wasmtime::Module::deserialize(engine, cwasm_bytes); if (!module_res) { std::cerr << "Error: " << module_res.err().message() << std::endl; return 1; } return 0; }
- Compile C++ with NDK 26.x for Android aarch64 and run on device.
- Etc...
Expected Results
Deserialization succeeds with no errors.
Actual Results
Deserialization fails with error:
Module was compiled with concurrency support but it is not enabled for the hostProgram crashes:
libc++abi: terminating due to uncaught exception of type std::runtime_errorVersions and Environment
- Wasmtime version or commit: v42.0.1 (buggy), v41.0.0 (partial bug), v40.0.0 (working)
- Operating system (compile cwasm): macOS aarch64
- Operating system (run cwasm): Android 13 (API 33) aarch64
- Architecture: aarch64-linux-android (cwasm target), wasm32-wasip1 (Wasm source)
Extra Info
v40.0.0: works correctly (no concurrency flag)
alexcrichton commented on issue #12691:
@shuidi9527-source if you compile with
-Wconcurrency-support=ndoes it produce an artifact you can load with the C API?
shuidi9527-source commented on issue #12691:
thanks a lot for your help!
shuidi9527-source closed issue #12691:
Test Case
A minimal Rust WASM module (no thread/atomic code or dependencies) targeting wasm32-wasip1:
// src/lib.rs #[no_mangle] pub extern "C" fn add(a: i32, b: i32) -> i32 { a + b }Compile to WASM: cargo build --target wasm32-wasip1 --releaseOutput: target/wasm32-wasip1/release/test.wasm
Steps to Reproduce
- Compile WASM to aarch64-linux-android cwasm using Wasmtime v42.0.1 CLI:
wasmtime compile \ --target aarch64-linux-android \ -o test.cwasm \ ./target/wasm32-wasip1/release/test.wasm
- Deserialize test.cwasm using Wasmtime C++ API (v42.0.1 Android static library)
#include <wasmtime.hh> #include <vector> #include <fstream> int main() { std::ifstream file("test.cwasm", std::ios::binary | std::ios::ate); std::streamsize size = file.tellg(); file.seekg(0, std::ios::beg); std::vector<uint8_t> cwasm_bytes(size); file.read((char*)cwasm_bytes.data(), size); wasmtime::Config config; config.wasm_threads(false); config.wasm_bulk_memory(true); wasmtime::Engine engine(config); auto module_res = wasmtime::Module::deserialize(engine, cwasm_bytes); if (!module_res) { std::cerr << "Error: " << module_res.err().message() << std::endl; return 1; } return 0; }
- Compile C++ with NDK 26.x for Android aarch64 and run on device.
- Etc...
Expected Results
Deserialization succeeds with no errors.
Actual Results
Deserialization fails with error:
Module was compiled with concurrency support but it is not enabled for the hostProgram crashes:
libc++abi: terminating due to uncaught exception of type std::runtime_errorVersions and Environment
- Wasmtime version or commit: v42.0.1 (buggy), v41.0.0 (partial bug), v40.0.0 (working)
- Operating system (compile cwasm): macOS aarch64
- Operating system (run cwasm): Android 13 (API 33) aarch64
- Architecture: aarch64-linux-android (cwasm target), wasm32-wasip1 (Wasm source)
Extra Info
v40.0.0: works correctly (no concurrency flag)
Last updated: Mar 23 2026 at 16:19 UTC