Some deserialization paths use std::optional<T> tmp; as if it were “allocated but uninitialized storage” and then pass &*tmp to serde::deserialize(...). When tmp is disengaged, operator* is undefined behavior; with libc++ hardening enabled it triggers an assertion and aborts the process (SIGABRT).
This results in process termination instead of a normal error (exception) when deserializing malformed/short buffers (and potentially other edge cases).
Expected behavior
Deserialization should either:
- succeed, or
- throw/return a normal error (e.g.
std::invalid_argument, std::runtime_error)
It should not abort the process.
Actual behavior
With libc++ hardening enabled, the process aborts with:
optional operator* called on a disengaged value
Abort trap: 6 / SIGABRT
The abort points to std::optional<T>::operator* used on an empty optional.