Sanitizers on NetBSD require additional linkage:
- libutil for forkpty(3)
- libexecinfo for backtrace(3)
Sponsored by <The NetBSD Foundation>
Differential D41054
Teach clang/NetBSD about additional dependencies for sanitizers krytarowski on Dec 9 2017, 6:49 PM. Authored by
Details Sanitizers on NetBSD require additional linkage:
Sponsored by <The NetBSD Foundation>
Diff Detail
Event TimelineComment Actions I'm not really a fan of linking libutil into all binaries. Why is this code using forkpty in first place and not posix_openpt/grantpt? Comment Actions pid_t forkpty(int *amaster, char *name, struct termios *term, struct winsize *winp); We need to teach sanitizers how to mark as initialized structs passed to this function. Sanitizers are for development only, so it's the trade-off of linking with additional libraries. Comment Actions One problem with interceptors is that any sanitized binary looks (to a configure-like script) as if it implements forkpty. But an attempt to use forkpty without actually linking -lutil will fail at runtime, because interceptors are just wrappers. Comment Actions -lutil is just the same case as -lrt or -lm here. The potential problem with with autoconf and similar is the design problem, not NetBSD linking here with -lutil. Without this -lutil, every sanitizer with interceptors will generate spurious dlerror() errors for the lack of forkpty. Comment Actions Yes, I support adding -lutil - sorry I was not clear about that. By dlerror() errors, do you mean the warnings about missing interceptors that appear with verbosity=1 (non-fatal), or something else? Comment Actions In particular, this issue has been detected with dtls_test.c (MSan test), but it is valid to every program checking dlerror(). I've pluged more missing symbols through D41053, there are still few but I'm now busy with teaching sanitizers about all the NetBSD syscalls and all the NetBSD ioctls. This patch plugs backtrace(3) and forkpty(3) missing symbols. |