I recently updated to 1.81.0 and while the normal compilation and everything works still fine, the cargo test leads to an error which I dont manage to get around.
thread 'tests::cluster2tree_1' panicked at library/core/src/panicking.rs:221:5:
unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
stack backtrace:
....
6: rust_htslib::bcf::header::HeaderView::samples
at ..../.cargo/registry/src/index.crates.io-6f17d22bba15001f/rust-htslib-0.47.0/src/bcf/header.rs:287:22
....
I tried to clean everything, building in a different environment,... always hitting that wall now.
Update:
Versions:
rust stable 1.81.0
htslib 0.47.0
Interestingly, it really seems to relate only to debug builds as used in cargo test.
If I run cargo test --release everything succeeds.
If I compile my binary with debug vs release, the results are very different:
target/debug/vcf_sv_cluster --vcf test/vcf_cluster/corner_case2.vcf --chroms test/vcf_cluster/corner_case2.length
thread 'main' panicked at library/core/src/panicking.rs:221:5:
unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread caused non-unwinding panic. aborting.
Aborted (core dumped)
I recently updated to 1.81.0 and while the normal compilation and everything works still fine, the
cargo test
leads to an error which I dont manage to get around.line
I tried to clean everything, building in a different environment,... always hitting that wall now.
Update:
Versions:
Interestingly, it really seems to relate only to
debug
builds as used incargo test
. If I runcargo test --release
everything succeeds. If I compile my binary with debug vs release, the results are very different:--> works as expected
I dont know how this is possible at the moment