On Thu, 19 Mar 2026 17:11:43 +1100
David Gibson
The standard library assert(3), at least with glibc, hits our seccomp filter and dies with SIGSYS before it's able to print a message, making it near useless. Therefore, since 7a8ed9459dfe ("Make assertions actually useful") we've instead used our own implementation, named ASSERT().
This makes our code look slightly odd though - ASSERT() has the same overall effect as assert(), it's just a different implementation. More importantly this makes it awkward to share code between passt/pasta proper and things that compile in a more typical environment. We're going to want that for our upcoming dynamic configuration tool.
Address this by overriding the standard library's assert() implementation with our own, instead of giving ours its own name.
The standard assert() is supposed to be omitted if NDEBUG is defined, which ours doesn't do. Implement that as well, so ours doesn't unexpectedly differ. For the -DNDEBUG case we do this by *not* overriding assert(), since it will be a no-op anyway. This requires a few places to add a #include
to let us compile (albeit with warnings) when -DNDEBUG. Signed-off-by: David Gibson
Applied (just this patch). I fixed up some (expected) trivial conflicts in tcp_vu.c and udp_vu.c with "vu_common: Move iovec management into vu_collect()". -- Stefano