You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One issue preventing using the Runtime as a module-level fixture in tests (or using it in loops in a script) is that, in Rust, raw pointers want to be aligned when dereferenced (see).
To reproduce this, it's enough to acquire with a frame size that's not divisible by 8 and iterate over the frames:
thread '<unnamed>' panicked at src/runtime.rs:394:54:
misaligned pointer dereference: address must be a multiple of 0x8 but is 0x300000c7e
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread caused non-unwinding panic. aborting.
Process finished with exit code 134 (interrupted by signal 6:SIGABRT)
This is VideoFrameIterator::next():
fnnext(&mutself) -> Option<Self::Item>{letmut cur = self.cur.lock();if(*self.store.lock()).is_some() && *cur < self.end{let out = VideoFrame{_store:self.store.clone(),cur:*cur,};let c = cur.as_ptr();let o = unsafe{(c as*constu8).offset((*c).bytes_of_frameas_)}// OFFENDING DEREFERENCE HEREas*mut capi::VideoFrame;*cur = unsafe{NonNull::new_unchecked(o)};Some(out)}else{None}}
We should consider padding video frames and making next aware of this.
The text was updated successfully, but these errors were encountered:
One issue preventing using the Runtime as a module-level fixture in tests (or using it in loops in a script) is that, in Rust, raw pointers want to be aligned when dereferenced (see).
To reproduce this, it's enough to acquire with a frame size that's not divisible by 8 and iterate over the frames:
giving something like the following error:
This is
VideoFrameIterator::next()
:We should consider padding video frames and making
next
aware of this.The text was updated successfully, but these errors were encountered: