Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getrandom rather than getentropy on Linux for random_get. #151

Merged
merged 1 commit into from
May 15, 2019

Conversation

sunfishcode
Copy link
Member

getentropy is limited to 256 bytes, so switch to getrandom.

getentropy is limited to 256 bytes, so switch to getrandom.
@@ -20,15 +20,15 @@
#define CONFIG_HAS_ARC4RANDOM_BUF 0
#endif

// On Linux, prefer to use getentropy, though it isn't available in
// On Linux, prefer to use getrandom, though it isn't available in
// GLIBC before 2.25.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still the correct version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@kubkon
Copy link
Member

kubkon commented May 15, 2019

LGTM! Matches rust-random which we already use in CraneStation/wasi-common :-)

@sunfishcode sunfishcode merged commit 67edb00 into bytecodealliance:master May 15, 2019
@sunfishcode sunfishcode deleted the random branch May 15, 2019 18:44
kubkon pushed a commit that referenced this pull request Nov 7, 2019
* Reorganize host.rs and wasm32.rs.

Reorganize host.rs and wasm32.rs into host.rs, wasi.rs, and wasi32.rs.

Most of the contents of host.rs was not actually host-specific, as most
of the types are fixed-size types like u32 or i64. These types are now
in wasi.rs.

The few types which do have pointer or usize-sized values now remain,
in two versions: host.rs has versions which use actual raw pointers and
usize, and wasi32.rs has versions which use u32 to represent them.

* Fix compilation on BSD

* Fix compilation on Windows

* Fully encapsulate endianness in memory.rs.

This refactors memory.rs to fully encapsulte endianness concerns, so
that outside that file, all values are in host-endian order.

This adds a dependency on the `num` crate, though it's only used for
the `PrimInt` trait, for handling endianness in a generic way.

* Use pub(crate).
grishasobol pushed a commit to grishasobol/wasmtime that referenced this pull request Nov 29, 2021
pchickey added a commit to pchickey/wasmtime that referenced this pull request May 12, 2023
pchickey added a commit to pchickey/wasmtime that referenced this pull request May 16, 2023
dhil added a commit to frank-emrich/wasmtime that referenced this pull request Apr 4, 2024
Notable changes:
* `i31ref` and more gc features.
avanhatt pushed a commit to wellesley-prog-sys/wasmtime that referenced this pull request Oct 18, 2024
Populate a `rule_map` in the `sema::TermEnv` mapping interned rule names
to rule IDs. This is similar to the `term_map` that already exists.

This should be useful in bytecodealliance#151 bytecodealliance#128 where we need to apply attributes to
rules.
avanhatt pushed a commit to wellesley-prog-sys/wasmtime that referenced this pull request Oct 18, 2024
Provide support for incorporating rule priorities into verification
conditions.

When priorities are considered, the behavior is that for all strictly
higher-priority rules that may overlap with the rule under expansion,
the negation of the overlapping rule's constraints are brought into the
expansion. This necessitates brining in more bindings referenced by the
negated rule's constraints.

One problem is that overlap detection does not work when internal
extractors are left unexpanded. This is the most gross aspect of the
approach here, since we have to parse and run `sema` on the input ISLE
twice, once without internal extractor expansion just so we can deduce
the rule overlap sets.

When rule priorities are factored in it can lead to poor user experience
since the negated constraints bring in more terms that have to be
satisfied. In the fairly common case where priorities are not actually
relevant for correctness this can be annoying. Therefore, we introduce a
new rule attribute `(attr <rule> (veri priority))` which denotes that
the rule's correctness depends on priority. Negated higher-priority
rules will only be considered when this attribute is present.

Updates bytecodealliance#128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants