Stream: git-wasmtime

Topic: wasmtime / PR #2486 Two Lucet-related fixes to stack over...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 23:23):

cfallin requested alexcrichton and abrown for a review on PR #2486.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 23:23):

cfallin opened PR #2486 from fix-probestack to main:

Lucet uses stack probes rather than explicit stack limit checks as
Wasmtime does. In bytecodealliance/lucet#616, I have discovered that I
previously was not running some Lucet runtime tests with the new
backend, so was missing some test failures due to missing pieces in the
new backend.

This PR adds (i) calls to probestack, when enabled, in the prologue of
every function with a stack frame larger than one page (configurable via
flags); and (ii) trap metadata for every instruction on x86-64 that can
access the stack, hence be the first point at which a stack overflow is
detected when the stack pointer is decremented.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 23:23):

cfallin requested alexcrichton and abrown for a review on PR #2486.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 23:37):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 23:37):

alexcrichton created PR Review Comment:

Could these add_trap be conditional only if probestack is enabled? Otherwise for a scheme like wasmtime uses I don't think these instructions can trap

view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 23:37):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 23:37):

alexcrichton created PR Review Comment:

(ditto for the other add_trap here as well)

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2020 at 00:09):

cfallin submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2020 at 00:09):

cfallin created PR Review Comment:

Indeed, good point!

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2020 at 00:09):

cfallin updated PR #2486 from fix-probestack to main:

Lucet uses stack probes rather than explicit stack limit checks as
Wasmtime does. In bytecodealliance/lucet#616, I have discovered that I
previously was not running some Lucet runtime tests with the new
backend, so was missing some test failures due to missing pieces in the
new backend.

This PR adds (i) calls to probestack, when enabled, in the prologue of
every function with a stack frame larger than one page (configurable via
flags); and (ii) trap metadata for every instruction on x86-64 that can
access the stack, hence be the first point at which a stack overflow is
detected when the stack pointer is decremented.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2020 at 00:47):

cfallin merged PR #2486.


Last updated: Oct 23 2024 at 20:03 UTC