diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-03-19 17:11:43 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-03-20 21:05:29 +0100 |
| commit | bc872d91765dfd6ff34b0e9a34bce410fac1cef3 (patch) | |
| tree | 83ea5562ad432cd853c5985bf2384a43c0c2bc33 /doc | |
| parent | 451fb7600b8dfdf6800abee613f2b4f026fbd150 (diff) | |
| download | passt-master.tar passt-master.tar.gz passt-master.tar.bz2 passt-master.tar.lz passt-master.tar.xz passt-master.tar.zst passt-master.zip | |
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 <assert.h> to let us compile (albeit with warnings) when
-DNDEBUG.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
[sbrivio: Fix some conflicts and missing conversions as a result of
applying "vu_common: Move iovec management into vu_collect()" first]
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions
