Skip to content

Commit 03ce87d

Browse files
committed
Auto merge of #149474 - RalfJung:miri, r=RalfJung
miri subtree update Subtree update of `miri` to rust-lang/miri@0749929. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
2 parents 91ab308 + a121102 commit 03ce87d

File tree

38 files changed

+1500
-1256
lines changed

38 files changed

+1500
-1256
lines changed

src/tools/miri/.github/workflows/ci.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ jobs:
3131
os: ubuntu-24.04-arm
3232
multiarch: armhf
3333
gcc_cross: arm-linux-gnueabihf
34+
- host_target: riscv64gc-unknown-linux-gnu
35+
os: ubuntu-latest
36+
multiarch: riscv64
37+
gcc_cross: riscv64-linux-gnu
38+
qemu: true
3439
# Ubuntu mirrors are not reliable enough for these architectures
3540
# (see <https://bugs.launchpad.net/ubuntu/+bug/2130309>).
36-
# - host_target: riscv64gc-unknown-linux-gnu
37-
# os: ubuntu-latest
38-
# multiarch: riscv64
39-
# gcc_cross: riscv64-linux-gnu
40-
# qemu: true
4141
# - host_target: s390x-unknown-linux-gnu
4242
# os: ubuntu-latest
4343
# multiarch: s390x
@@ -59,13 +59,6 @@ jobs:
5959
HOST_TARGET: ${{ matrix.host_target }}
6060
steps:
6161
- uses: actions/checkout@v4
62-
- name: apt update
63-
if: ${{ startsWith(matrix.os, 'ubuntu') }}
64-
# The runners seem to have outdated apt repos sometimes
65-
run: sudo apt update
66-
- name: install qemu
67-
if: ${{ matrix.qemu }}
68-
run: sudo apt install qemu-user qemu-user-binfmt
6962
- name: install multiarch
7063
if: ${{ matrix.multiarch != '' }}
7164
run: |
@@ -75,10 +68,13 @@ jobs:
7568
sudo dpkg --add-architecture ${{ matrix.multiarch }}
7669
# Ubuntu Ports often has outdated mirrors so try a few times to get the apt repo
7770
for TRY in $(seq 3); do
78-
{ sudo apt update && break; } || sleep 30
71+
{ sudo apt update && break; } || sleep 60
7972
done
8073
# Install needed packages
8174
sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
75+
- name: install qemu
76+
if: ${{ matrix.qemu }}
77+
run: sudo apt install qemu-user qemu-user-binfmt
8278
- uses: ./.github/workflows/setup
8379
with:
8480
toolchain_flags: "--host ${{ matrix.host_target }}"

src/tools/miri/Cargo.lock

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,6 @@ dependencies = [
959959
"serde_json",
960960
"smallvec",
961961
"tempfile",
962-
"tikv-jemalloc-sys",
963962
"ui_test",
964963
]
965964

@@ -1504,16 +1503,6 @@ dependencies = [
15041503
"cfg-if",
15051504
]
15061505

1507-
[[package]]
1508-
name = "tikv-jemalloc-sys"
1509-
version = "0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
1510-
source = "registry+https://github.com/rust-lang/crates.io-index"
1511-
checksum = "cd8aa5b2ab86a2cefa406d889139c162cbb230092f7d1d7cbc1716405d852a3b"
1512-
dependencies = [
1513-
"cc",
1514-
"libc",
1515-
]
1516-
15171506
[[package]]
15181507
name = "tinystr"
15191508
version = "0.8.2"

src/tools/miri/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ nix = { version = "0.30.1", features = ["mman", "ptrace", "signal"], optional =
4141
ipc-channel = { version = "0.20.0", optional = true }
4242
capstone = { version = "0.13", optional = true }
4343

44-
# FIXME(genmc,macos): Add `target_os = "macos"` once https://github.com/dtolnay/cxx/issues/1535 is fixed.
4544
[target.'cfg(all(target_os = "linux", target_pointer_width = "64", target_endian = "little"))'.dependencies]
4645
genmc-sys = { path = "./genmc-sys/", version = "0.1.0", optional = true }
4746

src/tools/miri/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,6 @@ to Miri failing to detect cases of undefined behavior in a program.
496496
of Rust will be stricter than Tree Borrows. In other words, if you use Tree Borrows,
497497
even if your code is accepted today, it might be declared UB in the future.
498498
This is much less likely with Stacked Borrows.
499-
Using Tree Borrows currently implies `-Zmiri-strict-provenance` because integer-to-pointer
500-
casts are not supported in this mode, but that may change in the future.
501499
* `-Zmiri-tree-borrows-no-precise-interior-mut` makes Tree Borrows
502500
track interior mutable data on the level of references instead of on the
503501
byte-level as is done by default. Therefore, with this flag, Tree

src/tools/miri/genmc-sys/build.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod downloading {
2828
/// The GenMC repository the we get our commit from.
2929
pub(crate) const GENMC_GITHUB_URL: &str = "https://github.com/MPI-SWS/genmc.git";
3030
/// The GenMC commit we depend on. It must be available on the specified GenMC repository.
31-
pub(crate) const GENMC_COMMIT: &str = "aa10ed65117c3291524efc19253b5d443a4602ac";
31+
pub(crate) const GENMC_COMMIT: &str = "22d3d0b44dedb4e8e1aae3330e546465e4664529";
3232

3333
/// Ensure that a local GenMC repo is present and set to the correct commit.
3434
/// Return the path of the GenMC repo and whether the checked out commit was changed.
@@ -178,14 +178,8 @@ fn compile_cpp_dependencies(genmc_path: &Path, always_configure: bool) {
178178
// These are all the C++ files we need to compile, which needs to be updated if more C++ files are added to Miri.
179179
// We use absolute paths since relative paths can confuse IDEs when attempting to go-to-source on a path in a compiler error.
180180
let cpp_files_base_path = Path::new("cpp/src/");
181-
let cpp_files = [
182-
"MiriInterface/EventHandling.cpp",
183-
"MiriInterface/Exploration.cpp",
184-
"MiriInterface/Mutex.cpp",
185-
"MiriInterface/Setup.cpp",
186-
"MiriInterface/ThreadManagement.cpp",
187-
]
188-
.map(|file| std::path::absolute(cpp_files_base_path.join(file)).unwrap());
181+
let cpp_files = ["MiriInterface/Exploration.cpp", "MiriInterface/Setup.cpp"]
182+
.map(|file| std::path::absolute(cpp_files_base_path.join(file)).unwrap());
189183

190184
let mut bridge = cxx_build::bridge("src/lib.rs");
191185
// FIXME(genmc,cmake): Remove once the GenMC debug setting is available in the config.h file.

src/tools/miri/genmc-sys/cpp/include/MiriInterface.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ struct MiriGenmcShim : private GenMCDriver {
125125
void handle_fence(ThreadId thread_id, MemOrdering ord);
126126

127127
/**** Memory (de)allocation ****/
128+
128129
auto handle_malloc(ThreadId thread_id, uint64_t size, uint64_t alignment) -> uint64_t;
129-
auto handle_free(ThreadId thread_id, uint64_t address) -> bool;
130+
131+
/** Returns null on success, or an error string if an error occurs. */
132+
auto handle_free(ThreadId thread_id, uint64_t address) -> std::unique_ptr<std::string>;
130133

131134
/**** Thread management ****/
132135
void handle_thread_create(ThreadId thread_id, ThreadId parent_id);

src/tools/miri/genmc-sys/cpp/src/MiriInterface/EventHandling.cpp

Lines changed: 0 additions & 265 deletions
This file was deleted.

0 commit comments

Comments
 (0)