Commit Graph

1431 Commits

Author SHA1 Message Date
Pat Hickey
ef2cb7b6b7 nearly have snapshot 0 implemented... 2021-01-28 17:00:31 -08:00
Pat Hickey
9bd89abc0c rename everything c2 related to the "real" names 2021-01-28 15:34:03 -08:00
Pat Hickey
47fec44c10 move wasi-c2 into wasi-common 2021-01-28 15:15:50 -08:00
Pat Hickey
dd005208b6 delete wasi-common, yanix, winx 2021-01-28 15:13:45 -08:00
Pat Hickey
d628677fae move test failures into ignores in build.rs 2021-01-28 15:07:48 -08:00
Pat Hickey
1d057af64d notes 2021-01-28 13:20:52 -08:00
Pat Hickey
201a888d92 dirty fuckin' dangles boys
fuck you shorsey
2021-01-28 13:02:48 -08:00
Pat Hickey
11b8222033 missed a dangling symlink 2021-01-28 12:59:44 -08:00
Pat Hickey
34ad8df169 dangling directories are a windows thing 2021-01-28 12:58:41 -08:00
Pat Hickey
4801ea04a1 cool 2021-01-28 12:36:50 -08:00
Pat Hickey
0cedc17246 another one bites the dust 2021-01-28 12:35:13 -08:00
Pat Hickey
79e8f17486 bum bum bum 2021-01-28 12:30:37 -08:00
Pat Hickey
dae022b17f woo 2021-01-28 12:29:30 -08:00
Pat Hickey
1196e216e9 fix macro by denying trailing slashes. also other stuff 2021-01-28 12:23:48 -08:00
Pat Hickey
20e9169cc7 fd_allocate: put meat of test behind a guard 2021-01-28 11:43:42 -08:00
Nick Fitzgerald
d1c1cb6a25 bench-api: receive working directory as an argument
Rather than implicitly use the current working directory.
2021-01-28 11:43:06 -08:00
Pat Hickey
f7403acb6f fd_advise test: set size via fd_filestat_set_size and fd_allocate 2021-01-28 11:42:30 -08:00
Pat Hickey
e758318fee wire env variables through test runner to TESTCONFIG 2021-01-28 11:34:18 -08:00
Pat Hickey
bbbe168ca1 ctx: i guess we need environment variables! 2021-01-28 11:34:00 -08:00
Pat Hickey
7ffe3c72c5 config is lazy_static to amoritze it 2021-01-28 11:20:02 -08:00
Nick Fitzgerald
be1ac15beb Merge pull request #2617 from alexcrichton/limit-tables-and-memeories
Add knobs to limit memories/tables in a `Store`
2021-01-28 10:20:33 -08:00
Nick Fitzgerald
6537e81a36 Merge pull request #2616 from alexcrichton/fix-module-linking-fuzzing
Disable module-linking in plain instantiate fuzzers
2021-01-28 10:17:04 -08:00
Pat Hickey
6f85abd949 itsp ublished 2021-01-28 09:44:17 -08:00
Alex Crichton
dccaa64962 Add knobs to limit memories/tables in a Store
Fuzzing has turned up that module linking can create large amounts of
tables and memories in addition to instances. For example if N instances
are allowed and M tables are allowed per-instance, then currently
wasmtime allows MxN tables (which is quite a lot). This is causing some
wasm-smith-generated modules to exceed resource limits while fuzzing!

