From: Stefan <stefan-guix@vodafonemail.de>
To: 45716@debbugs.gnu.org
Subject: bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64.
Date: Thu, 7 Jan 2021 16:37:56 +0100 [thread overview]
Message-ID: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@vodafonemail.de> (raw)
Hi!
When building for aarch64 on a x86…64 system, then the ‘network-interface-names’ 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<=
+ string=?
+ 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
(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
(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=aarch64-linux -f test.scm
Folgende Ableitung wird erstellt:
/gnu/store/l7sypckaywl3djrhagywwzsb2c3984wf-insterface-names.drv
/gnu/store/l7sypckaywl3djrhagywwzsb2c3984wf-insterface-names.drv wird erstellt …
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 „/var/log/guix/drvs/l7/sypckaywl3djrhagywwzsb2c3984wf-insterface-names.drv.bz2“ 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-names
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 ‘bytevector->string-list’, which is used by ‘network-interface-name’, 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))
(_
=> (loop (drop bytes stride)
(cons (bytes->string bytes) result))))))
Bye
Stefan
next reply other threads:[~2021-01-07 15:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-07 15:37 Stefan [this message]
2021-01-07 22:17 ` bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64 Stefan
2021-01-08 3:04 ` Danny Milosavljevic
2021-01-08 13:33 ` Stefan
2021-01-08 16:47 ` Stefan
2021-01-08 23:28 ` Stefan
2021-01-09 18:01 ` bug#45716: gnu: qemu: Fix ioclt(…, SIOCGIFCONF, …) for emulated 64 bit architectures Stefan
2021-01-11 13:28 ` Ludovic Courtès
2021-01-11 20:32 ` bug#45716: [PATCH 1/1] " Stefan
2021-01-14 13:39 ` Ludovic Courtès
2021-01-23 15:27 ` bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64 Stefan
2021-01-23 20:13 ` Leo Famulari
2021-02-01 20:58 ` Ludovic Courtès
2021-02-02 8:09 ` Mathieu Othacehe
2021-02-06 12:59 ` Stefan
2021-02-07 18:15 ` Mathieu Othacehe
2021-02-08 7:44 ` Stefan
2021-01-11 13:30 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19CC6F6C-98CA-4218-A9E7-FE7AC751E924@vodafonemail.de \
--to=stefan-guix@vodafonemail.de \
--cc=45716@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.