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)
Oct 15 2024, 6:34 PM
Unknown Object (File)
Sep 18 2024, 10:14 PM
Unknown Object (File)
Sep 12 2024, 8:35 AM
Unknown Object (File)
Sep 12 2024, 8:35 AM
Unknown Object (File)
Sep 12 2024, 8:35 AM
Unknown Object (File)
Sep 12 2024, 8:35 AM
Unknown Object (File)
Sep 12 2024, 7:44 AM
Unknown Object (File)
Aug 19 2024, 3:26 PM
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.