This commits adds corresponding `max_tables` and `max_memories`
functions to sit alongside the `max_instances` configuration.
Additionally fuzzing now by default configures all of these to a
somewhat low value to avoid too much resource usage while fuzzing.
2021-01-28 08:47:00 -08:00
Alex Crichton
cb65c755c5 Disable module-linking in plain instantiate fuzzers
We already cover module linking with the `instantiate-swarm` target and
otherwise enabling module linking is preventing otherwise-valid modules
from being compiled because of the breaking change in the module linking
proposal with respect to imports.
2021-01-28 07:55:04 -08:00
Alex Crichton
39f677d2dd Only handle signals at pcs with trap information
Previously wasmtime would handle any signal originating from wasm JIT
code. This would, however, handle bugs in JIT code as-if they were wasm
traps. Instead this commit switches signal handling to specifically
check for whether the precise program counter is expected to be a trap.
This way if a program counter traps and it's not expected to trap the
signal isn't handled and the process is aborted (presumably leading to
further debugging of whomever happens to work on the JIT at that time).
2021-01-28 07:44:06 -08:00
Pat Hickey
03466d04ce temporarily use my branch of the wasi crate 2021-01-27 19:05:52 -08:00
Pat Hickey
be108c7a93 will this work for platform-specific errnos? WIP 2021-01-27 18:18:12 -08:00
Pat Hickey
2ae1dee642 convert all errno assertions to assert_errno! 2021-01-27 18:10:38 -08:00
Pat Hickey
4f655001c0 make a macro that automates errno assertions 2021-01-27 18:10:34 -08:00
Pat Hickey
4f2696fedf more docs 2021-01-27 16:16:10 -08:00
Pat Hickey
cb171712cc various windows test notes 2021-01-27 15:32:23 -08:00
Pat Hickey
d1160cb9b5 split path rename trailing slash test into files and dirs
files fail on both platform, dirs pass on both! so, same bug!
2021-01-27 14:55:39 -08:00
Pat Hickey
6c0f312a1b fix bug: i was ignoring the symlink follow flag in path_filestat_{get,
set_times}
2021-01-27 12:42:15 -08:00
Pat Hickey
b2e0597ae3 narrow the bug 2021-01-27 12:27:13 -08:00
Pat Hickey
6fcbd3f15d split path_filestat test into two, improve variable names 2021-01-27 12:18:27 -08:00
Pat Hickey
220509f3ed latest system-interface 2021-01-27 12:17:42 -08:00
Alex Crichton
503129ad91 Add a method to share Config across machines (#2608)
With `Module::{serialize,deserialize}` it should be possible to share
wasmtime modules across machines or CPUs. Serialization, however, embeds
a hash of all configuration values, including cranelift compilation
settings. By default wasmtime's selection of the native ISA would enable
ISA flags according to CPU features available on the host, but the same
CPU features may not be available across two machines.

This commit adds a `Config::cranelift_clear_cpu_flags` method which
allows clearing the target-specific ISA flags that are automatically
inferred by default for the native CPU. Options can then be
incrementally built back up as-desired with teh `cranelift_other_flag`
method.
2021-01-26 15:59:12 -06:00
Pat Hickey
8cd21eed23 elaborate 2021-01-26 12:27:07 -08:00
Pat Hickey
1eb8a8a7fe integrate GetSetFdFlags!
change reopen_with_fdflags(&self, fdflags) -> Result<Box<dyn WasiFile>>
to set_fdflags(&mut self, fdflags) -> Result<()>.

this makes way more sense than my prior hare-brained schemes.
2021-01-26 12:23:52 -08:00
Pat Hickey
c98d6f6201 fix warning 2021-01-26 12:18:39 -08:00
Nick Fitzgerald
e594c43d50 Merge pull request #2606 from fitzgen/memory-stuff
wasmtime: clarify `Memory::{read,write}` behavior with out-of-bounds ranges
2021-01-26 11:57:42 -08:00
Pat Hickey
f4a6b95965 notes 2021-01-26 11:45:26 -08:00
Nick Fitzgerald
ee5c6f6265 Merge pull request #2599 from fitzgen/bench-api-files-env-vars
bench-api: Allow access to files in the current directory
2021-01-26 10:35:03 -08:00
Nick Fitzgerald
4f3bc1d5d4 wasmtime: clarify Memory::{read,write} behavior with out-of-bounds ranges
This documents that we will never do partial reads/writes, and expands our
existing tests to assert this.
2021-01-26 10:27:21 -08:00
Nick Fitzgerald
0cdc80fbf8 wasmtime: move Memory to its own module
Purely code motion and fixing up imports.
2021-01-26 10:04:48 -08:00
Nick Fitzgerald
3b7f3e0c23 Remove semicolon to quiet a rustc warning 2021-01-26 09:43:53 -08:00
Nick Fitzgerald
8d84482153 bench-api: Allow access to files in the current directory
And pass through the `WASM_BENCH_USE_SMALL_WORKLOAD` env var.

Part of https://github.com/bytecodealliance/sightglass/issues/70
2021-01-26 09:43:53 -08:00
Nick Fitzgerald
c7c6e76f9b fuzzing: Add tests for dummy import generation (#2604) 2021-01-26 09:11:24 -06:00
theduke
f4faa04dca Safe Memory read/write API (#2528)
This commit introduces two new methods on `Memory` that enable
reading and writing memory contents without requiring `unsafe`.

The methods return a new `MemoryError` if the memory access
fails.
2021-01-26 09:09:20 -06:00