NetBSD Problem Report #60560

From gson@gson.org  Sat Aug  8 16:03:56 2026
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR2" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 02AF81A923B
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  8 Aug 2026 16:03:55 +0000 (UTC)
Message-Id: <20260808160351.74FA4254585@guava.gson.org>
Date: Sat,  8 Aug 2026 19:03:51 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: libarchive tests are failing
X-Send-Pr-Version: 3.95
X-From4GNATS: "Andreas Gustafsson via gnats" <gnats-admin@NetBSD.org>

>Number:         60560
>Category:       lib
>Synopsis:       libarchive tests are failing
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          suspended
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 08 16:05:00 +0000 2026
>Closed-Date:    
>Last-Modified:  Fri Aug 21 22:15:04 +0000 2026
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date >= 2026.05.03.14.40.12
>Organization:

>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

The lib/libarchive/t_libarchive:libarchive test case started failing
with the import of libarchive-3.8.7 on 2026.05.03.14.40.12.  This was
not reported by the TNF i386 or amd64 testbed because the test is
skipped due to requiring more memory than the test VMs are configured
with, but it does fail on the evbarm-aarch64 testbed and on real i386
and amd64 hardware.

Here is the output from a couple of recent failed test runs:

  https://releng.netbsd.org/b5reports/evbarm-aarch64/2026/2026.08.07.14.31.36/test.html#lib_libarchive_t_libarchive_libarchive
  https://www.gson.org/netbsd/bugs/build/amd64-baremetal/2026/2026.08.02.16.45.28/test.html#lib_libarchive_t_libarchive_libarchive

>How-To-Repeat:

Run the ATF tests on a system with at least 400 MB of free user memory.

>Fix:

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: christos@NetBSD.org
State-Changed-When: Thu, 20 Aug 2026 13:08:10 -0400
State-Changed-Why:
It appears that our iconv(3) does not fail converting UTF-8 -> MBS as expected.


State-Changed-From-To: feedback->suspended
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Fri, 21 Aug 2026 17:38:14 +0000
State-Changed-Why:
Upstream bug, let's wait for upstream to acknowledge before any further
action here (though we could mark it xfail for now):

https://github.com/libarchive/libarchive/issues/3413

libarchive assumes iconv() behaves in a nonstandard way for valid inputs
that can't be represented in the output.


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60560 CVS commit: src/external/bsd/libarchive/dist/libarchive
Date: Fri, 21 Aug 2026 22:12:25 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Fri Aug 21 22:12:25 UTC 2026

 Modified Files:
 	src/external/bsd/libarchive/dist/libarchive: archive_string.c

 Log Message:
 libarchive: Patch iconv() use to handle POSIX semantics.

 Previously it assumed nonstandard GNU semantics, causing tests to
 fail on NetBSD:

 /usr/src/external/bsd/libarchive/dist/libarchive/test/test_archive_string_conversion.c:950:
 -1 != r
       -1=-1 (0xffffffffffffffff, 01777777777777777777777)
       r=0 (0x0, 00)
 /usr/src/external/bsd/libarchive/dist/libarchive/test/test_archive_string_conversion.c:951:
 0 != mstr.aes_set & AES_SET_MBS
       0=0 (0x0, 00)
       mstr.aes_set & AES_SET_MBS=1 (0x1, 01)

 Upstream bug report:
 Issue #3413: test_archive_string_conversion_fail_c failure despite
 correct iconv(3)
 https://github.com/libarchive/libarchive/issues/3413

 Patch proposed upstream:
 Pull request #3416: Treat non-identical conversions in iconv as
 failure.
 https://github.com/libarchive/libarchive/pull/3416

 PR lib/60560: libarchive tests are failing


 To generate a diff of this commit:
 cvs rdiff -u -r1.1.1.8 -r1.2 \
     src/external/bsd/libarchive/dist/libarchive/archive_string.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60560 CVS commit: src/tests/lib/libarchive
Date: Fri, 21 Aug 2026 22:12:42 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Fri Aug 21 22:12:42 UTC 2026

 Modified Files:
 	src/tests/lib/libarchive: Makefile

 Log Message:
 libarchive: Avoid collision with LIBARCHIVE variable in makefile.

 It was both the path to the .a file for DPADD, and the path to the
 source directory.  Can't be both, and the source directory is purely
 local while the .a file is used in other makefiles, so let's call the
 source directory LIBARCHIVEDIR instead.

 Found while trying to diagnose:

 PR lib/60560: libarchive tests are failing


 To generate a diff of this commit:
 cvs rdiff -u -r1.20 -r1.21 src/tests/lib/libarchive/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60560 CVS commit: src
Date: Fri, 21 Aug 2026 22:13:35 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Fri Aug 21 22:13:35 UTC 2026

 Modified Files:
 	src/distrib/sets/lists/tests: mi
 	src/tests/lib/libarchive: Makefile

 Log Message:
 libarchive: Install some missing test data files.

 PR lib/60560: libarchive tests are failing


 To generate a diff of this commit:
 cvs rdiff -u -r1.1425 -r1.1426 src/distrib/sets/lists/tests/mi
 cvs rdiff -u -r1.21 -r1.22 src/tests/lib/libarchive/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

 Test 51 fails because iconv() returns 0 where it should fail converting
 UTF-8 to MBS.

 in the libarchive test directory run:

 ./h_libarchive -r $PWD 51

 the log file it produces says:

 test_archive_string_conversion_fail_c

 /usr/src/external/bsd/libarchive/dist/libarchive/test/test_archive_string_convers
 ion.c:950: -1 != r
       -1=-1 (0xffffffffffffffff, 01777777777777777777777)
       r=0 (0x0, 00)
 /usr/src/external/bsd/libarchive/dist/libarchive/test/test_archive_string_convers
 ion.c:951: 0 != mstr.aes_set & AES_SET_MBS
       0=0 (0x0, 00)
       mstr.aes_set & AES_SET_MBS=1 (0x1, 01)

 the test is:

         /* UTF-8 to MBS should fail.  */
         {
                 struct archive_mstring mstr;
                 memset(&mstr, 0, sizeof(mstr));
                 assertEqualInt(6,
                     archive_mstring_copy_utf8(&mstr, utf8_string));
                 r = archive_mstring_get_mbs_l(a, &mstr, &p, &len, NULL);
 -->             assertEqualInt(-1, r);
 this returns 0
                 assertEqualInt(0, mstr.aes_set & AES_SET_MBS);
                 archive_mstring_clean(&mstr);
         }

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.