unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guix-devel@gnu.org
Subject: Re: GLib’s ‘network-address’ test failure
Date: Thu, 17 Oct 2013 23:57:08 +0200	[thread overview]
Message-ID: <87vc0vwogb.fsf@gnu.org> (raw)
In-Reply-To: <874n8hatap.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 16 Oct 2013 21:51:10 +0200")

ludo@gnu.org (Ludovic Courtès) skribis:

> To see what ‘if_indextoname’ returns in our chroot, I tried this:
>
> (use-modules (guix store) (guix derivations) (guix monads) (guix utils)
>              (gnu packages guile))
>
> (define builder '(begin
>                    (use-modules (system foreign)
>                                 (rnrs bytevectors)
>                                 (srfi srfi-1))
>
>                    (let ()
>                      (define index->name
>                        (let* ((ptr (dynamic-func "if_indextoname" (dynamic-link)))
>                               (proc (pointer->procedure '* ptr
>                                                         (list unsigned-int '*))))
>                          (lambda (index)
>                            (let* ((bv  (make-bytevector 256))
>                                   (ret (proc index
>                                              (bytevector->pointer bv))))
>                              (if (null-pointer? ret)
>                                  #f
>                                  (pointer->string ret))))))
>                      (call-with-output-file (assoc-ref %outputs "out")
>                        (lambda (port)
>                          (write (zip (map index->name (iota 10))
>                                      (iota 10))
>                                 port))))))
>
> (let* ((mdrv (derivation-expression "iface" (%current-system) builder '()))
>        (s    (open-connection))
>        (drv  (run-with-store s mdrv)))
>   (pk drv)
>   (build-derivations s (list drv)))
>
> That returns a series of #f (whereas outside of the chroot BUILDER
> returns '("lo" "eth0" "wlan0").)

On IRC Mark noted that nix/libstore/build.cc sets up ‘lo’ in the chroot,
so that one should appear.

It turns out that it does indeed appear, but its index is incremented by
one each time guix-daemon starts a child process.  Thus, when doing a
whole series of builds in a row, or if the machine has been up long
enough, you may end up with an index greater than 255, leading to the
assertion failure in ‘find_ifname_and_index’ (this explains why Hydra
was hitting it and not my laptop, for instance.)

If the explanation is correct, 93a3d8f fixes the problem.

Thanks,
Ludo’.

      reply	other threads:[~2013-10-17 21:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16 19:51 GLib’s ‘network-address’ test failure Ludovic Courtès
2013-10-17 21:57 ` Ludovic Courtès [this message]

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vc0vwogb.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).