From 6863dcc5509b94c9852f7d3c8a431e22a4eb9075 Mon Sep 17 00:00:00 2001 From: Paul Osborne Date: Fri, 19 Dec 2025 15:45:20 -0600 Subject: [PATCH 1/2] Bump version of libloading to 0.9 We're seeing spurious crashes on windows after successful benchmark runs when unloading the dll. Upgrade libloading to the latest as a first step in diagnosing potential problems. This updated version may just fix the issue; if not, it provides a way to do an explicit close() where we can handle errors potentially. --- Cargo.lock | 6 +++--- crates/cli/Cargo.toml | 2 +- crates/recorder/Cargo.toml | 2 +- engines/native/libengine/Cargo.toml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e9cbf53..dbec7c49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1246,12 +1246,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.4" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60" dependencies = [ "cfg-if 1.0.4", - "winapi 0.3.9", + "windows-link", ] [[package]] diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 2ee14d73..ecbf8f5b 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] anyhow = "1.0" -libloading = "0.7" +libloading = "0.9" log = "0.4" pretty_env_logger = "0.4" serde = "1" diff --git a/crates/recorder/Cargo.toml b/crates/recorder/Cargo.toml index 2f0106f1..cebef5b0 100644 --- a/crates/recorder/Cargo.toml +++ b/crates/recorder/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] anyhow = "1.0" -libloading = "0.7" +libloading = "0.9" log = "0.4" precision = { git = "https://github.com/posborne/rust-precision.git", branch = "target-stable-asm" } serde = { version = "1.0.118", features = ["derive"] } diff --git a/engines/native/libengine/Cargo.toml b/engines/native/libengine/Cargo.toml index fec0e8e1..19a982fe 100644 --- a/engines/native/libengine/Cargo.toml +++ b/engines/native/libengine/Cargo.toml @@ -9,6 +9,6 @@ crate-type = ["rlib", "cdylib"] [dependencies] anyhow = "1.0.22" -libloading = "0.7" +libloading = "0.9" nix = "0.26.2" -libc="0.2" \ No newline at end of file +libc="0.2" From 25ddc51343a991edfd98c4671c5292ed0c066784 Mon Sep 17 00:00:00 2001 From: Paul Osborne Date: Fri, 19 Dec 2025 15:55:37 -0600 Subject: [PATCH 2/2] Explicity close() bench lib Windows has been exhibiting crashes after completion. We hope to explicilty control dll close in order to either prevent problems or get more explicit information on problems. --- crates/cli/src/benchmark.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/cli/src/benchmark.rs b/crates/cli/src/benchmark.rs index 05f888ea..0ca707f3 100644 --- a/crates/cli/src/benchmark.rs +++ b/crates/cli/src/benchmark.rs @@ -311,6 +311,12 @@ impl BenchmarkCommand { drop((engine, module)); all_measurements.extend(measurements.finish()); } + + // Explicitly close the library to handle any unload errors. + // We log errors but don't fail since measurements have been collected. + if let Err(e) = lib.close() { + log::warn!("Error unloading library: {e}"); + } } // If we are only benchmarking one phase then filter out any