GNU bug report logs - #45716
Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Stefan <stefan-guix@HIDDEN>; dated Thu, 7 Jan 2021 15:39:01 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 45716 <at> debbugs.gnu.org:


Received: (at 45716) by debbugs.gnu.org; 11 Jan 2021 13:30:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 11 08:30:34 2021
Received: from localhost ([127.0.0.1]:56108 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kyxHG-0006VX-Ef
	for submit <at> debbugs.gnu.org; Mon, 11 Jan 2021 08:30:34 -0500
Received: from eggs.gnu.org ([209.51.188.92]:55934)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1kyxHE-0006Ov-KY
 for 45716 <at> debbugs.gnu.org; Mon, 11 Jan 2021 08:30:33 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36693)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1kyxH8-0006L5-H1; Mon, 11 Jan 2021 08:30:26 -0500
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57940 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1kyxGr-0001Ay-Ok; Mon, 11 Jan 2021 08:30:24 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: Bug in =?utf-8?Q?=E2=80=98network-interface-names=E2=80=99?=
 when building guix for aarch64 on x86_64.
References: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@HIDDEN>
 <5A46F4E0-9823-4614-A7BC-865F9D7C0FB7@HIDDEN>
 <20210108040445.1444c372@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 22 =?utf-8?Q?Niv=C3=B4se?= an 229 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Mon, 11 Jan 2021 14:30:08 +0100
In-Reply-To: <20210108040445.1444c372@HIDDEN> (Danny Milosavljevic's
 message of "Fri, 8 Jan 2021 04:04:45 +0100")
Message-ID: <87a6tfeh3z.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 45716
Cc: Stefan <stefan-guix@HIDDEN>, 45716 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Danny,

Danny Milosavljevic <dannym@HIDDEN> skribis:

