MaheshGPai opened a new issue, #477:
URL: https://github.com/apache/datasketches-cpp/issues/477

   
   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to