-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add a signals-based-traps
Cargo compile-time feature
#9614
Add a signals-based-traps
Cargo compile-time feature
#9614
Conversation
Label Messager: wasmtime:configIt looks like you are changing Wasmtime's configuration options. Make sure to
To modify this label's message, edit the To add new label messages or remove existing label messages, edit the |
Subscribe to Label Actioncc @fitzgen
This issue or pull request has been labeled: "fuzzing", "wasi", "wasmtime:api", "wasmtime:config"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
9e7e926
to
dbdd735
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty cool!
This commit adds a new on-by-default Cargo feature to the `wasmtime` crate named `signals-based-traps`. This is modeled after the `Config::signals_based_traps` configuration at runtime and can be used to statically disable the use of signal handlers in Wasmtime. This notably reduces the number of platform dependencies that Wasmtime has and provides a mode of avoiding relying on signals altogether. This introduces a new `MallocMemory` which is a linear memory backed by the system allocator. This new type of memory is enabled when virtual memory guards are disabled and signals-based-traps are disabled. This means that this new type of memory will be candidate for fuzzing for example. prtest:full
* Remove no-longer-needed `Arc` * Document it may be backed by `Vec<u8>`
dbdd735
to
d896f2a
Compare
I've pushed some extra refactoring of |
This PR adds a new
signals-based-traps
Cargo compile-time feature which mirrors theConfig::signals_based_traps
runtime configuration. Disabling this Cargo feature enables reducing Wasmtime's platform requirements to remove the need for virtual memory and trap handlers for example. That means that the underlying platform requirements are just setjmp/longjmp and a single pointer of thread-local storage. This should make it significantly easier to port Wasmtime to platforms that may not have virtual memory in the future.I'll note that one of the main purposes of this PR isn't quite realized just yet which is to run Pulley on embedded systems. Pulley isn't finished, however, so this is more setting the stage for that to be possible in the future than enabling it right this red-hot-second.