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
A panic occurs in this crate when using constellation-rs. The crate panics immediately, which makes constellation unusable.
The panic occurs in the assertion in timer.rs:98:13, as reported by backtrace.
After digging a bit I believe this is caused by the cast from time::Instant to timer::Instant, because time::Instant is defined as { i64, u32 }, whereas libc::timespec is defined as { i64, i64 }. This results in garbage data being read in the upper 32 bits of timer::Instant.t.t.tv_nsec. Comparing the mismatched values which triggered the assertion confirms the they do have the same lower 32 bits and the upper 32 bits of tv_nsec are non-zero.
The text was updated successfully, but these errors were encountered:
Thanks for surfacing this @hollmmax. I saw this a while back in TWIR and forgot I'd written (horrible) code depending on the layout of Instant.
Do you think there's a way to do this safely? Do we have to forego std::time::Instant compatibility? Or shall we continue the casting hack, and just update to the below?
I didn't dig deeper into why and how std::time::Instant compatibility is used, but it is, so I'll assume that dropping support for it would be more work elsewhere.
I'm also not sure what you mean by updating to the current std::time::Instant, because the problem comes from the difference between std::time::Instant and nix::libc::timespec.
A panic occurs in this crate when using
constellation-rs
. The crate panics immediately, which makes constellation unusable.The panic occurs in the assertion in timer.rs:98:13, as reported by backtrace.
After digging a bit I believe this is caused by the cast from
time::Instant
totimer::Instant
, becausetime::Instant
is defined as{ i64, u32 }
, whereaslibc::timespec
is defined as{ i64, i64 }
. This results in garbage data being read in the upper 32 bits oftimer::Instant.t.t.tv_nsec
. Comparing the mismatched values which triggered the assertion confirms the they do have the same lower 32 bits and the upper 32 bits oftv_nsec
are non-zero.The text was updated successfully, but these errors were encountered: