Stream: git-wasmtime

Topic: wasmtime / PR #1740 runtime: handle traps on Windows x32


view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:42):

whitequark opened PR #1740 from x32-windows-traps to master:

This PR is a small incremental step towards a working Windows x32 backend. It implements what I believe is the correct approach to handling traps on x86_32 Windows, which is based on my understanding of x32 SEH: there is no global unwind registry at all, and instead SEH frames are pushed onto stack. Therefore no registration is needed. However I am by no means a Windows expert and my understanding might be incorrect.

There is no way to actually run code on Windows x32 yet because the fastcall ABI isn't implemented. I'll add that in a follow-up PR. I have a working prototype that can print Hello, World but it has some missing parts and requires major cleanup to be upstreamed.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:52):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:52):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:52):

alexcrichton created PR Review Comment:

I'm not entirely certain where this ends up being used elsewhere, but should this presumably return an error? We could then specifically ignore the error somewhere else or have some form of error handling?

(I'm not sure where errors here end up)

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:55):

whitequark submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:55):

whitequark created PR Review Comment:

The error would end up here: https://github.com/bytecodealliance/wasmtime/blob/68f0d2f6d0c84c090b590d3bda60369e7e45eac7/crates/jit/src/code_memory.rs#L210-L214

I think you're right and we should return an error here, since in that function func.unwind_info == None on x32 and this function would end up being never called at all.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:59):

whitequark updated PR #1740 from x32-windows-traps to master:

This PR is a small incremental step towards a working Windows x32 backend. It implements what I believe is the correct approach to handling traps on x86_32 Windows, which is based on my understanding of x32 SEH: there is no global unwind registry at all, and instead SEH frames are pushed onto stack. Therefore no registration is needed. However I am by no means a Windows expert and my understanding might be incorrect.

There is no way to actually run code on Windows x32 yet because the fastcall ABI isn't implemented. I'll add that in a follow-up PR. I have a working prototype that can print Hello, World but it has some missing parts and requires major cleanup to be upstreamed.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:59):

whitequark submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 18:59):

whitequark created PR Review Comment:

Fixed

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2020 at 20:07):

alexcrichton merged PR #1740.


Last updated: Nov 22 2024 at 17:03 UTC