Skip to content

Miri subtree update #131036

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

Merged
merged 43 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0332581
add test for new abort_unwind function
RalfJung Sep 23, 2024
c36614b
Auto merge of #3906 - RalfJung:abort_unwind, r=RalfJung
bors Sep 23, 2024
51d90bb
fix workflow permissions
RalfJung Sep 23, 2024
09e8122
Auto merge of #3907 - RalfJung:perm, r=RalfJung
bors Sep 23, 2024
3a108a7
looks like we need more permissions
RalfJung Sep 24, 2024
d47e254
Auto merge of #3908 - RalfJung:perms, r=RalfJung
bors Sep 24, 2024
8885ae9
Scope CI permissions to the job that needs it
Kobzol Sep 24, 2024
878925e
Auto merge of #3909 - Kobzol:ci-permissions, r=RalfJung
bors Sep 24, 2024
f319ce7
Preparing for merge from rustc
Sep 25, 2024
3209f2a
Merge from rustc
Sep 25, 2024
e057c17
fmt
Sep 25, 2024
cbe2ec0
add test for std::random
RalfJung Sep 25, 2024
60265e4
avoid using HashMap in fs test
RalfJung Sep 25, 2024
a374d1c
update BASIC test list: no longer test HashMap, add libc-mem instead …
RalfJung Sep 25, 2024
9433958
disable AVR test since it doesn't work
RalfJung Sep 25, 2024
b862076
Auto merge of #3913 - rust-lang:rustup-2024-09-25, r=RalfJung
bors Sep 25, 2024
b44888f
Android: Fixed tests for libc time API
YohDeadfall Sep 24, 2024
c69b457
enable pthread_cond_timedwait test on Android
RalfJung Sep 25, 2024
4ef8f60
Auto merge of #3910 - YohDeadfall:android-libc-time, r=RalfJung
bors Sep 25, 2024
897e941
switch custom target JSON test to a less exotic target
RalfJung Sep 25, 2024
b7fe0b4
Auto merge of #3915 - RalfJung:target-json-test, r=RalfJung
bors Sep 25, 2024
824884d
Preparing for merge from rustc
Sep 26, 2024
51087d2
Merge from rustc
Sep 26, 2024
adbaf13
bump rustc-build-sysroot version
RalfJung Sep 26, 2024
fcc59fe
Auto merge of #3917 - RalfJung:sysroot, r=RalfJung
bors Sep 26, 2024
294fdb8
clippy
RalfJung Sep 26, 2024
bf78aec
fix clippy::needless_return
RalfJung Sep 26, 2024
18aa926
remove some clippy lints from the list that we do not even trigger an…
RalfJung Sep 26, 2024
c361d52
Auto merge of #3916 - rust-lang:rustup-2024-09-26, r=RalfJung
bors Sep 26, 2024
74d7b22
Update cc to 1.1.22
ChrisDenton Sep 27, 2024
68790c0
Auto merge of #3920 - ChrisDenton:cc, r=RalfJung
bors Sep 27, 2024
c1401da
add tests for validity of Box with custom allocator
RalfJung Sep 28, 2024
5790eb9
Auto merge of #3922 - RalfJung:box-custom-alloc, r=RalfJung
bors Sep 28, 2024
f14f72e
implements arc4random_buf shim for freebsd/solarish platforms.
devnexen Sep 26, 2024
7cb5a79
make sure the new function is tested
RalfJung Sep 28, 2024
dd572c4
Auto merge of #3918 - devnexen:solaris_arc4random_buf, r=RalfJung
bors Sep 28, 2024
ab8fa80
skip old getrandom crate on Solaris
RalfJung Sep 29, 2024
c38fa99
Auto merge of #3925 - RalfJung:solarish-random, r=RalfJung
bors Sep 29, 2024
3e4f64c
bump few deps
klensy Sep 29, 2024
6abc731
Auto merge of #3926 - klensy:deps-up2, r=RalfJung
bors Sep 29, 2024
ad8a5ce
let rustfmt format imports
RalfJung Sep 29, 2024
e239d07
Auto merge of #3927 - RalfJung:fmt-imports, r=oli-obk,saethlin
bors Sep 29, 2024
8c0adc6
update lockfile
RalfJung Sep 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/tools/miri/ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ case $HOST_TARGET in
# Partially supported targets (tier 2)
BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread time fs
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname pthread time fs
TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX thread sync available-parallelism time tls
TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX thread sync available-parallelism time tls
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX hashmap random threadname pthread time fs
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX hashmap random threadname pthread time fs
TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX hashmap thread sync available-parallelism time tls
TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX hashmap thread sync available-parallelism time tls
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX hashmap pthread time --skip threadname
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
Expand Down
14 changes: 14 additions & 0 deletions src/tools/miri/src/shims/unix/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,20 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
this.gen_random(ptr, len)?;
this.write_scalar(Scalar::from_target_usize(len, this), dest)?;
}
"arc4random_buf" => {
// This function is non-standard but exists with the same signature and
// same behavior (eg never fails) on FreeBSD and Solaris/Illumos.
if !matches!(&*this.tcx.sess.target.os, "freebsd" | "illumos" | "solaris") {
throw_unsup_format!(
"`arc4random_buf` is not supported on {}",
this.tcx.sess.target.os
);
}
let [ptr, len] = this.check_shim(abi, Abi::C { unwind: false}, link_name, args)?;
let ptr = this.read_pointer(ptr)?;
let len = this.read_target_usize(len)?;
this.gen_random(ptr, len)?;
}
"_Unwind_RaiseException" => {
// This is not formally part of POSIX, but it is very wide-spread on POSIX systems.
// It was originally specified as part of the Itanium C++ ABI:
Expand Down
13 changes: 13 additions & 0 deletions src/tools/miri/tests/pass-dep/libc/libc-random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ fn main() {
test_getentropy();
#[cfg(not(target_os = "macos"))]
test_getrandom();
#[cfg(any(target_os = "freebsd", target_os = "illumos", target_os = "solaris"))]
test_arc4random_buf();
}

fn test_getentropy() {
Expand Down Expand Up @@ -61,3 +63,14 @@ fn test_getrandom() {
);
}
}

#[cfg(any(target_os = "freebsd", target_os = "illumos", target_os = "solaris"))]
fn test_arc4random_buf() {
// FIXME: Use declaration from libc once <https://github.com/rust-lang/libc/pull/3944> lands.
extern "C" {
fn arc4random_buf(buf: *mut libc::c_void, size: libc::size_t);
}
let mut buf = [0u8; 5];
unsafe { arc4random_buf(buf.as_mut_ptr() as _, buf.len()) };
assert!(buf != [0u8; 5]);
}