Stream: git-wasmtime

Topic: wasmtime / issue #3266 Add a `Module::deserialize_file` m...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 15:59):

alexcrichton commented on issue #3266:

It's worth noting that this will, by default, not play nicely with https://github.com/bytecodealliance/wasmtime/pull/3265. Relocations are the only part of the file which we actually modify today, so some code will be added to tempoarily change the text section to read/write if relocations need to be applied. With https://github.com/bytecodealliance/wasmtime/pull/3254, though, that should be rare. I don't actually know if it's possible for the new backend to generate any other relocations after we remove those for call instructions.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 16:11):

github-actions[bot] commented on issue #3266:

Subscribe to Label Action

cc @peterhuene

<details>
This issue or pull request has been labeled: "wasmtime:api", "wasmtime:c-api"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 18:45):

alexcrichton commented on issue #3266:

Ok I've added a commit to handle the case that we need relocations now that https://github.com/bytecodealliance/wasmtime/pull/3265 is in main

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 23:15):

peterhuene commented on issue #3266:

So I through a little test program together: https://gist.github.com/peterhuene/64a5dc5dd22f28950ec397a5709f0eda

This seems to do what we want: a single mapping where we can keep everything but the text section read-only and have CoW semantics for the text section when applying relocations.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 23:19):

peterhuene commented on issue #3266:

Also, we'll need to have something in CodeMemory for Windows that detects if the mapping is backed by a file and use PAGE_WRITECOPY (that's not a valid protection level for anonymous pages) for the relocations; otherwise we can stick to PAGE_READWRITE.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 23:19):

peterhuene edited a comment on issue #3266:

So I threw a little test program together: https://gist.github.com/peterhuene/64a5dc5dd22f28950ec397a5709f0eda

This seems to do what we want: a single mapping where we can keep everything but the text section read-only and have CoW semantics for the text section when applying relocations.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 31 2021 at 13:54):

alexcrichton commented on issue #3266:

So I threw a little test program together: https://gist.github.com/peterhuene/64a5dc5dd22f28950ec397a5709f0eda

Thanks for this! I just blindly copy/pasted that into Wasmtime now :)

As you can probably tell I did not indeed run tests at all on Windows beforehand, how naive of me to assume it would be the same! In any case I'm glad you know what you're doing, it would have taken me quite awhile to figure out how to align all those stars...

view this post on Zulip Wasmtime GitHub notifications bot (Aug 31 2021 at 14:29):

alexcrichton commented on issue #3266:

Oh hey and with your help works on the first try!


Last updated: Dec 23 2024 at 12:05 UTC