-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugIncorrect behavior in the current implementation that needs fixingIncorrect behavior in the current implementation that needs fixing
Description
Test Case
a module/component with a simple c function that will trigger this:
int RoundToNearestInt()
{
float c = 1.331* 24.0;
float r = lrintf(c);
printf("rounded answer: %f\n", r); // should print 32
return r;
}
Steps to Reproduce
- Build wasmtime for an emedding using the
x86_64-unknown-none. Similar to how https://github.com/bytecodealliance/wasmtime/tree/release-36.0.0/examples/min-platform does it.
2.Then pre-compile module/componentwasmtime/examples/min-platform/src/main.rs
Lines 66 to 82 in ebce5d4
let mut config = Config::new(); config.target(&triple)?; // If signals-based-traps are disabled then that additionally means that // some configuration knobs need to be turned to match the expectations of // the guest program being loaded. if !cfg!(feature = "custom") { config.memory_init_cow(false); config.memory_reservation(0); config.memory_guard_size(0); config.memory_reservation_for_growth(0); config.signals_based_traps(false); } let engine = Engine::new(&config)?; let smoke = engine.precompile_module(b"(module)")?; let simple_add = engine.precompile_module(
run the wasm
Expected Results
rounding is completed properly
Actual Results
incorrect result. Example above prints 31
Versions and Environment
Wasmtime version or commit: was using 34+
Operating system: Linux
Architecture: x86
Extra Info
Anything else you'd like to add?
I wasn't able to reproduce this with the min-platform example. I believe this is because its actually compiling to a platform Linux platform?
Metadata
Metadata
Assignees
Labels
bugIncorrect behavior in the current implementation that needs fixingIncorrect behavior in the current implementation that needs fixing