#1134963 rust-num-prime: FTBFS: flaky tests?

#1134963#5
Date:
2026-04-26 13:22:26 UTC
From:
To:
Dear maintainer,

rust-num-prime FTBFS on amd64 and riscv64 with:


failures:
---- rand::tests::rand_prime stdout ----

thread 'rand::tests::rand_prime' (996) panicked at src/nt_funcs.rs:837:36:
index out of bounds: the len is 54 but the index is 54
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /usr/src/rustc-1.94.1/library/std/src/panicking.rs:689:5
   1: core::panicking::panic_fmt
             at /usr/src/rustc-1.94.1/library/core/src/panicking.rs:80:14
   2: core::panicking::panic_bounds_check
             at /usr/src/rustc-1.94.1/library/core/src/panicking.rs:271:5
   3: num_prime::nt_funcs::next_prime
             at /usr/share/cargo/registry/num-prime-0.4.4/src/nt_funcs.rs:837:36
   4: num_prime::rand::<impl num_prime::traits::RandPrime<u8> for R>::gen_prime
             at /usr/share/cargo/registry/num-prime-0.4.4/src/rand.rs:22:45
   5: num_prime::rand::<impl num_prime::traits::RandPrime<u8> for R>::gen_safe_prime
             at /usr/share/cargo/registry/num-prime-0.4.4/src/rand.rs:51:34
   6: num_prime::rand::tests::rand_prime
             at /usr/share/cargo/registry/num-prime-0.4.4/src/rand.rs:226:25
   7: num_prime::rand::tests::rand_prime::{{closure}}
             at /usr/share/cargo/registry/num-prime-0.4.4/src/rand.rs:210:20
   8: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.94.1/library/core/src/ops/function.rs:250:5
   9: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.94.1/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    rand::tests::rand_prime

test result: FAILED. 22 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.38s

error: test failed, to rerun pass `--lib`

See
https://buildd.debian.org/status/fetch.php?pkg=rust-num-prime&arch=amd64&ver=0.4.4-2%2Bb1&stamp=1776894474&raw=0
for details.

It didin't fail on other arches, so this could be flaky tests.

cheers
-- 
Sebastian Ramacher

#1134963#10
Date:
2026-04-27 10:11:22 UTC
From:
To:
severity 1134963 important
thanks

https://buildd.debian.org/status/package.php?p=rust-num-prime

Note: I can also reproduce the flakiness in my archive rebuild
environment, but the failure rate I get (after trying many times) is
around 8%. I'm downgrading for that reason, but I expect the
maintainers to forward the bug upstream.

Thanks.