Page MenuHomeFreeBSD

libarchive: fix mismatch between library and test configuration
ClosedPublic

Authored by arichardson on Sep 17 2020, 5:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 17, 10:09 AM
Unknown Object (File)
Tue, Nov 11, 1:40 AM
Unknown Object (File)
Sun, Nov 9, 1:53 AM
Unknown Object (File)
Thu, Nov 6, 4:44 AM
Unknown Object (File)
Tue, Nov 4, 4:30 AM
Unknown Object (File)
Oct 20 2025, 6:05 AM
Unknown Object (File)
Oct 20 2025, 6:05 AM
Unknown Object (File)
Oct 19 2025, 12:52 AM
Subscribers

Details

Summary

I was investigating libarchive test failures on FreeBSD and it turns out
we get a reproducible SIGBUS for test_archive_m5, etc. Debugging this shows
that libarchive and the tests disagree when it comes to the definition of
archive_md5_ctx: libarchive assumes it's the OpenSSL type whereas the test
use the libmd type. The latter is not necessarily aligned enough to store
a pointer (16 bytes for CHERI RISC-V), so we were crashing when storing
EVP_MD_CTX* to an 8-byte-aligned archive_md5_ctx.

To avoid problems like this in the future, factor out the common compiler
flags into a Makefile.inc and include that from the tests Makefile.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

arichardson created this revision.

add missing .include <src.opts.mk>

LGTM, have you also sent a mail to mm@?

This revision is now accepted and ready to land.Sep 17 2020, 5:10 PM

LGTM, have you also sent a mail to mm@?

No, but I also submitted https://github.com/libarchive/libarchive/pull/1437 for some further sanity checks.