Skip to content

intrinsics: Add a fallback for non-const libm float functions#150946

Open
tgross35 wants to merge 3 commits into
rust-lang:mainfrom
tgross35:float-intrinsic-fallback
Open

intrinsics: Add a fallback for non-const libm float functions#150946
tgross35 wants to merge 3 commits into
rust-lang:mainfrom
tgross35:float-intrinsic-fallback

Conversation

@tgross35

@tgross35 tgross35 commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

View all comments

A number of float operations from libm have intrinsics for optimization, but it is also okay to just call the libm functions directly. Add a fallback for these cases, including converting to/from another float size where needed, so the backends don't need to override these.

r? @RalfJung

@rustbot

rustbot commented Jan 10, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 10, 2026
Comment on lines 1410 to 1413
#[rustc_intrinsic_const_stable_indirect]
#[rustc_intrinsic]
#[rustc_nounwind]
pub const fn fmaf128(a: f128, b: f128, c: f128) -> f128;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is there a way to provide a non-const fallback for const intrinsics? In cases where CTFE definitely has to hook it rather than using the fallback, like here.

Not the worst thing if not.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think there is -- please file an issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Opened #150961

@rust-log-analyzer

This comment has been minimized.

@tgross35 tgross35 force-pushed the float-intrinsic-fallback branch from d533ef5 to 90b9d6a Compare January 11, 2026 01:59
@rust-log-analyzer

This comment has been minimized.

@tgross35

