Bug 294577 - lib/libarchive/functional_test tests failing in CI
Summary: lib/libarchive/functional_test tests failing in CI
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: tests (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Kyle Evans
URL: https://ci.freebsd.org/job/FreeBSD-ma...
Keywords: regression
Depends on:
Blocks:
 
Reported: 2026-04-16 21:26 UTC by Siva Mahadevan
Modified: 2026-06-02 17:29 UTC (History)
6 users (show)

See Also:
des: mfc-stable15+
des: mfc-stable14+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Siva Mahadevan freebsd_committer freebsd_triage 2026-04-16 21:26:35 UTC
The following tests from the 'lib/libarchive/functional_test' testsuite are failing in CI:

test_archive_string_conversion_fail_c
test_archive_string_conversion_fail_latin1
test_write_disk

For example:

lib/libarchive/functional_test:test_write_disk
Result:     failed: atf-check failed; see the output of the test for details

Original stderr
---------------

Fail: program did not exit cleanly
stdout:

If tests fail or crash, details will be in:
   /tmp/kyua.JOFkWP/2028/work/libarchive_test.2026-04-13T16.28.42-000

Reference files will be read from: /usr/tests/lib/libarchive
Exercising: libarchive 3.8.7 zlib/1.3.2 liblzma/5.8.3 libzstd/1.5.7 openssl/3.5.6 libb2/bundled
548: test_write_disk
/usr/src/contrib/libarchive/libarchive/test/test_write_disk.c:246: ARCHIVE_FAILED != archive_write_header(ad, ae)
   Description: Test failing to create parent directory with /../

stderr:
 *** forcing core dump so failure can be debugged ***

 
This is reproducible with Bricoler (master-python branch) with this command:

bricoler freebsd-regression-test-suite --freebsd-src-git-checkout/url=/usr/src --freebsd-src-git-checkout/branch= --freebsd-regression-test-suite/memory=3072 --freebsd-regression-test-suite/ncpus=2 --freebsd-regression-test-suite/parallelism=1 --freebsd-regression-test-suite/tests='lib/libarchive/functional_test'

mm@, these tests are failing since your commit https://cgit.freebsd.org/src/commit/?id=f2cd95a372000681bafe284df6ba857d5c2541c2 (Update vendor/libarchive to 3.8.7). Please triage as necessary.
Comment 1 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2026-04-17 13:20:02 UTC
548: test_write_disk
/usr/src/contrib/libarchive/libarchive/test/test_write_disk.c:246: ARCHIVE_FAILED != archive_write_header(ad, ae)
   Description: Test failing to create parent directory with /../

This is expected if the test case runs as root.  The pull request that introduced this test case also added code to make tests run as an unprivileged user, but that code is not enabled on FreeBSD because lib/libarchive/config_freebsd.h has not been updated in a very long time.
Comment 2 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2026-04-17 16:21:23 UTC
https://reviews.freebsd.org/D56468 should fix the test_write_disk issue, I have no idea what's causing the string conversion issues though.
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2026-04-17 18:32:40 UTC
Submitted upstream weeks ago...
https://github.com/libarchive/libarchive/issues/2902
Comment 4 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2026-04-17 21:23:40 UTC
(In reply to Daniel Engberg from comment #3)

Opening an issue upstream is not going to help.  They already test (and in part develop) on FreeBSD, and these tests don't fail, even on FreeBSD, when libarchive is built independently.  The problem is in our integration.
Comment 5 commit-hook freebsd_committer freebsd_triage 2026-04-18 08:26:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=05bbe5e3883492dd2afa52039da1fac45c5059a0

commit 05bbe5e3883492dd2afa52039da1fac45c5059a0
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-04-18 08:25:31 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-04-18 08:25:31 +0000

    libarchive: Update configuration

    PR:             294577
    MFC after:      1 week
    Reviewed by:    mm
    Differential Revision:  https://reviews.freebsd.org/D56468

 lib/libarchive/config_freebsd.h | 126 ++++++++++++++++++++++++++++------------
 1 file changed, 89 insertions(+), 37 deletions(-)
Comment 6 Daniel Engberg freebsd_committer freebsd_triage 2026-04-18 09:34:18 UTC
Digging into this a bit more show that it's happy with GNU libiconv
Comment 7 commit-hook freebsd_committer freebsd_triage 2026-04-22 13:44:44 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=b9e19901eedfdde9b7092b3338e6c1b8737aa41e

commit b9e19901eedfdde9b7092b3338e6c1b8737aa41e
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-04-18 08:25:31 +0000
Commit:     Martin Matuska <mm@FreeBSD.org>
CommitDate: 2026-04-22 13:43:33 +0000

    libarchive: Update configuration

    PR:             294577
    MFC after:      1 week
    Reviewed by:    mm
    Differential Revision:  https://reviews.freebsd.org/D56468

    (cherry picked from commit 05bbe5e3883492dd2afa52039da1fac45c5059a0)

 lib/libarchive/config_freebsd.h | 126 ++++++++++++++++++++++++++++------------
 1 file changed, 89 insertions(+), 37 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2026-04-23 09:45:21 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=d763fce2ec97c1654d38fe9ea5e718030cc1fbc0

commit d763fce2ec97c1654d38fe9ea5e718030cc1fbc0
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-04-18 08:25:31 +0000
Commit:     Martin Matuska <mm@FreeBSD.org>
CommitDate: 2026-04-23 09:44:14 +0000

    libarchive: Update configuration

    PR:             294577
    MFC after:      1 week
    Reviewed by:    mm
    Differential Revision:  https://reviews.freebsd.org/D56468

    (cherry picked from commit 05bbe5e3883492dd2afa52039da1fac45c5059a0)

 lib/libarchive/config_freebsd.h | 126 ++++++++++++++++++++++++++++------------
 1 file changed, 89 insertions(+), 37 deletions(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2026-04-23 10:34:27 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=170f7d2168a227ea1fb58f20fe543ac22d4635f2

commit 170f7d2168a227ea1fb58f20fe543ac22d4635f2
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-04-18 08:25:31 +0000
Commit:     Martin Matuska <mm@FreeBSD.org>
CommitDate: 2026-04-23 09:45:52 +0000

    libarchive: Update configuration

    PR:             294577
    MFC after:      1 week
    Reviewed by:    mm
    Differential Revision:  https://reviews.freebsd.org/D56468

    (cherry picked from commit 05bbe5e3883492dd2afa52039da1fac45c5059a0)

 lib/libarchive/config_freebsd.h | 124 ++++++++++++++++++++++++++++------------
 1 file changed, 89 insertions(+), 35 deletions(-)
Comment 10 Mark Johnston freebsd_committer freebsd_triage 2026-05-01 15:00:45 UTC
The test case effectively boils down to BSD iconv(3) not returning an error when converting the string "при" from UTF-8 to US-ASCII.
Comment 11 Kyle Evans freebsd_committer freebsd_triage 2026-05-01 16:50:32 UTC
(In reply to Mark Johnston from comment #10)

If this is the only remaining failure mode, I will take this (patch incoming).
Comment 12 Kyle Evans freebsd_committer freebsd_triage 2026-05-01 17:23:20 UTC
The stack ending at https://reviews.freebsd.org/D56758 should address this, but I haven't done any test qualification at the moment -- we have enough of our iconv use that we should probably do a full test run with this default switch.
Comment 13 Mark Johnston freebsd_committer freebsd_triage 2026-05-01 19:49:26 UTC
(In reply to Kyle Evans from comment #12)
It fixes the libarchive failures, thanks.  I ran the full test suite and don't see any new failures.
Comment 14 Mark Johnston freebsd_committer freebsd_triage 2026-05-20 16:44:27 UTC
Review appreciated: https://github.com/libarchive/libarchive/pull/3056
Comment 15 Enji Cooper freebsd_committer freebsd_triage 2026-05-21 03:49:54 UTC
(In reply to Mark Johnston from comment #14)

The change was accepted upstream and can be merged back into :main.
Comment 16 commit-hook freebsd_committer freebsd_triage 2026-05-27 13:17:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=bd15d6ef126ee4c0eac931117f6bbbf6f9a3fc72

commit bd15d6ef126ee4c0eac931117f6bbbf6f9a3fc72
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-05-20 16:39:40 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-05-27 13:10:57 +0000

    libarchive: Force GNU iconv compatibility on FreeBSD

    When libarchive is compiled with FreeBSD's native iconv instead of
    libiconv, as happens with libarchive in the base system, we need to
    configure iconv(3) to handle invalid sequences by returning -1, as
    iconv_strncat_in_locale() assumes GNU iconv semantics.

    This corresponds to upstream PR 3056.

    PR:             294577
    MFC after:      1 week

 contrib/libarchive/libarchive/archive_string.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Comment 17 commit-hook freebsd_committer freebsd_triage 2026-06-02 16:43:05 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e6470ed3d59b5c36262a9cdb76b71a7ad25d173b

commit e6470ed3d59b5c36262a9cdb76b71a7ad25d173b
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-05-20 16:39:40 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-06-02 16:41:37 +0000

    libarchive: Force GNU iconv compatibility on FreeBSD

    When libarchive is compiled with FreeBSD's native iconv instead of
    libiconv, as happens with libarchive in the base system, we need to
    configure iconv(3) to handle invalid sequences by returning -1, as
    iconv_strncat_in_locale() assumes GNU iconv semantics.

    This corresponds to upstream PR 3056.

    PR:             294577
    MFC after:      1 week

    (cherry picked from commit bd15d6ef126ee4c0eac931117f6bbbf6f9a3fc72)

 contrib/libarchive/libarchive/archive_string.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Comment 18 commit-hook freebsd_committer freebsd_triage 2026-06-02 16:43:08 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5fd06985f8f0b8591866498dc59cdfa3d82c6e78

commit 5fd06985f8f0b8591866498dc59cdfa3d82c6e78
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-05-20 16:39:40 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-06-02 16:42:02 +0000

    libarchive: Force GNU iconv compatibility on FreeBSD

    When libarchive is compiled with FreeBSD's native iconv instead of
    libiconv, as happens with libarchive in the base system, we need to
    configure iconv(3) to handle invalid sequences by returning -1, as
    iconv_strncat_in_locale() assumes GNU iconv semantics.

    This corresponds to upstream PR 3056.

    PR:             294577
    MFC after:      1 week

    (cherry picked from commit bd15d6ef126ee4c0eac931117f6bbbf6f9a3fc72)

 contrib/libarchive/libarchive/archive_string.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)