>>(define ifreq-struct-size
>>  ;; 'struct ifreq' begins with an array of IF_NAMESIZE bytes containing =
the
>>  ;; interface name (nul-terminated), followed by a bunch of stuff.  This=
 is
>>  ;; its size in bytes.
>>  (if (=3D 8 (sizeof '*))
>>      40
>>      32))
>
> I think that should rather be (sizeof* '*) instead of (sizeof '*).  Ludo?

As you found out, it makes no difference.  What changes is that
=E2=80=98sizeof*=E2=80=99 is a compile-time computation (but it honors cros=
s-compilation
targets) whereas =E2=80=98sizeof=E2=80=99 is a call made at run time.

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#45716; Package guix. Full text available.

Message received at 45716 <at> debbugs.gnu.org:


Received: (at 45716) by debbugs.gnu.org; 11 Jan 2021 13:28:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 11 08:28:33 2021
Received: from localhost ([127.0.0.1]:56104 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kyxFI-0005tv-UG
	for submit <at> debbugs.gnu.org; Mon, 11 Jan 2021 08:28:33 -0500
Received: from eggs.gnu.org ([209.51.188.92]:55358)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1kyxFH-0005th-1H
 for 45716 <at> debbugs.gnu.org; Mon, 11 Jan 2021 08:28:31 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36679)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1kyxF9-0005zq-Oy; Mon, 11 Jan 2021 08:28:24 -0500
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57938 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1kyxF8-0006yI-9Z; Mon, 11 Jan 2021 08:28:23 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Stefan <stefan-guix@HIDDEN>
Subject: Re: gnu: qemu: Fix =?utf-8?Q?ioclt=28=E2=80=A6=2C?= SIOCGIFCONF,
 =?utf-8?Q?=E2=80=A6=29?= for emulated 64 bit architectures.
References: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@HIDDEN>
 <5A46F4E0-9823-4614-A7BC-865F9D7C0FB7@HIDDEN>
 <20210108040445.1444c372@HIDDEN>
 <E2AE7B8A-53B0-4C47-B05F-12D4055FE297@HIDDEN>
 <18056543-1468-4B69-BFA8-F28CCA234168@HIDDEN>
 <4928FA00-C99D-4C66-877E-308D0B8F3228@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 22 =?utf-8?Q?Niv=C3=B4se?= an 229 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Mon, 11 Jan 2021 14:28:21 +0100
In-Reply-To: <4928FA00-C99D-4C66-877E-308D0B8F3228@HIDDEN> (Stefan's
 message of "Sat, 9 Jan 2021 19:01:39 +0100")
Message-ID: <87eeireh6y.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 45716
Cc: Danny Milosavljevic <dannym@HIDDEN>, 45716 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Stefan,

Stefan <stefan-guix@HIDDEN> skribis:

> * gnu/packages/virtualization.scm (qemu): Add a snippet to fix a bug in t=
he
> do_ioctl_ifconf() function of qemu to make ioclt(=E2=80=A6, SIOCGIFCONF, =
=E2=80=A6) work for
> emulated 64 bit architectures.
>
> The sizeof(struct ifreq) is 40 for 64 bit and 32 for 32 bit architectures.
> This structure contains a union of other structures, of which struct ifmap
> is the biggest for 64 bit architectures. Calling ioclt(=E2=80=A6, SIOCGIF=
CONF, =E2=80=A6)
> fills a struct sockaddr of that union, and do_ioctl_ifconf() only conside=
red
> that struct sockaddr for the size of the union, which has the same size as
> struct ifmap on 32 bit architectures. So do_ioctl_ifconf() assumed a wrong
> size of 32 for struct ifreq instead of the correct size of 40 on 64 bit
> architectures.
>
> The fix makes do_ioctl_ifconf() handle struct ifmap as the biggest part of
> the union, treating struct ifreq with the correct size.
>
> This fixes (@ (guix build syscalls) network-interface-names) when used in
> emulated 64 bit architectures.

Woow, good catch!

> +              (modules '((guix build utils)))
> +              (snippet
> +               '(begin
> +                  (substitute* '("linux-user/syscall.c")
> +                    (("^([[:blank:]]*)const argtype ifreq_arg_type.*$" l=
ine indent)
> +                     (string-append line indent
> +                                    "const argtype ifreq_max_type[] =3D =
{ MK_STRUCT(STRUCT_ifmap_ifreq) };\n"))
> +                    (("^([[:blank:]]*)target_ifreq_size[[:blank:]]=3D.*$=
" _ indent)
> +                     (string-append indent "target_ifreq_size =3D thunk_=
type_size(ifreq_max_type, 0);")))
> +                  #t))))

Could you move the explanation as a comment above the =E2=80=98substitute*=
=E2=80=99
form, and/or link to the upstream bug report/discussion/submission?

Thank you!

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#45716; Package guix. Full text available.

Message received at 45716 <at> debbugs.gnu.org:


Received: (at 45716) by debbugs.gnu.org; 9 Jan 2021 18:01:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 09 13:01:49 2021
Received: from localhost ([127.0.0.1]:52589 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kyIYf-0003yz-D2
	for submit <at> debbugs.gnu.org; Sat, 09 Jan 2021 13:01:49 -0500
Received: from smtpout2.vodafonemail.de ([145.253.239.133]:47312)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1kyIYa-0003ya-1T
 for 45716 <at> debbugs.gnu.org; Sat, 09 Jan 2021 13:01:47 -0500
Received: from smtp.vodafone.de (unknown [10.2.0.35])
 by smtpout2.vodafonemail.de (Postfix) with ESMTP id 9EDEA123D5D;
 Sat,  9 Jan 2021 19:01:37 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de;
 s=vfde-smtpout-mb-15sep; t=1610215297;
 bh=ZQbCkhMMgd2pE5113y3hfcqpUn3rqaVP/BBbgnifx4k=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To;
 b=H9KEWYYbCR9hYJScSSwJwlmRnrIwPtdiTkjU1E4Q7CFVoXXP+swFhKvse17deAK4H
 O8/Q9cBClL13zvKz1mcviQajc0GZKpKljwBRlDRFCJTJuMESduhsB3kpToK1mRC5Dc
 ue7f4ombQaf5vD7haLiWRp+dhDicjCyfmtXsameg=
Received: from macbook-pro.kuh-wiese.my-router.de
 (dslb-002-206-141-230.002.206.pools.vodafone-ip.de [2.206.141.230])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by smtp.vodafone.de (Postfix) with ESMTPSA id 5F2AF14024E;
 Sat,  9 Jan 2021 18:01:37 +0000 (UTC)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: =?utf-8?Q?gnu=3A_qemu=3A_Fix_ioclt=28=E2=80=A6=2C_SIOCGIFCONF=2C?=
 =?utf-8?Q?_=E2=80=A6=29_for_emulated_64_bit_architectures=2E?=
From: Stefan <stefan-guix@HIDDEN>
In-Reply-To: <18056543-1468-4B69-BFA8-F28CCA234168@HIDDEN>
Date: Sat, 9 Jan 2021 19:01:39 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <4928FA00-C99D-4C66-877E-308D0B8F3228@HIDDEN>
References: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@HIDDEN>
 <5A46F4E0-9823-4614-A7BC-865F9D7C0FB7@HIDDEN>
 <20210108040445.1444c372@HIDDEN>
 <E2AE7B8A-53B0-4C47-B05F-12D4055FE297@HIDDEN>
 <18056543-1468-4B69-BFA8-F28CCA234168@HIDDEN>
To: Danny Milosavljevic <dannym@HIDDEN>
X-Mailer: Apple Mail (2.3124)
X-purgate-type: clean
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate: This mail is considered clean (visit http://www.eleven.de for
 further information)
X-purgate: clean
X-purgate-size: 2430
X-purgate-ID: 155817::1610215297-0000239E-006B97E0/0/0
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45716
Cc: ludo@HIDDEN, 45716 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

* gnu/packages/virtualization.scm (qemu): Add a snippet to fix a bug in =
the
do_ioctl_ifconf() function of qemu to make ioclt(=E2=80=A6, SIOCGIFCONF, =
=E2=80=A6) work for
emulated 64 bit architectures.

The sizeof(struct ifreq) is 40 for 64 bit and 32 for 32 bit =
architectures.
This structure contains a union of other structures, of which struct =
ifmap
is the biggest for 64 bit architectures. Calling ioclt(=E2=80=A6, =
SIOCGIFCONF, =E2=80=A6)
fills a struct sockaddr of that union, and do_ioctl_ifconf() only =
considered
that struct sockaddr for the size of the union, which has the same size =
as
struct ifmap on 32 bit architectures. So do_ioctl_ifconf() assumed a =
wrong
size of 32 for struct ifreq instead of the correct size of 40 on 64 bit
architectures.

The fix makes do_ioctl_ifconf() handle struct ifmap as the biggest part =
of
the union, treating struct ifreq with the correct size.

This fixes (@ (guix build syscalls) network-interface-names) when used =
in
emulated 64 bit architectures.
---
 gnu/packages/virtualization.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/virtualization.scm =
b/gnu/packages/virtualization.scm
index 10eae8ea7d..f82a19ecf3 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -140,7 +140,17 @@
                (sha256
                 (base32
                  =
"1rd41wwlvp0vpialjp2czs6i3lsc338xc72l3zkbb7ixjfslw5y9"))
-              (patches (search-patches =
"qemu-build-info-manual.patch"))))
+              (patches (search-patches "qemu-build-info-manual.patch"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (substitute* '("linux-user/syscall.c")
+                    (("^([[:blank:]]*)const argtype ifreq_arg_type.*$" =
line indent)
+                     (string-append line indent
+                                    "const argtype ifreq_max_type[] =3D =
{ MK_STRUCT(STRUCT_ifmap_ifreq) };\n"))
+                    (("^([[:blank:]]*)target_ifreq_size[[:blank:]]=3D.*$"=
 _ indent)
+                     (string-append indent "target_ifreq_size =3D =
thunk_type_size(ifreq_max_type, 0);")))
+                  #t))))
      (outputs '("out" "doc"))            ;4.7 MiB of HTML docs
      (build-system gnu-build-system)
      (arguments
--=20
2.29.2




Information forwarded to bug-guix@HIDDEN:
bug#45716; Package guix. Full text available.

Message received at 45716 <at> debbugs.gnu.org:


Received: (at 45716) by debbugs.gnu.org; 8 Jan 2021 23:28:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 08 18:28:17 2021
Received: from localhost ([127.0.0.1]:50901 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ky1B3-0007gG-JD
	for submit <at> debbugs.gnu.org; Fri, 08 Jan 2021 18:28:17 -0500
Received: from smtpout2.vodafonemail.de ([145.253.239.133]:47102)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1ky1B1-0007g1-6H
 for 45716 <at> debbugs.gnu.org; Fri, 08 Jan 2021 18:28:15 -0500
Received: from smtp.vodafone.de (unknown [10.2.0.34])
 by smtpout2.vodafonemail.de (Postfix) with ESMTP id D3136123504;
 Sat,  9 Jan 2021 00:28:08 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de;
 s=vfde-smtpout-mb-15sep; t=1610148488;
 bh=9+ibi5SHT8kkRRZSH11WJ1dHA1dvnIZZexgM5IBcI0w=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To;
 b=TU56NSdEstoqz85X2HNXCJhYEFQWuaRMkgq6RAHaEPMOF7B3WwzUDmIpTP7QvOJDA
 9byPPFC+hF0WIaFw/VmMOq/kdHRfWAZJkhyDWgYhDXNS4/xTRR+FlEEPD+1QA4ilXY
 VQhRkz+9FsLWicQrNSoGCU7tg5nHU0Lj4o4y5gLw=
Received: from macbook-pro.kuh-wiese.my-router.de
 (dslb-002-206-141-230.002.206.pools.vodafone-ip.de [2.206.141.230])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by smtp.vodafone.de (Postfix) with ESMTPSA id 9269E14103F;
 Fri,  8 Jan 2021 23:28:08 +0000 (UTC)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: =?utf-8?Q?Re=3A_Bug_in_=E2=80=98network-interface-names=E2=80=99?=
 =?utf-8?Q?_when_building_guix_for_aarch64_on_x86=5F64=2E?=
From: Stefan <stefan-guix@HIDDEN>
In-Reply-To: <E2AE7B8A-53B0-4C47-B05F-12D4055FE297@HIDDEN>
Date: Sat, 9 Jan 2021 00:28:07 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <18056543-1468-4B69-BFA8-F28CCA234168@HIDDEN>
References: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@HIDDEN>
 <5A46F4E0-9823-4614-A7BC-865F9D7C0FB7@HIDDEN>
 <20210108040445.1444c372@HIDDEN>
 <E2AE7B8A-53B0-4C47-B05F-12D4055FE297@HIDDEN>
To: Danny Milosavljevic <dannym@HIDDEN>
X-Mailer: Apple Mail (2.3124)
X-purgate-type: clean
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate: This mail is considered clean (visit http://www.eleven.de for
 further information)
X-purgate: clean
X-purgate-size: 115
X-purgate-ID: 155817::1610148488-00003440-53A6CDBA/0/0
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45716
Cc: ludo@HIDDEN, 45716 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi!

I think I found the root cause of this issue in qemu. I'm about to =
prepare a patch.


Bye

Stefan=




Information forwarded to bug-guix@HIDDEN:
bug#45716; Package guix. Full text available.

Message received at 45716 <at> debbugs.gnu.org:


Received: (at 45716) by debbugs.gnu.org; 8 Jan 2021 16:47:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 08 11:47:13 2021
Received: from localhost ([127.0.0.1]:50510 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kxuuu-0004Di-Rj
	for submit <at> debbugs.gnu.org; Fri, 08 Jan 2021 11:47:13 -0500
Received: from smtpout2.vodafonemail.de ([145.253.239.133]:59614)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1kxuus-0004DT-I4
 for 45716 <at> debbugs.gnu.org; Fri, 08 Jan 2021 11:47:11 -0500
Received: from smtp.vodafone.de (unknown [10.2.0.33])
 by smtpout2.vodafonemail.de (Postfix) with ESMTP id 113A5120A86;
 Fri,  8 Jan 2021 17:47:04 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de;
 s=vfde-smtpout-mb-15sep; t=1610124424;
 bh=ZZB5hwGSIG7cA70QGVMJZ2GkbMBt+SbMxi/tRukpPfY=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To;
 b=GkrLUh58FOjllOLDvDiqRSGnpdPXIIMwaM8kaZWKJDjXVtuSY7NwcDD4tpg+kAOZ1
 OhaWTO+Av8pPmc0KxMSUsn+rHXu1hKrpkKQC+apTKXTh+D0c0W0YfqQ64ZwX68CbdI
 0HKcS2dFdhQWt5+xApZZ/YAnuXtW15RrxaN7yvgQ=
Received: from macbook-pro.kuh-wiese.my-router.de
 (dslb-002-206-141-230.002.206.pools.vodafone-ip.de [2.206.141.230])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by smtp.vodafone.de (Postfix) with ESMTPSA id CB72E1420F0;
 Fri,  8 Jan 2021 16:47:03 +0000 (UTC)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: =?utf-8?Q?Re=3A_Bug_in_=E2=80=98network-interface-names=E2=80=99?=
 =?utf-8?Q?_when_building_guix_for_aarch64_on_x86=5F64=2E?=
From: Stefan <stefan-guix@HIDDEN>
In-Reply-To: <20210108040445.1444c372@HIDDEN>
Date: Fri, 8 Jan 2021 17:47:03 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <E2AE7B8A-53B0-4C47-B05F-12D4055FE297@HIDDEN>
References: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@HIDDEN>
 <5A46F4E0-9823-4614-A7BC-865F9D7C0FB7@HIDDEN>
 <20210108040445.1444c372@HIDDEN>
To: Danny Milosavljevic <dannym@HIDDEN>
X-Mailer: Apple Mail (2.3124)
X-purgate-type: clean
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate: This mail is considered clean (visit http://www.eleven.de for
 further information)
X-purgate: clean
X-purgate-size: 441
X-purgate-ID: 155817::1610124423-00005EB2-374D4459/0/0
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45716
Cc: ludo@HIDDEN, 45716 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi!

> I think that should rather be (sizeof* '*) instead of (sizeof '*).  =
Ludo?

For aarch64 I tried using =E2=80=98sizeof*=E2=80=99 instead of =
=E2=80=98sizeof=E2=80=99 in =E2=80=98ifreq-struct-size=E2=80=99, but =
this makes no different at all. Well, pointers have to be 8 bytes long =
on x86_64 and aarch64, so this was expected. However, it should make a =
difference for armhf, but I didn't try that.


Bye

Stefan=




Information forwarded to bug-guix@HIDDEN:
bug#45716; Package guix. Full text available.

Message received at 45716 <at> debbugs.gnu.org:


Received: (at 45716) by debbugs.gnu.org; 8 Jan 2021 13:33:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 08 08:33:34 2021
Received: from localhost ([127.0.0.1]:49506 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kxrtW-0007P4-DW
	for submit <at> debbugs.gnu.org; Fri, 08 Jan 2021 08:33:34 -0500
Received: from smtpout2.vodafonemail.de ([145.253.239.133]:59818)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1kxrtT-0007Op-VK
 for 45716 <at> debbugs.gnu.org; Fri, 08 Jan 2021 08:33:32 -0500
Received: from smtp.vodafone.de (unknown [10.2.0.35])
 by smtpout2.vodafonemail.de (Postfix) with ESMTP id 5C61E1202BC;
 Fri,  8 Jan 2021 14:33:26 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de;
 s=vfde-smtpout-mb-15sep; t=1610112806;
 bh=YlrNtZYthaYb6YtYqdPj4SF9455TOHBh9ZzWuVsQJaA=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To;
 b=XYkhXgUoTdwEZ9izX6Jz89/zr8mfcDXJmpWO6vWFql2kvgVfL2nJbL2HOcc1wjZlH
 fOAqPvMyx7qJ+FZKZlgJ7iREZv/bHprjoYvxMkXFKxgWmeS8qghRqNj4NdQHf2sgSp
 tu+L64OdAKbzI+1Yck7qFPdNRQ6Bh/4rHFVZzGpA=
Received: from macbook-pro.kuh-wiese.my-router.de
 (dslb-002-206-141-230.002.206.pools.vodafone-ip.de [2.206.141.230])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by smtp.vodafone.de (Postfix) with ESMTPSA id CB0041420AF;
 Fri,  8 Jan 2021 13:33:25 +0000 (UTC)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: =?utf-8?Q?Re=3A_Bug_in_=E2=80=98network-interface-names=E2=80=99?=
 =?utf-8?Q?_when_building_guix_for_aarch64_on_x86=5F64=2E?=
From: Stefan <stefan-guix@HIDDEN>
In-Reply-To: <20210108040445.1444c372@HIDDEN>
Date: Fri, 8 Jan 2021 14:33:24 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <18A145C5-A200-4EEC-A559-5E3642521A3F@HIDDEN>
References: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@HIDDEN>
 <5A46F4E0-9823-4614-A7BC-865F9D7C0FB7@HIDDEN>
 <20210108040445.1444c372@HIDDEN>
To: Danny Milosavljevic <dannym@HIDDEN>
X-Mailer: Apple Mail (2.3124)
X-purgate-type: clean
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate: This mail is considered clean (visit http://www.eleven.de for
 further information)
X-purgate: clean
X-purgate-size: 600
X-purgate-ID: 155817::1610112805-0000239E-1C798E28/0/0
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45716
Cc: ludo@HIDDEN, 45716 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Danny and Ludo=E2=80=99!

> Can you try printing (@@ (guix build syscalls) ifreq-struct-size) =
directly?

I did that, it's printing 40 in both cases. That=E2=80=99s the value =
which is ending up in stride.

> Is it qemu-user or qemu-system?

~$ /usr/local/bin/qemu-system-x86_64 --version
QEMU emulator version 2.12.1 (-dirty)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

> (Note: Empirically, on armhf, that struct is 32 Bytes big in C.
> And indeed the Linux kernel contains a compat struct ifreq32 in =
fs/compat_ioctl.c)



Bye

Stefan






Information forwarded to bug-guix@HIDDEN:
bug#45716; Package guix. Full text available.

Message received at 45716 <at> debbugs.gnu.org:


Received: (at 45716) by debbugs.gnu.org; 8 Jan 2021 03:04:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 07 22:04:56 2021
Received: from localhost ([127.0.0.1]:49000 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kxi59-0004XL-Qm
	for submit <at> debbugs.gnu.org; Thu, 07 Jan 2021 22:04:55 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:59704)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1kxi54-0004X9-Vl
 for 45716 <at> debbugs.gnu.org; Thu, 07 Jan 2021 22:04:54 -0500
Received: from localhost (80-110-127-104.cgn.dynamic.surfer.at
 [80.110.127.104])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 3ADA53363D31;
 Fri,  8 Jan 2021 04:04:49 +0100 (CET)
Date: Fri, 8 Jan 2021 04:04:45 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: Stefan <stefan-guix@HIDDEN>
Subject: Re: Bug in =?utf-8?Q?=E2=80=98network-interface-names=E2=80=99?=
 when building guix for aarch64 on x86_64.
Message-ID: <20210108040445.1444c372@HIDDEN>
In-Reply-To: <5A46F4E0-9823-4614-A7BC-865F9D7C0FB7@HIDDEN>
References: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@HIDDEN>
 <5A46F4E0-9823-4614-A7BC-865F9D7C0FB7@HIDDEN>
X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="Sig_/.qSaDk=pHCt6xi9zvqYVw+9";
 protocol="application/pgp-signature"; micalg=pgp-sha512
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45716
Cc: ludo@HIDDEN, 45716 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--Sig_/.qSaDk=pHCt6xi9zvqYVw+9
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hi Stefan,

>I have however no clue, why the number of bytes is only 32 in case of aarc=
h64. This value is taken from the struct ifconf read via ioctl(SIOCGIFCONF).

guix/build/syscalls.scm has:

>(define ifreq-struct-size
>  ;; 'struct ifreq' begins with an array of IF_NAMESIZE bytes containing t=
he
>  ;; interface name (nul-terminated), followed by a bunch of stuff.  This =
is
>  ;; its size in bytes.
>  (if (=3D 8 (sizeof '*))
>      40
>      32))

I think that should rather be (sizeof* '*) instead of (sizeof '*).  Ludo?

Can you try printing (@@ (guix build syscalls) ifreq-struct-size) directly ?

>To be precise this is all running in a virtual machine with virtio-net-pci.
>Both kernel and qemu on the host are rather old. However, building for x86=
_64
>works just fine, so I think the host setup is unrelated.

Is it qemu-user or qemu-system ?

(Note: Empirically, on armhf, that struct is 32 Bytes big in C.
And indeed the Linux kernel contains a compat struct ifreq32 in fs/compat_i=
octl.c)

--Sig_/.qSaDk=pHCt6xi9zvqYVw+9
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl/3y80ACgkQ5xo1VCww
uqXEBQf/d01xj6mUC4LYTLJMU1iGXVv5MhPhf0YgoSELSwhqoqvKlLttGllUA8o/
OjXdO+C7OHm0XkOgvy/V42lVPuc7U9+/KsqvxatEWEn3N/mBBC/STHEJt/GPWhHJ
Z0+WBKhforwGNc78v81ewje6yq3xYCv1PakqAMNaa3IDPazYm69Q+GyrRo1YyiUZ
c+xRjaM7TgvckhMyBWyZBxwRf2GNM2P36UDR589sLRXlafmfndKcG22SYk79e928
2Smj0knB6zU+Xig3XPOoy5JBDGuGwc/MIuqqf5gl7WUJTY5+U6WTJ6k5z19ucGjH
L3+O3bYYRc1uWWLccDWc4drDwMC4jw==
=04uu
-----END PGP SIGNATURE-----

--Sig_/.qSaDk=pHCt6xi9zvqYVw+9--




Information forwarded to bug-guix@HIDDEN:
bug#45716; Package guix. Full text available.

Message received at 45716 <at> debbugs.gnu.org:


Received: (at 45716) by debbugs.gnu.org; 7 Jan 2021 22:18:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 07 17:18:02 2021
Received: from localhost ([127.0.0.1]:48801 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kxdbW-0005O7-2c
	for submit <at> debbugs.gnu.org; Thu, 07 Jan 2021 17:18:02 -0500
Received: from smtpout2.vodafonemail.de ([145.253.239.133]:38018)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1kxdbT-0005Nc-FX
 for 45716 <at> debbugs.gnu.org; Thu, 07 Jan 2021 17:18:00 -0500
Received: from smtp.vodafone.de (unknown [10.2.0.34])
 by smtpout2.vodafonemail.de (Postfix) with ESMTP id 68F62127302;
 Thu,  7 Jan 2021 23:17:52 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de;
 s=vfde-smtpout-mb-15sep; t=1610057872;
 bh=GPCsC831Gux/fbNzqNDTOezRRUJTHuyIC5BjHfEfwgg=;
 h=Subject:From:In-Reply-To:Date:References:To;
 b=Nq/p7/mvUYlOMpp92xDLETEQEayhWrax4WWlczPtyeO6EhJJxZmqHYJ2ZOfXY8/LL
 ZStM628dk7lJ6mDed+qxSi1HprFp+Te3FJL0p4N0ZUvdFijawOq2zOdKhM7t+UId/0
 Te8Mi6R7ZX0Jo/c0yUMCpYM1FYrCQFSSfFpqlPpk=
Received: from macbook-pro.kuh-wiese.my-router.de
 (dslb-002-206-141-230.002.206.pools.vodafone-ip.de [2.206.141.230])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by smtp.vodafone.de (Postfix) with ESMTPSA id 32DC3141051;
 Thu,  7 Jan 2021 22:17:52 +0000 (UTC)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: =?utf-8?Q?Re=3A_Bug_in_=E2=80=98network-interface-names=E2=80=99?=
 =?utf-8?Q?_when_building_guix_for_aarch64_on_x86=5F64=2E?=
From: Stefan <stefan-guix@HIDDEN>
In-Reply-To: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@HIDDEN>
Date: Thu, 7 Jan 2021 23:17:51 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <5A46F4E0-9823-4614-A7BC-865F9D7C0FB7@HIDDEN>
References: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@HIDDEN>
To: 45716 <at> debbugs.gnu.org,
 Danny Milosavljevic <dannym@HIDDEN>
X-Mailer: Apple Mail (2.3124)
X-purgate-type: clean
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate: This mail is considered clean (visit http://www.eleven.de for
 further information)
X-purgate: clean
X-purgate-size: 1690
X-purgate-ID: 155817::1610057872-00003440-F8EE8040/0/0
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45716
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi!

This change makes the reproducer working and prints some more values:

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 85c1c45f81..250c577d33 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -1473,7 +1473,19 @@ most LEN bytes from BV."
        (()
         (reverse result))
        (_
-       (loop (drop bytes stride)
+       (display "bytes: ")
+       (display (length bytes))
+       (newline)
+       (display "stride: ")
+       (display stride)
+       (newline)
+       (display "ifreq-struct-size: ")
+       (display ifreq-struct-size)
+       (newline)
+       (display "sizeof '*: ")
+       (display (sizeof '*))
+       (newline)
+       (loop (drop bytes (min stride (length bytes)))
              (cons (bytes->string bytes) result))))))
=20
  (define* (network-interface-names #:optional sock)


So indeed, the number of bytes is only 32, if build with =
=E2=80=98./pre-inst-env guix build --system=3Daarch64-linux -f =
~/test.scm=E2=80=99:

bytes: 32
stride: 40
sizeof '*: 8

If this is instead build with just =E2=80=98./pre-inst-env guix build -f =
~/test.scm=E2=80=99, the output is as expected:

bytes: 40
stride: 40
sizeof '*: 8
=20
I have however no clue, why the number of bytes is only 32 in case of =
aarch64. This value is taken from the struct ifconf read via =
ioctl(SIOCGIFCONF).

Danny, does that maybe ring a bell?

To be precise this is all running in a virtual machine with =
virtio-net-pci. Both kernel and qemu on the host are rather old. =
However, building for x86_64 works just fine, so I think the host setup =
is unrelated.


Bye

Stefan=




Information forwarded to bug-guix@HIDDEN:
bug#45716; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Jan 2021 15:38:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 07 10:38:08 2021
Received: from localhost ([127.0.0.1]:48342 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kxXMW-0008E5-HU
	for submit <at> debbugs.gnu.org; Thu, 07 Jan 2021 10:38:08 -0500
Received: from lists.gnu.org ([209.51.188.17]:44688)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1kxXMU-0008Dy-UB
 for submit <at> debbugs.gnu.org; Thu, 07 Jan 2021 10:38:08 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:46634)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <stefan-guix@HIDDEN>)
 id 1kxXMU-0001ni-Ef
 for bug-guix@HIDDEN; Thu, 07 Jan 2021 10:38:06 -0500
Received: from smtpout2.vodafonemail.de ([145.253.239.133]:32988)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <stefan-guix@HIDDEN>)
 id 1kxXMR-0006ZD-EM
 for bug-guix@HIDDEN; Thu, 07 Jan 2021 10:38:06 -0500
Received: from smtp.vodafone.de (unknown [10.2.0.33])
 by smtpout2.vodafonemail.de (Postfix) with ESMTP id 1BC9F1237CF
 for <bug-guix@HIDDEN>; Thu,  7 Jan 2021 16:37:57 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de;
 s=vfde-smtpout-mb-15sep; t=1610033877;
 bh=k9FRlVM8I7eUw7SD4N6LeUOWVes/vw/UhVXSCaGDdmQ=;
 h=From:Subject:Date:To;
 b=JyXBZVQyPoLkMmGBtOxqOM6hQhzxhd3v3+3ZOz4YG39idURBEribRF4ItIme9RpP1
 HnLPwgLQIiNQKTF4Nl0+f4NpeGPAJZhyg140H1ZGmBpEa810S/0R3bLeA7gwZJ7/zf
 CzB0urigpEufOB9c5FfbXDtqQ46gJ5q9O1km8TvU=
Received: from macbook-pro.kuh-wiese.my-router.de
 (dslb-002-206-141-230.002.206.pools.vodafone-ip.de [2.206.141.230])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by smtp.vodafone.de (Postfix) with ESMTPSA id D2FAD1420F8
 for <bug-guix@HIDDEN>; Thu,  7 Jan 2021 15:37:56 +0000 (UTC)
From: Stefan <stefan-guix@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: =?utf-8?Q?Bug_in_=E2=80=98network-interface-names=E2=80=99_when_?=
 =?utf-8?Q?building_guix_for_aarch64_on_x86=5F64=2E?=
Message-Id: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@HIDDEN>
Date: Thu, 7 Jan 2021 16:37:56 +0100
To: bug-guix@HIDDEN
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
X-Mailer: Apple Mail (2.3124)
X-purgate-type: clean
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate: This mail is considered clean (visit http://www.eleven.de for
 further information)
X-purgate: clean
X-purgate-size: 4918
X-purgate-ID: 155817::1610033876-00005EB2-F1200950/0/0
Received-SPF: pass client-ip=145.253.239.133;
 envelope-from=stefan-guix@HIDDEN; helo=smtpout2.vodafonemail.de
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hi!

When building for aarch64 on a x86=E2=80=A664 system, then the =
=E2=80=98network-interface-names=E2=80=99 function produces an error.

Because of this building guix for aarch64 fails during the test with =
this:

test-name: network-interface-names
location: =
/tmp/guix-build-guix-1.2.0-8.7624ebb.drv-0/source/tests/syscalls.scm:387
source:
+ (test-assert
+   "network-interface-names"
+   (match (remove
+            (lambda (interface)
+              (string-contains interface ":"))
+            (network-interface-names))
+          (((? string? names) ..1)
+           (lset<=3D
+             string=3D?
+             names
+             (all-network-interface-names)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "list-tail"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "pair" ())
+   (()))
result: FAIL


I created a little reproducer for this problem:

stefan@guix ~$ cat test.scm=20
(use-modules (guix gexp)
             (gnu packages admin))
(with-imported-modules '((guix build syscalls)
                         (guix build utils))
  (computed-file "insterface-names"
    #~(begin
        (use-modules (guix build syscalls)
                     (guix build utils)
                     (ice-9 popen)
                     (ice-9 rdelim))
        (mkdir-p #$output)
        (chdir #$output)
        (with-output-to-file "interface-names"
          (lambda ()
            (display (string-join (all-network-interface-names) ", "))
            (newline)
            (let* ((port (open-input-pipe #$(file-append inetutils =
"/bin/ifconfig"))))
              (display (string-join=20
                        (let loop ((output '()))
                          (let ((line (read-line port)))
                            (if (eof-object? line)
                              (reverse output)
                              (loop (cons line output)))))
                        "\n"))
              (close-pipe port))
            (display (string-join (network-interface-names) ", "))
            (newline))))))

stefan@guix ~$ guix build --system=3Daarch64-linux -f test.scm=20
Folgende Ableitung wird erstellt:
   /gnu/store/l7sypckaywl3djrhagywwzsb2c3984wf-insterface-names.drv
/gnu/store/l7sypckaywl3djrhagywwzsb2c3984wf-insterface-names.drv wird =
erstellt =E2=80=A6
Backtrace:
           7 (primitive-load "/gnu/store/a37szh4h151v66xyl874qfcbm6x?")
In ice-9/ports.scm:
   463:17  6 (call-with-output-file _ _ #:binary _ #:encoding _)
    474:4  5 (_ _)
In ice-9/eval.scm:
    619:8  4 (_ #(#(#<directory (guile-user) 7ffff6f14f00>)))
    155:9  3 (_ #(#(#<directory (guile-user) 7ffff6f14f00>)))
    159:9  2 (_ #(#(#<directory (guile-user) 7ffff6f14f00>)))
In guix/build/syscalls.scm:
  1476:13  1 (bytevector->string-list _ 40 _)
In unknown file:
           0 (list-tail (108 111 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 ?) ?)

ERROR: In procedure list-tail:
In procedure list-tail: Wrong type argument in position 1 (expecting =
pair): ()
builder for =
`/gnu/store/l7sypckaywl3djrhagywwzsb2c3984wf-insterface-names.drv' =
failed with exit code 1
Erstellung von =
/gnu/store/l7sypckaywl3djrhagywwzsb2c3984wf-insterface-names.drv =
fehlgeschlagen
Das Erstellungsprotokoll kann unter =
=E2=80=9E/var/log/guix/drvs/l7/sypckaywl3djrhagywwzsb2c3984wf-insterface-n=
ames.drv.bz2=E2=80=9C eingesehen werden.
guix build: error: build of =
`/gnu/store/l7sypckaywl3djrhagywwzsb2c3984wf-insterface-names.drv' =
failed


When the line containing "(display (string-join =
(network-interface-names) ", "))" is removed, the output looks as =
follows:

stefan@guix ~$ cat =
/gnu/store/q7m7dxp4pn7jrw4f6hkwfsiga5zj43x1-insterface-names/interface-nam=
es=20
lo
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Bcast:0.0.0.0  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0  TX bytes:0

I think the problem happens in guix/build/syscalls.scm in =
=E2=80=98bytevector->string-list=E2=80=99, which is used by =
=E2=80=98network-interface-name=E2=80=99, certainly in (drop bytes =
stride) more bytes than available should be dropped, probably because =
stride is bigger than len:

(define (bytevector->string-list bv stride len)
  "Return the null-terminated strings found in BV every STRIDE bytes.  =
Read at
most LEN bytes from BV."
  (let loop ((bytes  (take (bytevector->u8-list bv)
                           (min len (bytevector-length bv))))
             (result '()))
    (match bytes
      (()
       (reverse result))
      (_
=3D>     (loop (drop bytes stride)
             (cons (bytes->string bytes) result))))))


Bye

Stefan=




Acknowledgement sent to Stefan <stefan-guix@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#45716; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 11 Jan 2021 13:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.