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)
Sat, Oct 11, 8:01 PM
Unknown Object (File)
Thu, Oct 9, 12:45 AM
Unknown Object (File)
Sep 14 2025, 3:09 PM
Unknown Object (File)
Sep 7 2025, 11:52 AM
Unknown Object (File)
Sep 7 2025, 11:38 AM
Unknown Object (File)
Aug 17 2025, 6:25 PM
Unknown Object (File)
Aug 4 2025, 1:16 AM
Unknown Object (File)
Jul 29 2025, 3:03 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.