Skip to content

BUG: SIGABRT in quantiles_sketch::deserialize(): dereferencing empty std::optional (libc++ verbose_abort) #477

@MaheshGPai

Description

@MaheshGPai

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions