guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: chroot/aarch64 issues


From: Efraim Flashner
Subject: Re: chroot/aarch64 issues
Date: Tue, 5 Jul 2016 14:45:08 +0300
User-agent: Mutt/1.6.1 (2016-04-27)

On Tue, Jul 05, 2016 at 10:45:51AM +0200, Ludovic Courtès wrote:
> Efraim Flashner <address@hidden> skribis:
> 
> > On Mon, Jul 04, 2016 at 03:37:12PM +0200, Ludovic Courtès wrote:
> >> Hi!
> >> 
> >> Efraim Flashner <address@hidden> skribis:
> >> 
> >> > On the side I'm working on the aarch64 port, and I've come across a
> >> 
> >> Woohoo!
> >> 
> >> > snag. I've been unable to actually get anything to build. When I start
> >> > the daemon as:
> >> > `sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild',
> >> > when I attempt to build hello I get back the error:
> >> > guix build: error: build failed: cloning builder process: Invalid 
> >> > argument
> >> 
> >> Could you strace the daemon itself?
> >> 
> >>   sudo ./pre-inst-env strace -f -o log guix-daemon \
> >>            --build-users-group=guixbuild
> >> 
> >> I presume EINVAL is returned by clone(2), but it would be good to see
> >> that syscall precisely.
> >
> > attached
> 
> The culprit is:
> 
> 4871  clone(child_stack=0x7fd850d338, 
> flags=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWPID|CLONE_NEWNET|SIGCHLD)
>  = -1 EINVAL (Invalid argument)
> 
> >> What Linux version is this?
> >
> > $ uname -a
> > Linux odroid-jessie64 3.14.65+ #2 SMP PREEMPT Sun Jul 3 18:29:45
> > UTC 2016 aarch64 GNU/Linux
> 
> According to clone(2), this version supports all of the above flags.
> 
> Also, the kernel config you posted has all the namespace options
> enabled:
> 
> --8<---------------cut here---------------start------------->8---
> CONFIG_UTS_NS=y
> CONFIG_IPC_NS=y
> CONFIG_USER_NS=y
> CONFIG_PID_NS=y
> CONFIG_NET_NS=y
> --8<---------------cut here---------------end--------------->8---
> 
> If the kernel config corresponds to this kernel, I don’t see which of
> the other EINVAL reasons given in clone(2) would apply.  Does ‘dmesg’
> show something?
> 
> Could you maybe try a C program that invokes clone(2) and progressively
> remove CLONE_ flags until you find the one that’s causing EINVAL?
> 
> Thanks,
> Ludo’.

I ran the program from here
http://man7.org/tlpi/code/online/dist/procexec/demo_clone.c.html and
from what I could tell it worked. I've attached the log anyway.

grepping for "cloning builder process" led me to nix/libstore/build.cc .
pid = clone(childEntry, stack + sizeof(stack) - 8, flags, this);

the failing clone call:
4871  clone(child_stack=0x7fd850d338, 
flags=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWPID|CLONE_NEWNET|SIGCHLD) 
= -1 EINVAL (Invalid argument)

the other clone calls:
4866  clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7fb24220d0) = 4871
4871  clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7fb24220d0) = 4872
4872  clone(child_stack=0x7facb0bae0, 
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
 parent_tidptr=0x7facb0c2b0, tls=0x7facb0c8d0, child_tidptr=0x7facb0c2b0) = 4873
4871  clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7fb24220d0) = 4875

without chroot there's no error since `if (useChroot)' is false.
tidptr is apparently thread id pointer.
I'm going to look more at
http://man7.org/linux/man-pages/man2/set_tid_address.2.html and
http://man7.org/linux/man-pages/man2/clone.2.html in case there's
something specific about aarch64 causing problems.


also, is this something I should look into?
faccessat(AT_FDCWD, "/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)

-- 
Efraim Flashner   <address@hidden>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

Attachment: clone-log
Description: Text document

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]