Copy link
Copy Markdown
Contributor Author
error: `compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `core::intrinsics::sqrtf64` to `core::num::libm::sqrt`
    --> library/core/src/intrinsics/mod.rs:1047:1
     |
1047 | pub fn sqrtf64(x: f64) -> f64 {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Huh - so #[inline] doesn't make a difference here. The body itself shouldn't be a problem since it's calling an extern function. @saethlin any idea what is going on here?

@saethlin

Copy link
Copy Markdown
Member

At a glance, your reasoning is completely backwards. The fallback body for sqrtf64 is being monomorphized, which is disallowed because it calls a libm function that is upstream.

@tgross35

Copy link
Copy Markdown
Contributor Author

It shouldn't be; the libm module in core is only bindings to libm, the function call is just an extern.

@RalfJung

Copy link
Copy Markdown
Member

The changes LGTM. However I can't actually check whether what you say about what is available where is correct -- you would be the person I ask about things like that. ;)
Is there anyone else who knows those details of libm and our compiler-builtins? If not, I'm also fine with approving this based on your judgment.

@tgross35

Copy link
Copy Markdown
Contributor Author

https://github.com/rust-lang/compiler-builtins/blob/65624df7f55db9b7b494fbe3aa9dcea0a743eea4/compiler-builtins/src/math/mod.rs is what controls what we sometimes/always provide, so the module root symbols and likely_available match that. Then the remaining maybe_available symbols are part of glibc (e.g. https://github.com/bminor/glibc/blob/e539a269990dac3ff4d2432c0eb6966a5ee4f274/sysdeps/unix/sysv/linux/i386/libm.abilist#L590), but not too much else.

@saethlin

saethlin commented Jan 11, 2026

Copy link
Copy Markdown
Member

It shouldn't be; the libm module in core is only bindings to libm, the function call is just an extern.

Yes, that's the problem. The body for the function is not available in the crate compiler-builtins when compiling compiler-builtins.

Remember the the rule is to ban linkage against other crates and the point of these extern declarations is to use linkage.

@rust-bors

This comment has been minimized.

@tgross35

Copy link
Copy Markdown
Contributor Author

It shouldn't be; the libm module in core is only bindings to libm, the function call is just an extern.

Yes, that's the problem. The body for the function is not available in the crate compiler-builtins when compiling compiler-builtins.

Remember the the rule is to ban linkage against other crates and the point of these extern declarations is to use linkage.

Forgot to follow up here. In this case it there isn't anything technically incorrect right, and instead it's a limitation of the knowledge the compiler has to emit that error? Because c-b itself provides the sqrt symbol so it will be available to link. I can drop the sqrt fallbacks for now since the status quo is fine anyway, but it seems like maybe the ideal solution would be something like an #[allow_compiler_builtins_link] attribute on the extern "C" block?

It probably goes without saying but libm isn't calling the sqrt intrinsic in fn sqrt itself, it's used elsewhere so we get the asm lowering if available.

@saethlin

saethlin commented Feb 13, 2026

Copy link
Copy Markdown
Member

Oh I see, thanks for clarifying. I think this is actually a limitation of the check logic itself. The problem is that you have an item defined in an upstream crate, which is not should_codegen_locally... except that it is codegenned in the local crate in this one case because of the linkage relationship.

So the missing check is whether the Instance inside is_call_from_compiler_builtins_to_upstream_monomorphization is actually an extern declaration of a symbol name that is in the current crate's exported_symbols. I think this is a feasible check for you to write if you want. I'm a bit busy for a bit or I'd try to slap it together. @bjorn3 since this is fiddly linkage stuff.

@saethlin

saethlin commented Feb 14, 2026

Copy link
Copy Markdown
Member

I threw this together to convince myself that this can work, and it seems to work.

diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs
index c8aa7c04585..3fc0411d2be 100644
--- a/compiler/rustc_codegen_ssa/src/base.rs
+++ b/compiler/rustc_codegen_ssa/src/base.rs
@@ -867,6 +867,10 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
 /// unlinkable calls.
 ///
 /// Note that calls to LLVM intrinsics are uniquely okay because they won't make it to the linker.
+/// Note also that calls to foreign items that are actually exported by the local crate are also
+/// okay. This situation arises because compiler-builtins calls functions in core that are #[inline]
+/// wrappers for extern "C" declarations in core, which resolve to a symbol exported by
+/// compiler-builtins.
 pub fn is_call_from_compiler_builtins_to_upstream_monomorphization<'tcx>(
     tcx: TyCtxt<'tcx>,
     instance: Instance<'tcx>,
@@ -879,11 +883,19 @@ fn is_llvm_intrinsic(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
         }
     }
 
+    fn is_extern_call_to_local_crate<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> bool {
+        tcx.is_foreign_item(instance.def_id())
+            && tcx.exported_non_generic_symbols(LOCAL_CRATE).iter().any(|(sym, _info)| {
+                sym.symbol_name_for_local_instance(tcx) == tcx.symbol_name(instance)
+            })
+    }
+
     let def_id = instance.def_id();
     !def_id.is_local()
         && tcx.is_compiler_builtins(LOCAL_CRATE)
         && !is_llvm_intrinsic(tcx, def_id)
         && !tcx.should_codegen_locally(instance)
+        && !is_extern_call_to_local_crate(tcx, instance)
 }
 
 impl CrateInfo {

The linear search of all exported non-generic symbols seems bad. It's only done a handful of times so it doesn't have a visible impact on compile time of compiler-builtins... yet.

@RalfJung

Copy link
Copy Markdown
Member

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 21, 2026
@rustbot

rustbot commented Feb 21, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 21, 2026
@folkertdev folkertdev force-pushed the float-intrinsic-fallback branch from 90b9d6a to 176fd06 Compare June 23, 2026 21:17
@rustbot

rustbot commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

tgross35 and others added 2 commits June 23, 2026 23:43
A number of float operations from libm have intrinsics for optimization,
but it is also okay to just call the libm functions directly. Add a
fallback for these cases, including converting to/from another float
size where needed, so the backends don't need to override these.
in `is_call_from_compiler_builtins_to_upstream_monomorphization`,
suggested by Seathlin
@tgross35 tgross35 force-pushed the float-intrinsic-fallback branch from 69882f0 to 21d67bf Compare June 23, 2026 23:43
@rust-log-analyzer

This comment has been minimized.

@folkertdev

Copy link
Copy Markdown
Contributor

@RalfJung we're running into MIRIFLAGS="-Zmiri-force-intrinsic-fallback" again here: sqrt etc. now do have a fallback body, normally that is overridden by the custom implementation, but not when passing that flag. (this came up recently in #157977).

We could manually disable the failing tests


FAILURES:
    tests/pass/float_extra_rounding_error.rs (revision random)
    tests/pass/float_extra_rounding_error.rs (revision max)
    tests/pass/float_extra_rounding_error.rs (revision none)
    tests/pass/float.rs
    tests/pass/integer-ops.rs
    tests/pass/intrinsics/fmuladd_nondeterministic.rs
    tests/pass/shims/x86/intrinsics-x86-sse.rs
    tests/pass/shims/x86/intrinsics-x86-sse2.rs

but maybe a list of "never use the fallback for these" intrinsics would be better? or some sort of attribute?

@rustbot

rustbot commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If possible, consider making this change to rust-lang/miri instead.

cc @rust-lang/miri

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-miri failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/pass-dep/tokio/socket.rs ... FAILED
tests/pass-dep/libc/mmap.rs ... ok

FAILED TEST: tests/pass-dep/tokio/mpsc-await.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-bjCyRG" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/miri" "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Zmiri-force-intrinsic-fallback" "--cfg" "force_intrinsic_fallback" "-O" "-Zmir-opt-level=4" "-Cdebug-assertions=yes" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/pass-dep/tokio" "tests/pass-dep/tokio/mpsc-await.rs" "--extern" "cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/cfg-if/a093fdfa4ea48c9a/out/libcfg_if-a093fdfa4ea48c9a.rlib" "--extern" "cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/cfg-if/a093fdfa4ea48c9a/out/libcfg_if-a093fdfa4ea48c9a.rmeta" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/4c95c25de819f5d0/out/libgetrandom-4c95c25de819f5d0.rlib" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/4c95c25de819f5d0/out/libgetrandom-4c95c25de819f5d0.rmeta" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/fd3dfc7d23ed83d2/out/libgetrandom-fd3dfc7d23ed83d2.rlib" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/fd3dfc7d23ed83d2/out/libgetrandom-fd3dfc7d23ed83d2.rmeta" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/b15f3d26bf4efe67/out/libgetrandom-b15f3d26bf4efe67.rlib" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/b15f3d26bf4efe67/out/libgetrandom-b15f3d26bf4efe67.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/libc/977059fcd7dbfd97/out/liblibc-977059fcd7dbfd97.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/libc/977059fcd7dbfd97/out/liblibc-977059fcd7dbfd97.rmeta" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/num_cpus/cda8b73cd138a4a3/out/libnum_cpus-cda8b73cd138a4a3.rlib" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/num_cpus/cda8b73cd138a4a3/out/libnum_cpus-cda8b73cd138a4a3.rmeta" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures/965aebfe0dce81d3/out/libfutures-965aebfe0dce81d3.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures/965aebfe0dce81d3/out/libfutures-965aebfe0dce81d3.rmeta" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/page_size/13dbc83c9afa3fbd/out/libpage_size-13dbc83c9afa3fbd.rlib" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/page_size/13dbc83c9afa3fbd/out/libpage_size-13dbc83c9afa3fbd.rmeta" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tempfile/6aaceb3922a772ac/out/libtempfile-6aaceb3922a772ac.rlib" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tempfile/6aaceb3922a772ac/out/libtempfile-6aaceb3922a772ac.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tokio/8489f3fa20adc1d1/out/libtokio-8489f3fa20adc1d1.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tokio/8489f3fa20adc1d1/out/libtokio-8489f3fa20adc1d1.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/fastrand/23dec8e124cfcfcd/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/rustix/31040bbb982d23a9/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/slab/cbceca1ee42f7372/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/fd3dfc7d23ed83d2/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-sink/00f629bd794243f8/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/socket2/0ff24d0d7e7f9df0/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-io/2c558ac1e0c915a3/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-task/f090b9948379e25e/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/bitflags/72a7b99213a67f53/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/once_cell/1936d921ab51e740/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures/965aebfe0dce81d3/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-util/57d4b3acb3a91f70/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/errno/562359b40477cfa1/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/b15f3d26bf4efe67/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/linux-raw-sys/9936c8de527b77e0/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/num_cpus/cda8b73cd138a4a3/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/pin-project-lite/5259b75905d51c6f/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-core/8344a4bc3b945d30/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/89147722ff84a5a2/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/cfg-if/a093fdfa4ea48c9a/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/build/tokio-macros/ba9937f9e1ec4dcb/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tokio/8489f3fa20adc1d1/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/mio/e843e4f03d4fba2d/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/4c95c25de819f5d0/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/page_size/13dbc83c9afa3fbd/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tempfile/6aaceb3922a772ac/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/libc/977059fcd7dbfd97/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/build/futures-macro/c44e308c7c173589/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/bytes/981095eb3678a5af/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/signal-hook-registry/1d0d206b7b231dbc/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-channel/ddf9c631f7286f5a/out" "--edition" "2021"

error: test got exit status: 1, but expected 0
 = note: compilation failed, but was expected to succeed

full stderr:
warning: Miri does not support optimizations: the opt-level is ignored. The only effect of selecting a Cargo profile that enables optimizations (such as --release) is to apply its remaining settings, such as whether debug assertions and overflow checks are enabled.

warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best.

error: unsupported operation: can't call foreign function `pow` on OS `linux`
##[error]  --> /checkout/library/core/src/intrinsics/mod.rs:1205:5
   |
LL |     libm::likely_available::pow(a, x)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
   |
   = help: this means the program tried to do something Miri does not support; it does not indicate a bug in the program
   = note: this is on thread `tokio-rt-worker`
   = note: stack backtrace:
           0: std::intrinsics::powf64
               at /checkout/library/core/src/intrinsics/mod.rs:1205:5: 1205:38
           1: std::f64::<impl f64>::powf
               at /checkout/library/std/src/num/f64.rs:357:9: 357:36
           2: tokio::runtime::scheduler::multi_thread::stats::Stats::end_processing_scheduled_tasks
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/stats.rs:108:40: 108:89
           3: tokio::runtime::scheduler::multi_thread::worker::Context::run
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:590:13: 590:56
           4: tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:550:21: 550:33
           5: tokio::runtime::context::scoped::Scoped::<tokio::runtime::scheduler::Context>::set::<{closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}, ()>
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/context/scoped.rs:40:9: 40:12
           6: tokio::runtime::context::set_scheduler::<(), {closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}>::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/context.rs:181:26: 181:47
           7: std::thread::LocalKey::<tokio::runtime::context::Context>::try_with::<{closure@tokio::runtime::context::set_scheduler<(), {closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}>::{closure#0}}, ()>
               at /checkout/library/std/src/thread/local.rs:463:12: 463:27
           8: std::thread::LocalKey::<tokio::runtime::context::Context>::with::<{closure@tokio::runtime::context::set_scheduler<(), {closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}>::{closure#0}}, ()>
               at /checkout/library/std/src/thread/local.rs:427:15: 427:31
           9: tokio::runtime::context::set_scheduler::<(), {closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}>
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/context.rs:181:9: 181:48
           10: tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:545:9: 556:11
           11: tokio::runtime::scheduler::multi_thread::worker::run
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:537:5: 557:7
           12: tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:503:45: 503:56
           13: <tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}> as std::future::Future>::poll
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/blocking/task.rs:42:21: 42:27
           14: tokio::runtime::task::core::Core::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/core.rs:375:17: 375:37
           15: tokio::loom::std::unsafe_cell::UnsafeCell::<tokio::runtime::task::core::Stage<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>>>::with_mut::<std::task::Poll<()>, {closure@tokio::runtime::task::core::Core<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll::{closure#0}}>
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/loom/std/unsafe_cell.rs:16:9: 16:24
           16: tokio::runtime::task::core::Core::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/core.rs:364:13: 376:15
           17: tokio::runtime::task::harness::poll_future::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/harness.rs:535:19: 535:38
           18: <std::panic::AssertUnwindSafe<{closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}}> as std::ops::FnOnce<()>>::call_once
               at /checkout/library/core/src/panic/unwind_safe.rs:275:9: 275:19
           19: std::panicking::catch_unwind::do_call::<std::panic::AssertUnwindSafe<{closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}}>, std::task::Poll<()>>
               at /checkout/library/std/src/panicking.rs:575:43: 575:46
           20: std::panicking::catch_unwind::<std::task::Poll<()>, std::panic::AssertUnwindSafe<{closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}}>>
               at /checkout/library/std/src/panicking.rs:543:19: 543:77
           21: std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}}>, std::task::Poll<()>>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           22: tokio::runtime::task::harness::poll_future::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/harness.rs:523:18: 538:8
           23: tokio::runtime::task::harness::Harness::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll_inner
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/harness.rs:210:27: 210:55
           24: tokio::runtime::task::harness::Harness::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/harness.rs:155:15: 155:32
           25: tokio::runtime::task::raw::poll::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/raw.rs:337:5: 337:19
           26: tokio::runtime::task::raw::RawTask::poll
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/raw.rs:267:18: 267:41
           27: tokio::runtime::task::UnownedTask::<tokio::runtime::blocking::schedule::BlockingSchedule>::run
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/mod.rs:547:9: 547:19
           28: tokio::runtime::blocking::pool::Task::run
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/blocking/pool.rs:161:9: 161:24
           29: tokio::runtime::blocking::pool::Inner::run
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/blocking/pool.rs:518:17: 518:27
           30: tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/blocking/pool.rs:474:13: 474:54
           31: std::sys::backtrace::__rust_begin_short_backtrace::<{closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>
               at /checkout/library/std/src/sys/backtrace.rs:166:18: 166:21
           32: std::thread::lifecycle::spawn_unchecked::<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}::{closure#0}
               at /checkout/library/std/src/thread/lifecycle.rs:70:13: 70:67
           33: <std::panic::AssertUnwindSafe<{closure@std::thread::lifecycle::spawn_unchecked<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}::{closure#0}}> as std::ops::FnOnce<()>>::call_once
               at /checkout/library/core/src/panic/unwind_safe.rs:275:9: 275:19
           34: std::panicking::catch_unwind::do_call::<std::panic::AssertUnwindSafe<{closure@std::thread::lifecycle::spawn_unchecked<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>
               at /checkout/library/std/src/panicking.rs:575:43: 575:46
           35: std::panicking::catch_unwind::<(), std::panic::AssertUnwindSafe<{closure@std::thread::lifecycle::spawn_unchecked<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}::{closure#0}}>>
               at /checkout/library/std/src/panicking.rs:543:19: 543:77
           36: std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@std::thread::lifecycle::spawn_unchecked<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           37: std::thread::lifecycle::spawn_unchecked::<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}
               at /checkout/library/std/src/thread/lifecycle.rs:68:26: 71:12
           38: <{closure@std::thread::lifecycle::spawn_unchecked<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}} as std::ops::FnOnce<()>>::call_once - shim(vtable)
               at /checkout/library/core/src/ops/function.rs:250:5: 250:71
           39: <std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send> as std::ops::FnOnce<()>>::call_once
               at /checkout/library/alloc/src/boxed.rs:2273:9: 2273:52
           40: std::sys::thread::unix::Thread::new::thread_start
               at /checkout/library/std/src/sys/thread/unix.rs:118:17: 118:29
note: the last function in that backtrace got called indirectly due to this code
  --> tests/pass-dep/tokio/mpsc-await.rs:17:5
   |
LL |     while let Some(message) = rx.recv().await {
   |     ^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error; 2 warnings emitted
---



FAILED TEST: tests/pass-dep/tokio/socket.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-bjCyRG" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/miri" "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Zmiri-force-intrinsic-fallback" "--cfg" "force_intrinsic_fallback" "-O" "-Zmir-opt-level=4" "-Cdebug-assertions=yes" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/pass-dep/tokio" "tests/pass-dep/tokio/socket.rs" "-Zmiri-disable-isolation" "--extern" "cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/cfg-if/a093fdfa4ea48c9a/out/libcfg_if-a093fdfa4ea48c9a.rlib" "--extern" "cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/cfg-if/a093fdfa4ea48c9a/out/libcfg_if-a093fdfa4ea48c9a.rmeta" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/4c95c25de819f5d0/out/libgetrandom-4c95c25de819f5d0.rlib" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/4c95c25de819f5d0/out/libgetrandom-4c95c25de819f5d0.rmeta" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/fd3dfc7d23ed83d2/out/libgetrandom-fd3dfc7d23ed83d2.rlib" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/fd3dfc7d23ed83d2/out/libgetrandom-fd3dfc7d23ed83d2.rmeta" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/b15f3d26bf4efe67/out/libgetrandom-b15f3d26bf4efe67.rlib" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/b15f3d26bf4efe67/out/libgetrandom-b15f3d26bf4efe67.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/libc/977059fcd7dbfd97/out/liblibc-977059fcd7dbfd97.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/libc/977059fcd7dbfd97/out/liblibc-977059fcd7dbfd97.rmeta" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/num_cpus/cda8b73cd138a4a3/out/libnum_cpus-cda8b73cd138a4a3.rlib" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/num_cpus/cda8b73cd138a4a3/out/libnum_cpus-cda8b73cd138a4a3.rmeta" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures/965aebfe0dce81d3/out/libfutures-965aebfe0dce81d3.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures/965aebfe0dce81d3/out/libfutures-965aebfe0dce81d3.rmeta" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/page_size/13dbc83c9afa3fbd/out/libpage_size-13dbc83c9afa3fbd.rlib" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/page_size/13dbc83c9afa3fbd/out/libpage_size-13dbc83c9afa3fbd.rmeta" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tempfile/6aaceb3922a772ac/out/libtempfile-6aaceb3922a772ac.rlib" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tempfile/6aaceb3922a772ac/out/libtempfile-6aaceb3922a772ac.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tokio/8489f3fa20adc1d1/out/libtokio-8489f3fa20adc1d1.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tokio/8489f3fa20adc1d1/out/libtokio-8489f3fa20adc1d1.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/fastrand/23dec8e124cfcfcd/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/rustix/31040bbb982d23a9/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/slab/cbceca1ee42f7372/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/fd3dfc7d23ed83d2/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-sink/00f629bd794243f8/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/socket2/0ff24d0d7e7f9df0/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-io/2c558ac1e0c915a3/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-task/f090b9948379e25e/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/bitflags/72a7b99213a67f53/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/once_cell/1936d921ab51e740/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures/965aebfe0dce81d3/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-util/57d4b3acb3a91f70/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/errno/562359b40477cfa1/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/b15f3d26bf4efe67/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/linux-raw-sys/9936c8de527b77e0/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/num_cpus/cda8b73cd138a4a3/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/pin-project-lite/5259b75905d51c6f/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-core/8344a4bc3b945d30/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/89147722ff84a5a2/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/cfg-if/a093fdfa4ea48c9a/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/build/tokio-macros/ba9937f9e1ec4dcb/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tokio/8489f3fa20adc1d1/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/mio/e843e4f03d4fba2d/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/4c95c25de819f5d0/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/page_size/13dbc83c9afa3fbd/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tempfile/6aaceb3922a772ac/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/libc/977059fcd7dbfd97/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/build/futures-macro/c44e308c7c173589/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/bytes/981095eb3678a5af/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/signal-hook-registry/1d0d206b7b231dbc/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-channel/ddf9c631f7286f5a/out" "--edition" "2021"

error: test got exit status: 1, but expected 0
 = note: compilation failed, but was expected to succeed

full stderr:
warning: Miri does not support optimizations: the opt-level is ignored. The only effect of selecting a Cargo profile that enables optimizations (such as --release) is to apply its remaining settings, such as whether debug assertions and overflow checks are enabled.

warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best.

error: unsupported operation: can't call foreign function `pow` on OS `linux`
##[error]  --> /checkout/library/core/src/intrinsics/mod.rs:1205:5
   |
LL |     libm::likely_available::pow(a, x)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
   |
   = help: this means the program tried to do something Miri does not support; it does not indicate a bug in the program
   = note: this is on thread `tokio-rt-worker`
   = note: stack backtrace:
           0: std::intrinsics::powf64
               at /checkout/library/core/src/intrinsics/mod.rs:1205:5: 1205:38
           1: std::f64::<impl f64>::powf
               at /checkout/library/std/src/num/f64.rs:357:9: 357:36
           2: tokio::runtime::scheduler::multi_thread::stats::Stats::end_processing_scheduled_tasks
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/stats.rs:108:40: 108:89
           3: tokio::runtime::scheduler::multi_thread::worker::Context::run
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:590:13: 590:56
           4: tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:550:21: 550:33
           5: tokio::runtime::context::scoped::Scoped::<tokio::runtime::scheduler::Context>::set::<{closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}, ()>
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/context/scoped.rs:40:9: 40:12
           6: tokio::runtime::context::set_scheduler::<(), {closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}>::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/context.rs:181:26: 181:47
           7: std::thread::LocalKey::<tokio::runtime::context::Context>::try_with::<{closure@tokio::runtime::context::set_scheduler<(), {closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}>::{closure#0}}, ()>
               at /checkout/library/std/src/thread/local.rs:463:12: 463:27
           8: std::thread::LocalKey::<tokio::runtime::context::Context>::with::<{closure@tokio::runtime::context::set_scheduler<(), {closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}>::{closure#0}}, ()>
               at /checkout/library/std/src/thread/local.rs:427:15: 427:31
           9: tokio::runtime::context::set_scheduler::<(), {closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}>
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/context.rs:181:9: 181:48
           10: tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:545:9: 556:11
           11: tokio::runtime::scheduler::multi_thread::worker::run
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:537:5: 557:7
           12: tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:503:45: 503:56
           13: <tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}> as std::future::Future>::poll
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/blocking/task.rs:42:21: 42:27
           14: tokio::runtime::task::core::Core::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/core.rs:375:17: 375:37
           15: tokio::loom::std::unsafe_cell::UnsafeCell::<tokio::runtime::task::core::Stage<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>>>::with_mut::<std::task::Poll<()>, {closure@tokio::runtime::task::core::Core<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll::{closure#0}}>
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/loom/std/unsafe_cell.rs:16:9: 16:24
           16: tokio::runtime::task::core::Core::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/core.rs:364:13: 376:15
           17: tokio::runtime::task::harness::poll_future::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/harness.rs:535:19: 535:38
           18: <std::panic::AssertUnwindSafe<{closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}}> as std::ops::FnOnce<()>>::call_once
               at /checkout/library/core/src/panic/unwind_safe.rs:275:9: 275:19
           19: std::panicking::catch_unwind::do_call::<std::panic::AssertUnwindSafe<{closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}}>, std::task::Poll<()>>
               at /checkout/library/std/src/panicking.rs:575:43: 575:46
           20: std::panicking::catch_unwind::<std::task::Poll<()>, std::panic::AssertUnwindSafe<{closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}}>>
               at /checkout/library/std/src/panicking.rs:543:19: 543:77
           21: std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}}>, std::task::Poll<()>>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           22: tokio::runtime::task::harness::poll_future::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/harness.rs:523:18: 538:8
           23: tokio::runtime::task::harness::Harness::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll_inner
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/harness.rs:210:27: 210:55
           24: tokio::runtime::task::harness::Harness::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/harness.rs:155:15: 155:32
           25: tokio::runtime::task::raw::poll::<tokio::runtime::blocking::task::BlockingTask<{closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}}>, tokio::runtime::blocking::schedule::BlockingSchedule>
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/raw.rs:337:5: 337:19
           26: tokio::runtime::task::raw::RawTask::poll
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/raw.rs:267:18: 267:41
           27: tokio::runtime::task::UnownedTask::<tokio::runtime::blocking::schedule::BlockingSchedule>::run
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/task/mod.rs:547:9: 547:19
           28: tokio::runtime::blocking::pool::Task::run
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/blocking/pool.rs:161:9: 161:24
           29: tokio::runtime::blocking::pool::Inner::run
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/blocking/pool.rs:518:17: 518:27
           30: tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}
               at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/blocking/pool.rs:474:13: 474:54
           31: std::sys::backtrace::__rust_begin_short_backtrace::<{closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>
               at /checkout/library/std/src/sys/backtrace.rs:166:18: 166:21
           32: std::thread::lifecycle::spawn_unchecked::<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}::{closure#0}
               at /checkout/library/std/src/thread/lifecycle.rs:70:13: 70:67
           33: <std::panic::AssertUnwindSafe<{closure@std::thread::lifecycle::spawn_unchecked<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}::{closure#0}}> as std::ops::FnOnce<()>>::call_once
               at /checkout/library/core/src/panic/unwind_safe.rs:275:9: 275:19
           34: std::panicking::catch_unwind::do_call::<std::panic::AssertUnwindSafe<{closure@std::thread::lifecycle::spawn_unchecked<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>
               at /checkout/library/std/src/panicking.rs:575:43: 575:46
           35: std::panicking::catch_unwind::<(), std::panic::AssertUnwindSafe<{closure@std::thread::lifecycle::spawn_unchecked<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}::{closure#0}}>>
               at /checkout/library/std/src/panicking.rs:543:19: 543:77
           36: std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@std::thread::lifecycle::spawn_unchecked<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           37: std::thread::lifecycle::spawn_unchecked::<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}
               at /checkout/library/std/src/thread/lifecycle.rs:68:26: 71:12
           38: <{closure@std::thread::lifecycle::spawn_unchecked<'_, {closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}}, ()>::{closure#1}} as std::ops::FnOnce<()>>::call_once - shim(vtable)
               at /checkout/library/core/src/ops/function.rs:250:5: 250:71
           39: <std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send> as std::ops::FnOnce<()>>::call_once
               at /checkout/library/alloc/src/boxed.rs:2273:9: 2273:52
           40: std::sys::thread::unix::Thread::new::thread_start
               at /checkout/library/std/src/sys/thread/unix.rs:118:17: 118:29
---
Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.30.7/src/lib.rs:365

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: <color_eyre[c7c870fb5d7a0b67]::config::EyreHook>::into_eyre_hook::{closure#0}<unknown>
      at <unknown source file>:<unknown line>
   2: eyre[d68a1bcbef8564f1]::capture_handler<unknown>
      at <unknown source file>:<unknown line>
   3: eyre[d68a1bcbef8564f1]::private::format_err<unknown>
      at <unknown source file>:<unknown line>
   4: ui_test[c344e77b19dbd06f]::run_tests_generic::<ui_test[c344e77b19dbd06f]::default_file_filter, ui[5d4f1eaf05b2d376]::run_tests::{closure#1}, alloc[33ed0bde81612997]::boxed::Box<dyn ui_test[c344e77b19dbd06f]::status_emitter::StatusEmitter>><unknown>
      at <unknown source file>:<unknown line>
   5: ui[5d4f1eaf05b2d376]::ui<unknown>
      at <unknown source file>:<unknown line>
   6: ui[5d4f1eaf05b2d376]::main<unknown>
      at <unknown source file>:<unknown line>
   7: std[305a00afa8551043]::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core[a62bc04d55bede68]::result::Result<(), eyre[d68a1bcbef8564f1]::Report>, core[a62bc04d55bede68]::result::Result<(), eyre[d68a1bcbef8564f1]::Report>><unknown>
      at <unknown source file>:<unknown line>
   8: std[305a00afa8551043]::rt::lang_start::<core[a62bc04d55bede68]::result::Result<(), eyre[d68a1bcbef8564f1]::Report>>::{closure#0}<unknown>
      at <unknown source file>:<unknown line>
   9: std[305a00afa8551043]::rt::lang_start_internal<unknown>
      at <unknown source file>:<unknown line>
  10: main<unknown>
      at <unknown source file>:<unknown line>
  11: __libc_start_main<unknown>
      at <unknown source file>:<unknown line>
  12: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/miri/b44484fea07e790a/out/ui-b44484fea07e790a tests/pass tests/panic` (exit status: 1)
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo test --target x86_64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout --locked --color=always --profile=release --manifest-path /checkout/src/tools/miri/Cargo.toml -- tests/pass tests/panic [workdir=/checkout]` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:191:21
Executed at: src/bootstrap/src/core/build_steps/test.rs:769:19

--- BACKTRACE vvv
   0: <bootstrap::utils::exec::DeferredCommand>::finish_process
             at /checkout/src/bootstrap/src/utils/exec.rs:939:17
   1: <bootstrap::utils::exec::DeferredCommand>::wait_for_output::<&bootstrap::utils::exec::ExecutionContext>
             at /checkout/src/bootstrap/src/utils/exec.rs:831:21
   2: <bootstrap::utils::exec::ExecutionContext>::run
             at /checkout/src/bootstrap/src/utils/exec.rs:741:45
   3: <bootstrap::utils::exec::BootstrapCommand>::run::<&bootstrap::core::builder::Builder>
             at /checkout/src/bootstrap/src/utils/exec.rs:339:27
   4: <bootstrap::core::build_steps::test::Miri as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:769:19
   5: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::Miri>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1597:36
   6: <bootstrap::core::build_steps::test::Miri as bootstrap::core::builder::Step>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:695:21
   7: <bootstrap::core::builder::StepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:476:13
   8: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:232:18
   9: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1140:9
  10: <bootstrap::core::builder::Builder>::execute_cli
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1119:14
  11: <bootstrap::Build>::build
             at /checkout/src/bootstrap/src/lib.rs:803:25
  12: bootstrap::main
             at /checkout/src/bootstrap/src/bin/main.rs:130:11
  13: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/core/src/ops/function.rs:250:5
  14: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/sys/backtrace.rs:166:18
  15: std::rt::lang_start::<()>::{closure#0}
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/rt.rs:206:18
  16: <&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/core/src/ops/function.rs:287:21
  17: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:581:40
  18: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:544:19
  19: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panic.rs:359:14
  20: std::rt::lang_start_internal::{closure#0}
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/rt.rs:175:24
  21: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:581:40
---
  28: __libc_start_main
  29: _start


Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `test --stage 2 src/tools/miri -- tests/pass tests/panic`
Build completed unsuccessfully in 0:01:33
  local time: Wed Jun 24 09:54:44 UTC 2026
  network time: Wed, 24 Jun 2026 09:54:44 GMT
##[error]Process completed with exit code 1.

@RalfJung

Copy link
Copy Markdown
Member

I don't think those would be better than the cfg.

Can you make it so it only skips the nondet tests rather than skipping the entire test? Also please add comments explaining why this gets skipped.

pub fn sqrtf16(x: f16) -> f16;
pub fn sqrtf16(x: f16) -> f16 {
libm::sqrtf16(x)
}

@RalfJung RalfJung Jun 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Adding a fallback body now will make it harder to constify these intrinsics later due to #150961. So -- is that really worth it? At least for intrinsics that we already have softfloat impls for, maybe it'd be better to not have fallback bodies.

View changes since the review

@folkertdev

Copy link
Copy Markdown
Contributor

I don't think those would be better than the cfg.

Well, it's tricky to deal with the errors in the tokio tests

error: unsupported operation: can't call foreign function `pow` on OS `linux`
  --> /home/folkertdev/rust/rust/library/core/src/intrinsics/mod.rs:1205:5
   |
LL |     libm::likely_available::pow(a, x)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
   |
   = help: this means the program tried to do something Miri does not support; it does not indicate a bug in the program
   = note: this is on thread `tokio-rt-worker`
   = note: stack backtrace:
           0: std::intrinsics::powf64
               at /home/folkertdev/rust/rust/library/core/src/intrinsics/mod.rs:1205:5: 1205:38
           1: std::f64::<impl f64>::powf
               at /home/folkertdev/rust/rust/library/std/src/num/f64.rs:357:9: 357:36
           2: tokio::runtime::scheduler::multi_thread::stats::Stats::end_processing_scheduled_tasks
               at /home/folkertdev/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/stats.rs:108:40: 108:89
           3: tokio::runtime::scheduler::multi_thread::worker::Context::run
               at /home/folkertdev/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:590:13: 590:56
           4: tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}
               at /home/folkertdev/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.3/src/runtime/scheduler/multi_thread/worker.rs:550:21: 550:33
           5: tokio::runtime::context::scoped::Scoped::<tokio::runtime::scheduler::Context>::set::<{closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}::{closure#0}}, ()>

from


FAILURES:
    tests/pass-dep/tokio/mpsc-await.rs
    tests/pass-dep/tokio/socket.rs

They assert on the output too, so we can't just skip the test. We can fake the output? Idk this just seems really fragile.

@RalfJung

Copy link
Copy Markdown
Member

Ah, yeah that's annoying.

Can we have something in the rustc test suite that tests the fallback bodies? That might be more robust / easier to maintain than doing that via Miri.

@folkertdev

Copy link
Copy Markdown
Contributor

Well we can add -Zforce-intrinsic-fallback as a rustc flag? Running the whole std test suite with that seems a bit expensive but maybe we can make that work?

And then some sort of const MIRI_MUST_BE_OVERRIDDEN: &[Symbol] = ...? That's still kind of fragile though.

@RalfJung

Copy link
Copy Markdown
Member

Well we can add -Zforce-intrinsic-fallback as a rustc flag? Running the whole std test suite with that seems a bit expensive but maybe we can make that work?

Yeah something like that -- but it may need its own sysroot build.

And then some sort of const MIRI_MUST_BE_OVERRIDDEN: &[Symbol] = ...? That's still kind of fragile though.

What purpose does that serve? We already default to requiring a Miri override for every intrinsic that does not have #[miri::intrinsic_fallback_is_spec].


I added this Miri intrinsic fallback body test to let us catch bugs in the fallback intrinsics as some of those have complicated bodies. We should ensure we have test coverage for the stuff in library/core/src/intrinsics/fallback.rs; if we do then I can live with removing the Miri test -- AFAIK so far it hasn't found any actual bugs, and it turns out to be more maintenance-heavy than I thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants