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)
Thu, Apr 18, 9:05 AM
Unknown Object (File)
Tue, Apr 16, 6:07 AM
Unknown Object (File)
Fri, Apr 12, 7:20 PM
Unknown Object (File)
Fri, Apr 12, 7:19 PM
Unknown Object (File)
Fri, Apr 12, 2:12 PM
Unknown Object (File)
Fri, Apr 12, 1:54 PM
Unknown Object (File)
Wed, Apr 10, 5:40 PM
Unknown Object (File)
Fri, Mar 22, 9:13 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33611
Build 30857: arc lint + arc unit

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.