unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Leo Prikler <leo.prikler@student.tugraz.at>
Cc: 47106@debbugs.gnu.org
Subject: bug#47106: Bubblewrap hates Guix containers 😞
Date: Mon, 15 Mar 2021 14:29:17 +0100	[thread overview]
Message-ID: <87sg4wh7f6.fsf@gnu.org> (raw)
In-Reply-To: <b7e184f6a0ceece097f9fc3f25cb47a0ccdf6d34.camel@student.tugraz.at> (Leo Prikler's message of "Mon, 15 Mar 2021 11:14:11 +0100")

Hi,

Leo Prikler <leo.prikler@student.tugraz.at> skribis:

> Okay, so here's my basic workflow: Starting with an empty set of --
> expose:
> bwrap: Can't find source path /sys/block: No such file or directory
> repeated a few times along with warnings, that the web process crashed
> until finally Epiphany itself crashes. 
> I add /sys/block, and Epiphany miraculously doesn't crash, but bwrap
> still complains and the web processes still crash, so we march on. 
> I'll abbreviate it a little and only show the error messages.
> bwrap: Can't find source path /sys/bus: No such file or directory
> bwrap: Can't find source path /sys/class: No such file or directory 
> bwrap: Can't find source path /sys/dev: No such file or directory 
> bwrap: Can't find source path /sys/devices: No such file or directory

OK.  Additional data points from my Guix System laptop:

--8<---------------cut here---------------start------------->8---
$ guix environment -C --ad-hoc findutils -- find /sys |wc -l
37575
$ find /sys | wc -l
find: ‘/sys/kernel/debug’: Mankas permeso
38026
$ guix environment -C --ad-hoc findutils -- find /sys/block |wc -l
27
$ find /sys/block | wc -l
27
--8<---------------cut here---------------end--------------->8---

The offending Bubblewrap code is:

--8<---------------cut here---------------start------------->8---
static void
resolve_symlinks_in_ops (void)
{
  SetupOp *op;

  for (op = ops; op != NULL; op = op->next)
    {
      const char *old_source;

      switch (op->type)
        {
        case SETUP_RO_BIND_MOUNT:
        case SETUP_DEV_BIND_MOUNT:
        case SETUP_BIND_MOUNT:
          old_source = op->source;
          op->source = realpath (old_source, NULL);
          if (op->source == NULL)
            {
              if (op->flags & ALLOW_NOTEXIST && errno == ENOENT)
                op->source = old_source;
              else
                die_with_error("Can't find source path %s", old_source);
            }
          break;
        default:
          break;
        }
    }
}
--8<---------------cut here---------------end--------------->8---

I wonder how ‘realpath’ can fail here.  In fact, it Works For Me:

--8<---------------cut here---------------start------------->8---
$ cat realpath.scm
(use-modules (system foreign))

(define realpath
  (let ((proc (pointer->procedure '* (dynamic-func "realpath" (dynamic-link))
                                  '(* *))))
    (lambda (path)
      (let ((result (proc (string->pointer path) %null-pointer)))
        (and (not (null-pointer? result))
             (pointer->string result))))))

(pk 'realpath-> (realpath "/sys/block"))
$ guix environment -C --ad-hoc guile -- guile -s realpath.scm
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/ludo/src/guix-debugging/realpath.scm
;;; compiled /home/ludo/.cache/guile/ccache/3.0-LE-8-4.4/home/ludo/src/guix-debugging/realpath.scm.go

;;; (realpath-> "/sys/block")
--8<---------------cut here---------------end--------------->8---

So I presume bwrap does something else before it reaches that warning.
We should really strace it.

Thanks,
Ludo’.




  reply	other threads:[~2021-03-15 13:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 17:43 bug#47106: Bubblewrap hates Guix containers 😞 Leo Prikler
2021-03-13 10:48 ` Ludovic Courtès
2021-03-13 11:07   ` Leo Prikler
2021-03-13 12:27     ` Bengt Richter
2021-03-13 14:43       ` Leo Prikler
2021-03-13 17:07         ` Bengt Richter
2021-03-13 18:01           ` Leo Prikler
2021-03-14 17:45             ` Bengt Richter
2021-03-14 18:05               ` Leo Prikler
2021-03-14 20:32                 ` Ludovic Courtès
2021-03-14 20:43                   ` Leo Prikler
2021-03-15  9:52                     ` Ludovic Courtès
2021-03-15 10:14                       ` Leo Prikler
2021-03-15 13:29                         ` Ludovic Courtès [this message]
2021-03-16 10:54                 ` Bengt Richter
2021-03-16 11:13                   ` Leo Prikler
2021-04-14 20:07 ` Leo Famulari
2021-04-14 21:23   ` Leo Prikler
2021-04-14 22:00     ` Leo Famulari

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=87sg4wh7f6.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=47106@debbugs.gnu.org \
    --cc=leo.prikler@student.tugraz.at \
    /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).