spa: pod: invalid read in array_bool test
Running valgrind on the array_bool
test raises this invalid read:
==2187505== Thread 2 array_bool:
==2187505== Conditional jump or move depends on uninitialised value(s)
==2187505== at 0x483FCAE: bcmp (vg_replace_strmem.c:1111)
==2187505== by 0x20B9B3: <[A] as core::slice::cmp::SlicePartialEq<B>>::equal (cmp.rs:92)
==2187505== by 0x20B64D: core::slice::cmp::<impl core::cmp::PartialEq<[B]> for [A]>::eq (cmp.rs:27)
==2187505== by 0x16AECF: alloc::vec::partial_eq::<impl core::cmp::PartialEq<alloc::vec::Vec<U,A>> for alloc::vec::Vec<T,A>>::eq (partial_eq.rs:15)
==2187505== by 0x13FB5E: pod::array_bool (pod.rs:680)
==2187505== by 0x13F7F9: pod::array_bool::{{closure}} (pod.rs:655)
==2187505== by 0x18246D: core::ops::function::FnOnce::call_once (function.rs:227)
==2187505== by 0x1AF132: call_once<fn(),()> (function.rs:227)
==2187505== by 0x1AF132: test::__rust_begin_short_backtrace (lib.rs:567)
==2187505== by 0x1ADA4F: call_once<(),FnOnce<()>,alloc::alloc::Global> (boxed.rs:1546)
==2187505== by 0x1ADA4F: call_once<(),alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>> (panic.rs:344)
==2187505== by 0x1ADA4F: do_call<std::panic::AssertUnwindSafe<alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>>,()> (panicking.rs:379)
==2187505== by 0x1ADA4F: try<(),std::panic::AssertUnwindSafe<alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>>> (panicking.rs:343)
==2187505== by 0x1ADA4F: catch_unwind<std::panic::AssertUnwindSafe<alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>>,()> (panic.rs:431)
==2187505== by 0x1ADA4F: run_test_in_process (lib.rs:589)
==2187505== by 0x1ADA4F: test::run_test::run_test_inner::{{closure}} (lib.rs:486)
==2187505== by 0x18734D: {{closure}} (lib.rs:511)
==2187505== by 0x18734D: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:125)
==2187505== by 0x18B2AE: {{closure}}<closure-1,()> (mod.rs:474)
==2187505== by 0x18B2AE: call_once<(),closure-0> (panic.rs:344)
==2187505== by 0x18B2AE: do_call<std::panic::AssertUnwindSafe<closure-0>,()> (panicking.rs:379)
==2187505== by 0x18B2AE: try<(),std::panic::AssertUnwindSafe<closure-0>> (panicking.rs:343)
==2187505== by 0x18B2AE: catch_unwind<std::panic::AssertUnwindSafe<closure-0>,()> (panic.rs:431)
==2187505== by 0x18B2AE: {{closure}}<closure-1,()> (mod.rs:473)
==2187505== by 0x18B2AE: core::ops::function::FnOnce::call_once{{vtable-shim}} (function.rs:227)
==2187505== by 0x236B89: call_once<(),FnOnce<()>,alloc::alloc::Global> (boxed.rs:1546)
==2187505== by 0x236B89: call_once<(),alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>,alloc::alloc::Global> (boxed.rs:1546)
==2187505== by 0x236B89: std::sys::unix::thread::Thread::new::thread_start (thread.rs:71)
==2187505== by 0x48873F8: start_thread (in /usr/lib64/libpthread-2.32.so)
==2187505== by 0x4AEEB52: clone (in /usr/lib64/libc-2.32.so)
Looks like we are reading uninitialised memory from vec_c
when comparing the serialized data.
Here are the serialized data:
[16, 0, 0, 0, 13, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
It looks strange as the pod's len is 16 but contains 1
on its 17th byte.
@ryuukyu : any idea what's happening here?