Fix CTD caused by misaligned pointer - #58
Conversation
Rust has added a debug_assert to help prevent UB One such check is for pointer alignment which caused a CTD in debug build
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
|
More testing proofed its still broken, will reopen once I know more |
Also turns `RawStackTraceLine` & `RawContextStackTrace` pub but hidden so that the intergration tests can use them to construct a stack trace
|
Command parsing was fine, I just missed call context also being affected. I've added a test that I believe now covers every instance where this could happen. Also my testing showed that Arma seems to always sends an let flags = FeatureFlags::from_bits(unsafe { RVExtensionFeatureFlags });
let call_stack = if count > 5 && flags.context_stack_trace() {However the emulation test I added is a little awkward as I didn't figure a way for it to request the context like arma does so instead it uses |
|
Nightly/Miri update introduced a bug? |
* Fix miri errors Switched MissAligner to work with a raw memory ptr to pas the borrow checks. Also fix some dealloc erros * Attempt to fix emulate::c_interface_full * Reduce wait time again for `c_interface_full` Kinda also doing this to rerun the checks since I cant run those on command and I wanna see if its not a one off kinda thing * Fix missing `map_or_default` for c_interface_invalid_calls * Revert 0f04efc attempted fixes and just increase wait time
Rust added more debug assertions a while back: in 1.70.0 One of these checks is for misaligned pointers when using slices and arma gives us the command arguments misaligned, resulting in a panic only on debug builds.
This PR fixes that by manually traversing the array and using
read_unaligned.