-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory bug on Windows x64 #52
Comments
I'm guessing that, though the text strings are identical, the float bits don't line up. I think you can confirm by changing the float case of values.ml:string_of_value to return |
|
Oops, I meant |
Yeah, that's the problem:
I'm not sure what to do about this. Does this indicate that our implementation is actually incorrect, at least on this os/arch combination? |
Also fails:
|
I compared the disassembled code of the windows-version of main.native with the linux-version and noticed, that windows only makes use of fpu commands, while linux uses SSE-like commands. Could this make the difference? |
x87 vs SSE was my guess as well. I guess wasm on windows is doing 80-bit arithmetic and truncating, then? |
There are ways that using x87 (fpu) instructions instead of SSE instructions can causes differences, but in the testcase here, all the values are small whole integers, so we ought to get the same answer regardless of which floating point unit is used. |
@kg Would you mind trying a few more experiments:
|
Sure thing, I'll try all that the next time I'm at home. |
I'm running the 32-bit ocaml build on Windows that the ml-prototype README recommends. Before this change, I see the same thing as @kg. With that change, I get a segfault running either the unaligned or cast assert_eqs in memory.wasm. I narrowed it down to something triggered by using the result of a
But either of these operations will cause a segfault:
I am highly suspicious of the Obj.magic in the memory module. |
It may be possible to use I would expect this would prevent the unusual segfault behavior that people are seeing. |
Including a new `stack.new` instruction. Also add new descriptions of the semantics of each instruction and a section on potential future instructions we might want to add.
On my x64 Windows 10 box memory.wasm fails mysteriously:
Not sure what's going on here, don't know ocaml well enough to debug.
The text was updated successfully, but these errors were encountered: