Stream: git-wasmtime

Topic: wasmtime / PR #6973 adapter: eliminate State::with_mut


view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2023 at 21:45):

pchickey opened PR #6973 from bytecodealliance:pch/adapter_eliminate_state_with_mut to bytecodealliance:main:

There is no need to get exclusive access to State:

I recently found a bug that would occur if path_open is the first call into the adapter, the State will be borrowed exclusively and descriptors_mut will initialize the descriptors by calling out to get the preopens. Because preopens are a list, the runtime needs to call cabi_realloc to return them, and that call will fail where cabi_import_realloc tries to borrow the exclusively- borrowed State.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2023 at 21:45):

pchickey requested wasmtime-core-reviewers for a review on PR #6973.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2023 at 21:45):

pchickey requested fitzgen for a review on PR #6973.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2023 at 21:45):

pchickey edited PR #6973:

There is no need to get exclusive access to State:

This changes fixes a bug that would occur if path_open is the first call into the adapter, the State will be borrowed exclusively and descriptors_mut will initialize the descriptors by calling out to get the preopens. Because preopens are a list, the runtime needs to call cabi_realloc to return them, and that call will fail where cabi_import_realloc tries to borrow the exclusively- borrowed State.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2023 at 21:49):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 07 2023 at 00:17):

pchickey merged PR #6973.


Last updated: Dec 23 2024 at 12:05 UTC