MaybeUninit may cause a system reset if parity/ECC enabled

⚓ Rust    📅 2026-02-18    👤 surdeus    👁️ 8      

surdeus

I'd like to note that on some processors that have parity-check or ECC enabled, reading an uninitialized value will cause a system reset.

This information seems to be not explicitly worked out on the documentation page: MaybeUninit in std::mem - Rust

E.g. on this Renesas CPU:
https://www.renesas.com/en/document/apn/using-ecc-memory-configuration-and-error-injection-and-detection-tsi107
search for "The consequence to skipping this step is the
immediate notification of a multi-bit error condition ..."

In case you use MaybeUninit as performance optimization, I wonder if the small performance optimization is worth the risk of causing a system reset by accidentally reading uninitialized memory.

3 posts - 2 participants

Read full topic

🏷️ Rust_feed