Bug 16377

Summary: AB-INT PTEST: libarchive ptest failure in libarchive_test (test_read_append_rpm_filter)
Product: [QA/Testing] Package Testing (ptest) Reporter: João Marcos Costa <joaomarcos.costa>
Component: ptestAssignee: Himani Barde <HimaniRamesh.Barde>
Status: IN PROGRESS REVIEW --- QA Contact:
Severity: normal    
Priority: Medium+ CC: pratik.farkase, randy.macleod, richard.purdie
Version: unspecified   
Target Milestone: 6.1 M3   
Hardware: x86   
OS: Multiple   
Whiteboard: AB-INT
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description João Marcos Costa 2026-07-29 14:25:00 UTC
https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/2008/steps/13/logs/stdio

Failed ptests:
{'libarchive': ['libarchive_test']}

qemuriscv64-ptest fedora44-vk-1

---
Totals:
  Tests run:              797
  Tests failed:             1
  Assertions checked:28458500
  Assertions failed:        1
  Skips reported:         237

Failing tests:
  229: test_read_append_rpm_filter (1 failures)

Details for failing tests: /tmp/libarchive_test.2026-07-28T11.50.40-000

FAIL: libarchive_test
---

Full logs at: https://valkyrie.yocto.io/pub/non-release/20260728-69/testresults/qemuriscv64-ptest/libarchive.log
Comment 1 João Marcos Costa 2026-07-31 08:38:30 UTC
https://autobuilder.yoctoproject.org/valkyrie/#/builders/61/builds/4145/steps/13/logs/stdio

Failed ptests:
{'libarchive': ['libarchive_test']}

qemuarm64-ptest stream10-vk-arm1
Comment 2 João Marcos Costa 2026-07-31 08:39:23 UTC
https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/2031/steps/13/logs/stdio

Failed ptests:
{'libarchive': ['libarchive_test']}

qemuriscv64-ptest debian12-vk-9
Comment 3 Himani Barde 2026-08-06 08:47:30 UTC
Root cause identified:
archive_read_append_filter() in libarchive 3.8.8 uses a name-based bidder lookup loop that can fail to locate the correct bidder due to a desync between the loop index and the bidder array. This causes test_read_append_rpm_filter to receive ARCHIVE_FATAL instead of ARCHIVE_OK.

Upstream fix: https://github.com/libarchive/libarchive/commit/50b585bb55484cdc70bd92852a477178dc43485c "append_filter: Use last bidder for filter" - Tobias Stoeckmann, 2026-08-02

The fix replaces the fragile name-based bidder lookup with a simple get_last_bidder() function that returns the most recently registered bidder.

Verified: Backported this patch to libarchive 3.8.9 recipe in OE-core. Patch applies cleanly and builds successfully for qemuarm64. The fixed code (get_last_bidder) is confirmed present in the compiled output.

Recommendation: Backport upstream commit 50b585bb to the libarchive recipe.
Comment 4 Himani Barde 2026-09-02 04:24:36 UTC
Patch submitted to the openembedded-core mailing list: https://lore.kernel.org/openembedded-core/?q=libarchive%3A%20backport

Subject: [PATCH] libarchive: backport fix for archive_read_append_filter test failure

The patch backports upstream commit 50b585bb ("append_filter: Use last bidder for filter") to the libarchive 3.8.9 recipe.

Awaiting review and merge into oe-core master.