You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs(security): bounds.md bad-run example is caught by libstdc++'s assertion, not ASan, on GCC 15+ #364
docs/security/bounds.md#check-before-the-access/1 fails the GCC 16 snippet run (local gcc:16, v0.5.0 release checks, #363): "bad run block wasn't caught by a sanitizer (exit -6)". libstdc++ 15+ enables _GLIBCXX_ASSERTIONS by default without optimization, so vector::operator[] asserts (__n < this->size()) before ASan sees the read. The example's point holds; only the mechanism differs. The enforced GCC 15/16 Linux CI jobs will hit it too.
Fix: index through the pointer and length a C interface would hand over (table.data()), so the read is unchecked on every library and ASan reports it, and say on the page that vector::operator[] itself is stopped by libstdc++'s assertion in unoptimized builds.
Activity
homer6 commentedon Nov 3, 2026
Delivered in #366.
What changed
bad runexample indexes through a pointer, so ASan reports it on every library; the page explains libstdc++'s default assertion.Why
homer6 commentedon Nov 3, 2026
Merged in #366 (c4093cf).
What changed
Why
Still open