Stream: git-wasmtime

Topic: wasmtime / PR #4495 table_ops: allow 0-sized tables, loca...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2022 at 22:43):

jameysharp opened PR #4495 from table-ops-zeros to main:

I noticed that TableOp::insert had assertions that num_params and
table_size were greater than 0, but no assert for num_globals. These
asserts couldn't be hit because the *_RANGE constants were all set to
a minimum of 1.

But the only reason I can see to prohibit 0-sized tables, locals, or
globals, was because indexes into those spaces were generated with the
% operator. Allowing 0-sized spaces requires not generating the
corresponding instructions at all when there are no valid indexes.

So I pushed the final selection of which table/local/global to access
earlier, to the moment when we're picking which TableOps to run. Then,
instead of generating a random u8 or u32 and taking the remainder to get
it into the right range, I can just ask arbitrary to generate a number
in the right range to begin with.

So this now explores some size-0 corners that it didn't before, and it
doesn't require reasoning about whether remainder can divide by zero.
Also I think it uses fewer bits of the Unstructured input to produce
the same cases, and I hope that lets libFuzzer more quickly find bits it
can mutate to get to novel coverage paths.

<!--

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 (Jul 20 2022 at 22:43):

jameysharp requested fitzgen for a review on PR #4495.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 21 2022 at 17:08):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 21 2022 at 17:38):

jameysharp updated PR #4495 from table-ops-zeros to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 21 2022 at 17:39):

jameysharp has enabled auto merge for PR #4495.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 21 2022 at 18:25):

jameysharp merged PR #4495.


Last updated: Dec 23 2024 at 12:05 UTC