From unknown Fri Jun 20 07:16:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#50151 <50151@debbugs.gnu.org> To: bug#50151 <50151@debbugs.gnu.org> Subject: Status: Coreutils, aarch64 and chroot Reply-To: bug#50151 <50151@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:16:01 +0000 retitle 50151 Coreutils, aarch64 and chroot reassign 50151 coreutils submitter 50151 Frans de Boer severity 50151 normal tag 50151 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 21 12:35:47 2021 Received: (at submit) by debbugs.gnu.org; 21 Aug 2021 16:35:47 +0000 Received: from localhost ([127.0.0.1]:37763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHTyE-0006wq-Te for submit@debbugs.gnu.org; Sat, 21 Aug 2021 12:35:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:53198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHOJq-0003Lh-4o for submit@debbugs.gnu.org; Sat, 21 Aug 2021 06:33:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHOJp-0006IJ-NL for bug-coreutils@gnu.org; Sat, 21 Aug 2021 06:33:41 -0400 Received: from fransdb.nl ([80.101.31.146]:40288 helo=pubserv1.fransdb.nl) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHOJo-0000K6-0K for bug-coreutils@gnu.org; Sat, 21 Aug 2021 06:33:41 -0400 Received: from localhost (localhost [127.0.0.1]) by pubserv1.fransdb.nl (Postfix) with ESMTP id 72504A16F4 for ; Sat, 21 Aug 2021 12:33:35 +0200 (CEST) X-Virus-Scanned: amavisd-new at fransdb.nl Received: from pubserv1.fransdb.nl ([127.0.0.1]) by localhost (pubserv1.fransdb.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2nx-sBkugQ28 for ; Sat, 21 Aug 2021 12:33:35 +0200 (CEST) Received: from [IPv6:2001:980:3f2a:0:583a:22ff:fe40:ea80] (unknown [IPv6:2001:980:3f2a:0:583a:22ff:fe40:ea80]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: frans@fransdb.nl) by pubserv1.fransdb.nl (Postfix) with ESMTPSA id E8B1FA0D10 for ; Sat, 21 Aug 2021 12:33:34 +0200 (CEST) From: Frans de Boer Subject: Coreutils, aarch64 and chroot To: bug-coreutils@gnu.org Message-ID: Date: Sat, 21 Aug 2021 12:33:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: none client-ip=80.101.31.146; envelope-from=frans@fransdb.nl; helo=pubserv1.fransdb.nl X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 21 Aug 2021 12:35:46 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) LS, I have an issue with chroot in the next context: qemu-aarch64 -cpu cortex-a53 -L /newroot /newroot/usr/sbin/chroot /newroot \   /usr/bin/env -i \     HOME=/root \     TERM="$TERM" \     PS1='(arm chroot) \u:\w\$ ' \     PATH=/usr/bin:/usr/sbin \     /usr/bin/bash --login +h qemu-aarch64 is running on top of x86_64 linux and chroot, env and bash are compiled as aarch64 binaries. By themselves they all run under qemu-aarch64. But when using the above command, it always fails with 'Exec format error'. The same if running: qemu-aarch64 -L /newroot /newroot/usr/sbin/chroot /newroot It should run /bin/bash, but ends with the same error message. Running 'qemu-aarch64 -L /newroot /newroot/usr/bin/bash -c /usr/bin/env --help' does show the env help text. So, I guess chroot is to blame? Regards, Frans. -- A: Yes, just like that A: Ja, net zo Q: Oh, Just like reading a book backwards Q: Oh, net als een boek achterstevoren lezen A: Because it upsets the natural flow of a story A: Omdat het de natuurlijke gang uit het verhaal haalt Q: Why is top-posting annoying? Q: Waarom is Top-posting zo irritant? From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 21 12:43:42 2021 Received: (at 50151) by debbugs.gnu.org; 21 Aug 2021 16:43:42 +0000 Received: from localhost ([127.0.0.1]:37776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHU5u-0007BN-DR for submit@debbugs.gnu.org; Sat, 21 Aug 2021 12:43:42 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHU5t-0007B9-5X for 50151@debbugs.gnu.org; Sat, 21 Aug 2021 12:43:41 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EC7D5160076; Sat, 21 Aug 2021 09:43:34 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 63CgVR2yWSys; Sat, 21 Aug 2021 09:43:34 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4FE17160117; Sat, 21 Aug 2021 09:43:34 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7Cnw_dNb0hkw; Sat, 21 Aug 2021 09:43:34 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 20639160076; Sat, 21 Aug 2021 09:43:34 -0700 (PDT) Subject: Re: bug#50151: Coreutils, aarch64 and chroot To: Frans de Boer References: From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Sat, 21 Aug 2021 09:43:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 50151 Cc: 50151@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.4 (---) On 8/21/21 3:33 AM, Frans de Boer wrote: > So, I guess chroot is to blame? Seems unlikely that it'd be a coreutils bug. Possibly you simply have the wrong type of executable installed as /newroot/usr/sbin/chroot. If it is a coreutils bug, please give complete steps to let others reproduce the bug. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 24 04:39:29 2021 Received: (at 50151) by debbugs.gnu.org; 24 Aug 2021 08:39:29 +0000 Received: from localhost ([127.0.0.1]:43204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIRxx-0007z5-LK for submit@debbugs.gnu.org; Tue, 24 Aug 2021 04:39:29 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:59030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIRxr-0007yi-Pj for 50151@debbugs.gnu.org; Tue, 24 Aug 2021 04:39:28 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6EC78160060; Tue, 24 Aug 2021 01:39:17 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id sDMxa8Am7-Os; Tue, 24 Aug 2021 01:39:16 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B493B160071; Tue, 24 Aug 2021 01:39:16 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Yk6OWlwSTbM3; Tue, 24 Aug 2021 01:39:16 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 905C0160060; Tue, 24 Aug 2021 01:39:16 -0700 (PDT) To: Frans de Boer References: From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: bug#50151: Coreutils, aarch64 and chroot Message-ID: Date: Tue, 24 Aug 2021 01:39:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 50151 Cc: 50151@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.4 (---) On 8/24/21 1:31 AM, Frans de Boer wrote: > If it is the wrong executable, would it ever startup and continue and=20 > (try to) load bash or env? No. > It even displays the help message! Not from what you've shown so far. You reported the output of env=20 --help, not the output of chroot --help. > I can supply more, but what exactly would help you forward? A complete set of instructions for an outsider to reproduce the problem=20 from scratch. Assume the outsider is running Fedora 34 x86-64 (since=20 that's what I'm running :-). However, I think it'll be a better use of our time for you to debug this=20 one yourself. It doesn't sound like a Coreutils problem; it sounds like=20 a problem in your virtual machine setup, and you're the best expert on=20 that setup. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 24 09:52:48 2021 Received: (at 50151) by debbugs.gnu.org; 24 Aug 2021 13:52:48 +0000 Received: from localhost ([127.0.0.1]:43507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIWrA-0001Uq-E7 for submit@debbugs.gnu.org; Tue, 24 Aug 2021 09:52:48 -0400 Received: from fransdb.nl ([80.101.31.146]:60784 helo=pubserv1.fransdb.nl) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIRqY-0007ka-Uu for 50151@debbugs.gnu.org; Tue, 24 Aug 2021 04:31:55 -0400 Received: from localhost (localhost [127.0.0.1]) by pubserv1.fransdb.nl (Postfix) with ESMTP id DFF67A16C2; Tue, 24 Aug 2021 10:31:44 +0200 (CEST) X-Virus-Scanned: amavisd-new at fransdb.nl Received: from pubserv1.fransdb.nl ([127.0.0.1]) by localhost (pubserv1.fransdb.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kfXb8GE5QrE6; Tue, 24 Aug 2021 10:31:44 +0200 (CEST) Received: from [192.168.101.128] (fransdb.nl [80.101.31.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: frans@fransdb.nl) by pubserv1.fransdb.nl (Postfix) with ESMTPSA id 5D7F6A03C4; Tue, 24 Aug 2021 10:31:44 +0200 (CEST) From: Frans de Boer Subject: Re: bug#50151: Coreutils, aarch64 and chroot To: Paul Eggert References: Message-ID: Date: Tue, 24 Aug 2021 10:31:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 50151 X-Mailman-Approved-At: Tue, 24 Aug 2021 09:52:47 -0400 Cc: 50151@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) On 8/21/21 6:43 PM, Paul Eggert wrote: > On 8/21/21 3:33 AM, Frans de Boer wrote: >> So, I guess chroot is to blame? > > Seems unlikely that it'd be a coreutils bug. Possibly you simply have > the wrong type of executable installed as /newroot/usr/sbin/chroot. > > If it is a coreutils bug, please give complete steps to let others > reproduce the bug. If it is the wrong executable, would it ever startup and continue and (try to) load bash or env? It even displays the help message! As I said before, on its own it does function but, as opposed to bash, it does NOT load other programs. All programs are compiled the same with aarch64-cross-linux tools. No problem when operating under qemu-x86_64 or qemu-i386 - of course both compiled with their own cross compiler tools. I am currently trying this with other architectures (powerpc64) I can supply more, but what exactly would help you forward? --- Frans From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 25 04:16:34 2021 Received: (at 50151) by debbugs.gnu.org; 25 Aug 2021 08:16:34 +0000 Received: from localhost ([127.0.0.1]:45631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIo5J-0004Sp-Lf for submit@debbugs.gnu.org; Wed, 25 Aug 2021 04:16:33 -0400 Received: from mail-pg1-f177.google.com ([209.85.215.177]:41892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIo5I-0004Sc-9X for 50151@debbugs.gnu.org; Wed, 25 Aug 2021 04:16:32 -0400 Received: by mail-pg1-f177.google.com with SMTP id k24so22315701pgh.8 for <50151@debbugs.gnu.org>; Wed, 25 Aug 2021 01:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=usvlYrEBEe3TmIh3RvkmDTOv5YT8TY517Ic21RkaXbY=; b=mnbqtREPhKXuEUW31dxP94zcotGvlGHiILARCcdYhvLhEqozWq+oL3TglwvRREi8Jz v01mcG8W3JzalfnQhQSPmOw/k3xqnXbSX2RjWI3inqOGCC50ay4XHG+l5dKx7lNHHSgN pdvNn2MoIJvGyNp0eAI9YmQ+pVsYRaJY+uNuUFqRQAKglCaOezYtwmBQbmSmCdiXlCmc Y7fo5sB5l+K7msxjo6/1v/RVkuf/PtqOSnQXKkezRgSlScG7MuH23u5TqAQ9uS0zFp0u mry3JXW/yl31PGuUz0AkZ+x1KUsEKkdxYWbi0EEoLxUmcK/6XVFON1dINzfJORggsGOQ Irhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=usvlYrEBEe3TmIh3RvkmDTOv5YT8TY517Ic21RkaXbY=; b=XAu6p66ESB65y2pMgcAS7HxqpL2JQjT9b4WpGMaEBzW6TuxadEOOAjy0g0Nl0UF47y C97cxYEYPXKvodcLgR8emyqX4hrI3ySfpLcMisMipeKupDsWUPjThd/lhgH5Eut6pwOr onD9Cgd4rcnopou4AMCYggPA+hGasAoKmwcyyuGZ7WLEHsBW7Br3M8reGtUoeOu/+X/8 BaaxYuOsKQL2lP+a0I+FpYbucOQRhaz2vQe9Bo8z+weMkP3y7zAhzyoCwdGQgbRAbx13 JTiRv4Y8XmVMlqrOw+I2ovWfHxV62GV02Nse+OJwYolwvqvr0nNcNVDIDMXe+9g4lyUS XBHQ== X-Gm-Message-State: AOAM530CngGv6G1vYqbZK7JN7HdG/7YwIEY6YCE4oC9LM7bcI+zPNnUt //t3RdotqF8lNOeZQIZapN8= X-Google-Smtp-Source: ABdhPJy6LRNOD96ZFF2UXQtfEQdm9LJxiJPBg5mwlF7AE3oLMn7VsRa3s7zV6LlNZ6fYfXzXC/isKA== X-Received: by 2002:a65:508a:: with SMTP id r10mr40961543pgp.96.1629879386231; Wed, 25 Aug 2021 01:16:26 -0700 (PDT) Received: from tomato.moose.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id c14sm4197919pjr.3.2021.08.25.01.16.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Aug 2021 01:16:25 -0700 (PDT) Subject: Re: bug#50151: Coreutils, aarch64 and chroot To: Frans de Boer References: From: Assaf Gordon Message-ID: <352f0c71-cd1f-10c3-047d-f0f6462abb73@gmail.com> Date: Wed, 25 Aug 2021 02:16:24 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 50151 Cc: Paul Eggert , 50151@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) Hello, On 2021-08-24 2:39 a.m., Paul Eggert wrote: > However, I think it'll be a better use of our time for you to debug this > one yourself. It doesn't sound like a Coreutils problem; it sounds like > a problem in your virtual machine setup, and you're the best expert on > that setup. Few suggestions to check, that might help you and us to troubleshoot: 1. ensure the binaries are indeed for aarch64: file /newroot/usr/sbin/chroot file /newroot/usr/bin/env file /newroot/usr/bin/bash it should say something like "ELF 64-bit LSB pie executable, ARM aarch64" for all of them. 2. ensure each binary works by itself: qemu-aarch64 -L /newroot /newroot/usr/sbin/chroot --version qemu-aarch64 -L /newroot /newroot/usr/bin/env --version qemu-aarch64 -L /newroot /newroot/usr/bin/bash --version (the actual version doesn't matter here, the main thing is that the qemu user-mode emulator was able to run the binaries.) On 2021-08-21 4:33 a.m., Frans de Boer wrote: > > Running 'qemu-aarch64 -L /newroot /newroot/usr/bin/bash -c > /usr/bin/env> --help' does show the env help text. So, I guess chroot > is to blame? Note that the above command runs your *host's* /usr/bin/env because chroot is not used - the binary under qemu (/newroot/usr/bin/bash) sees your host's file system. Observe with: qemu-aarch64 -L /newroot /newroot/usr/bin/bash -c /bin/uname -m qemu-aarch64 -L /newroot /newroot/usr/bin/env /bin/uname -m I'm guessing you will see "x86_64", not "aarch64". 3. What you should try is: qemu-aarch64 -L /newroot \ /newroot/usr/bin/bash -c /newroot/usr/bin/env --version and: qemu-aarch64 -L /newroot \ /newroot/usr/bin/env /newroot/usr/bin/bash --version In both cases, one aarch64 binary will try to execute another aach64 binary. Do these work for you, or are you seeing an error? 4. Use qemu's "-strace" to see the syscalls, hopefully that will help pinpoint the cause: qemu-aarch64 -strace -L /newroot \ /newroot/usr/sbin/chroot /newroot /usr/bin/env --version 2&1 \ | tee log.txt If the command results in an error, the "log.txt" file will show more details about what failed. If you're not familiar with 'strace' output, post it here as an email attachment. Hope this helps, - assaf P.S. On 2021-08-24 2:39 a.m., Paul Eggert wrote: > A complete set of instructions for an outsider to reproduce the > problem from scratch. Assume the outsider is running Fedora 34 > x86-64 (since that's what I'm running :-). I'm not familiar with Fedora, but on Debian/x86_64 the following works: apt-get qemu-user apt-get install crossbuild-essential-arm64 libc6-arm64-cross cd coreutils ./configure --host=aarch64-linux-gnu make then: $ qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./src/uname -m aarch64 Somewhat related: $ qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./src/env ./src/uname -m /lib/ld-linux-aarch64.so.1: No such file or directory This fails because once "inside" qemu, the aarch64 searches for "/lib/ld-linux-aarch64.so.1" but the file is in "/usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1". One possible work-around is to build static binaries. I don't want to assume that is the culprit for Frans, so we'll wait for the logs... From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 25 15:15:40 2021 Received: (at 50151) by debbugs.gnu.org; 25 Aug 2021 19:15:40 +0000 Received: from localhost ([127.0.0.1]:47875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIyN8-0005Ev-PI for submit@debbugs.gnu.org; Wed, 25 Aug 2021 15:15:40 -0400 Received: from fransdb.nl ([80.101.31.146]:60786 helo=pubserv1.fransdb.nl) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIy2f-0004AM-3U for 50151@debbugs.gnu.org; Wed, 25 Aug 2021 14:54:32 -0400 Received: from localhost (localhost [127.0.0.1]) by pubserv1.fransdb.nl (Postfix) with ESMTP id 8231CA159B; Wed, 25 Aug 2021 20:54:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at fransdb.nl Received: from pubserv1.fransdb.nl ([127.0.0.1]) by localhost (pubserv1.fransdb.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kvyK_IDaRrOP; Wed, 25 Aug 2021 20:54:20 +0200 (CEST) Received: from [192.168.101.128] (fransdb.nl [80.101.31.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: frans@fransdb.nl) by pubserv1.fransdb.nl (Postfix) with ESMTPSA id A4C39A0BC8; Wed, 25 Aug 2021 20:54:20 +0200 (CEST) Subject: Re: bug#50151: Coreutils, aarch64 and chroot To: Assaf Gordon References: <352f0c71-cd1f-10c3-047d-f0f6462abb73@gmail.com> From: Frans de Boer Message-ID: <79ce7d70-e78e-4cdf-4084-4c1df1e130fe@fransdb.nl> Date: Wed, 25 Aug 2021 20:54:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <352f0c71-cd1f-10c3-047d-f0f6462abb73@gmail.com> Content-Type: multipart/mixed; boundary="------------4BA82EB897F2A7A35196378D" Content-Language: en-US X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 50151 X-Mailman-Approved-At: Wed, 25 Aug 2021 15:15:37 -0400 Cc: Paul Eggert , 50151@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) This is a multi-part message in MIME format. --------------4BA82EB897F2A7A35196378D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 8/25/21 10:16 AM, Assaf Gordon wrote: > Hello, > > On 2021-08-24 2:39 a.m., Paul Eggert wrote: >> However, I think it'll be a better use of our time for you to debug >> this one yourself. It doesn't sound like a Coreutils problem; it >> sounds like a problem in your virtual machine setup, and you're the >> best expert on that setup. > > Few suggestions to check, that might help you and us to troubleshoot: > > 1. ensure the binaries are indeed for aarch64: > >    file /newroot/usr/sbin/chroot >    file /newroot/usr/bin/env >    file /newroot/usr/bin/bash > > it should say something like >   "ELF 64-bit LSB pie executable, ARM aarch64" > for all of them. > > > 2. ensure each binary works by itself: > >  qemu-aarch64 -L /newroot /newroot/usr/sbin/chroot --version >  qemu-aarch64 -L /newroot /newroot/usr/bin/env --version >  qemu-aarch64 -L /newroot /newroot/usr/bin/bash --version > > (the actual version doesn't matter here, the main thing is that > the qemu user-mode emulator was able to run the binaries.) > > On 2021-08-21 4:33 a.m., Frans de Boer wrote: >> >> Running 'qemu-aarch64 -L /newroot /newroot/usr/bin/bash -c >> /usr/bin/env> --help' does show the env help text. So, I guess chroot >> is to blame? > Note that the above command runs your *host's* /usr/bin/env > because chroot is not used - the binary under qemu >  (/newroot/usr/bin/bash) sees your host's file system. > > Observe with: > >   qemu-aarch64 -L /newroot /newroot/usr/bin/bash -c /bin/uname -m >   qemu-aarch64 -L /newroot /newroot/usr/bin/env /bin/uname -m > > I'm guessing you will see "x86_64", not "aarch64". > > 3. What you should try is: > >   qemu-aarch64 -L /newroot \ >      /newroot/usr/bin/bash -c /newroot/usr/bin/env --version > and: >   qemu-aarch64 -L /newroot \ >      /newroot/usr/bin/env /newroot/usr/bin/bash --version > > In both cases, one aarch64 binary will try to execute another aach64 > binary. Do these work for you, or are you seeing an error? > > > > 4. Use qemu's "-strace" to see the syscalls, hopefully > that will help pinpoint the cause: > >   qemu-aarch64 -strace -L /newroot \ >       /newroot/usr/sbin/chroot /newroot /usr/bin/env --version 2&1 \ >           | tee log.txt > > If the command results in an error, the "log.txt" file will show > more details about what failed. > If you're not familiar with 'strace' output, post it here as an email > attachment. > > > Hope this helps, >  - assaf > > P.S. > > On 2021-08-24 2:39 a.m., Paul Eggert wrote: >> A complete set of instructions for an outsider to reproduce the >> problem from scratch.  Assume the outsider is running Fedora 34 >> x86-64 (since that's what I'm running :-). > I'm not familiar with Fedora, but on Debian/x86_64 the following works: > >    apt-get qemu-user >    apt-get install crossbuild-essential-arm64 libc6-arm64-cross > >    cd coreutils >    ./configure --host=aarch64-linux-gnu >    make > > then: > >     $ qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./src/uname -m >     aarch64 > > Somewhat related: > >     $ qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./src/env ./src/uname -m >     /lib/ld-linux-aarch64.so.1: No such file or directory > > This fails because once "inside" qemu, the aarch64 searches for > "/lib/ld-linux-aarch64.so.1" but the file is in > "/usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1". > One possible work-around is to build static binaries. > > I don't want to assume that is the culprit for Frans, so we'll wait > for the logs... > > @assaf: your suggestions no. 1 and 2, had the predicted results. Thus, suggestion no. 3 failed because of suggestion no.2. I followed then suggestion 4 and attached the strace output to this message. It seems that chroot is working as expected, only env seems to fail with an error. I hope you have some clue of what is going wrong. --- Frans. -- A: Yes, just like that A: Ja, net zo Q: Oh, Just like reading a book backwards Q: Oh, net als een boek achterstevoren lezen A: Because it upsets the natural flow of a story A: Omdat het de natuurlijke gang uit het verhaal haalt Q: Why is top-posting annoying? Q: Waarom is Top-posting zo irritant? --------------4BA82EB897F2A7A35196378D Content-Type: text/plain; charset=UTF-8; name="strace.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="strace.txt" MTM4OCBicmsoTlVMTCkgPSAweDAwMDAwMDAwMDA0MWIwMDAKMTM4OCB1bmFtZSgweDU1MDA3 ZmY2YjgpID0gMAoxMzg4IGZhY2Nlc3NhdChBVF9GRENXRCwiL2V0Yy9sZC5zby5wcmVsb2Fk IixSX09LLEFUX0VBQ0NFU1N8MHgzNGNjOCkgPSAtMSBlcnJubz0yIChObyBzdWNoIGZpbGUg b3IgZGlyZWN0b3J5KQoxMzg4IG9wZW5hdChBVF9GRENXRCwiL2V0Yy9sZC5zby5jYWNoZSIs T19SRE9OTFl8T19DTE9FWEVDKSA9IDMKMTM4OCBuZXdmc3RhdGF0KDMsIiIsMHgwMDAwMDA1 NTAwN2ZlYzkwLDB4MTAwMCkgPSAwCjEzOD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FVEFSWSIsT19S RE9OTFl8T19DTE9FWEVDKSA9IC0xIGVycm5vPTIgKE5vIHN1Y2ggZmlsZSBvciBkaXJlY3Rv cnkpCjEzODggcmVhZGxpbmthdChBVF9GRENXRCwiL21udCIsMHgwMDAwMDA1NTAwN2ZmMjYw LDEwMjMpID0gLTEgZXJybm89MjIgKEludmFsaWQgYXJndW1lbnQpCjEzODggcmVhZGxpbmth dChBVF9GRENXRCwiL21udC9sZnMiLDB4MDAwMDAwNTUwMDdmZjI2MCwxMDIzKSA9IC0xIGVy cm5vPTIyIChJbnZhbGlkIGFyZ3VtZW50KQoxMzg4IGNocm9vdCgiL21udC9sZnMiKSA9IDAK MTM4OCBjaGRpcigiLyIpID0gMAoxMzg4IGV4ZWN2ZSgiL3Vzci9iaW4vZW52Iix7Ii91c3Iv YmluL2VudiIsIi0tdmVyc2lvbiIsTlVMTH0pID0gLTEgZXJybm89OCAoRXhlYyBmb3JtYXQg ZXJyb3IpCjEzODggZXhlY3ZlKCIvYmluL3NoIix7Ii9iaW4vc2giLCIvdXNyL2Jpbi9lbnYi LCItLXZlcnNpb24iLE5VTEx9KSA9IC0xIGVycm5vPTggKEV4ZWMgZm9ybWF0IGVycm9yKQov bW50L2xmcy91c3Ivc2Jpbi9jaHJvb3Q6IDEzODggd3JpdGUoMiwweDdmZDE3MCwyNikgPSAy NgpmYWlsZWQgdG8gcnVuIGNvbW1hbmQgJy91c3IvYmluL2VudicxMzg4IHdyaXRlKDIsMHg3 ZmQyMjAsMzYpID0gMzYKOiBFeGVjIGZvcm1hdCBlcnJvcjEzODggd3JpdGUoMiwweDdmY2Qx MCwxOSkgPSAxOQoKMTM4OCB3cml0ZSgyLDB4N2ZkMTIwLDEpID0gMQoxMzg4IGNsb3NlKDEp ID0gMAo= --------------4BA82EB897F2A7A35196378D-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 25 19:26:06 2021 Received: (at 50151) by debbugs.gnu.org; 25 Aug 2021 23:26:06 +0000 Received: from localhost ([127.0.0.1]:48004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJ2HS-0004IG-Qh for submit@debbugs.gnu.org; Wed, 25 Aug 2021 19:26:06 -0400 Received: from mail-pg1-f171.google.com ([209.85.215.171]:39904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJ2HJ-0004Ha-92; Wed, 25 Aug 2021 19:25:57 -0400 Received: by mail-pg1-f171.google.com with SMTP id g184so1260109pgc.6; Wed, 25 Aug 2021 16:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=M6/ZGvaWGEghvpjzMBMEYWdx8Qk6JrQXZHSMypE+2ic=; b=ElDIyT+Bjxnxr0LwtN7GpAONUUNhhSJoF9086EQ70NJff6PIzYL1VekSE+VSs+H2vx iAGW/M4jWK2txXuxC01GQxmm3sP8ik0BbMpHXcVV1XDyDpAaw3fqCw0xpSyDvxpIblxf 9XtEhJfN022pQPod9btsL2k6AJqHjAcCIm6TELfIamWNp6hAxaOp33dLew4M7ZJo9Reo JQiN6KDyiWH3GbFAr9eD9CHk1LYl+H3K76Zon+QvScOYM6koQMT/bddxk/u1XgDJOScb xWmPXAzDiZiZhfEjnXaAcBaBE/KXntn3QHWwXZtxkgHkttwF8CGpBOQqCeJ12yf0VQUo leSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=M6/ZGvaWGEghvpjzMBMEYWdx8Qk6JrQXZHSMypE+2ic=; b=rytHMkLXFPlWdRkH/+7GsD/qD2t/IPXv/TsxHedqn14XmKQlgJkgkI8djx57I5hRVC GIHjwKR1DQaI1vbjVqWD9CSTDdeR7XtMJLwJO29i7L2GYEougRagIQWfStGhR0n3zrE8 XC3tcdeTZ8R3X3SDGKwmqXHo6/RbyTL+t8JQFqCeeTfO5ElMUCie7BKHFZ9i1QBHqb3D 6VhKGDdmcnWY3z02kGHMKOUmftSr28vscfi30/OWqDv+ZHjTKY130uaCyxZWLqIdZQgQ N8A9y7AwAZSBV9KEHL8BSP8EgQMcw5lfQ3bHDgsGWMNg8tF/UYTLZtxv3rvhrr8EoemT rCCA== X-Gm-Message-State: AOAM530/41JExoEhxn+Jy0d02QvhYU0YWSi0a4sq991yKWS536u0KJBn ECCzJp+/5oJI0N68nmzEl/THMeoGaUA= X-Google-Smtp-Source: ABdhPJzsK1wIP8vg6z/TxWzjX+aj7VbX1RQ9sSG00RjGqU8PLL66/T2AIyKHc9LmFXF7nI6KwglaVg== X-Received: by 2002:a63:62c7:: with SMTP id w190mr589502pgb.105.1629933946823; Wed, 25 Aug 2021 16:25:46 -0700 (PDT) Received: from tomato.moose.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id j16sm708348pfi.165.2021.08.25.16.25.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Aug 2021 16:25:46 -0700 (PDT) Subject: Re: bug#50151: Coreutils, aarch64 and chroot To: Frans de Boer References: <352f0c71-cd1f-10c3-047d-f0f6462abb73@gmail.com> <79ce7d70-e78e-4cdf-4084-4c1df1e130fe@fransdb.nl> From: Assaf Gordon Message-ID: Date: Wed, 25 Aug 2021 17:25:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <79ce7d70-e78e-4cdf-4084-4c1df1e130fe@fransdb.nl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 50151 Cc: Paul Eggert , 50151@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) tag 50151 notabug close 50151 stop On 2021-08-25 12:54 p.m., Frans de Boer wrote: > On 8/25/21 10:16 AM, Assaf Gordon wrote: >>   qemu-aarch64 -strace -L /newroot \ >>       /newroot/usr/sbin/chroot /newroot /usr/bin/env --version 2&1 \ >>           | tee log.txt >> > @assaf: your suggestions no. 1 and 2, had the predicted results. Thus, > suggestion no. 3 failed because of suggestion no.2. I followed then > suggestion 4 and attached the strace output to this message. It seems > that chroot is working as expected, only env seems to fail with an error. Not exactly: The 'chroot' system-call *seems* to succeed, followed by a failed "execve(2)" system call to execute another binary. That "execve" system fails - so it is not 'env' per-se, it is any program that will try to execute another aarch64 binary. Learning that, searching for "qemu-user", "chroot" and "architecture" leads to several web pages detailing similar errors (and few suggested solutions): https://wiki.gentoo.org/wiki/Crossdev_qemu-static-user-chroot https://newbedev.com/how-can-i-chroot-into-a-filesystem-with-a-different-architechture https://ownyourbits.com/2018/06/13/transparently-running-binaries-from-any-architecture-in-linux-with-qemu-and-binfmt_misc/ > I hope you have some clue of what is going wrong. With the above information, we can conclude this is not a bug in coreutils - it is a limitation of the linux+qemu-user setup. So I'm closing this item and marking it as "not a bug", but discussion can continue by replying to this thread. regards, - assaf From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 26 04:00:52 2021 Received: (at 50151) by debbugs.gnu.org; 26 Aug 2021 08:00:52 +0000 Received: from localhost ([127.0.0.1]:48334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJAJc-0004hq-N6 for submit@debbugs.gnu.org; Thu, 26 Aug 2021 04:00:52 -0400 Received: from fransdb.nl ([80.101.31.146]:39146 helo=pubserv1.fransdb.nl) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJAJX-0004gy-38 for 50151@debbugs.gnu.org; Thu, 26 Aug 2021 04:00:47 -0400 Received: from localhost (localhost [127.0.0.1]) by pubserv1.fransdb.nl (Postfix) with UTF8SMTP id 69930A098E; Thu, 26 Aug 2021 10:00:36 +0200 (CEST) X-Virus-Scanned: amavisd-new at fransdb.nl Received: from pubserv1.fransdb.nl ([127.0.0.1]) by localhost (pubserv1.fransdb.nl [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id FbGgCESepveB; Thu, 26 Aug 2021 10:00:35 +0200 (CEST) Received: from [IPV6:2001:980:3f2a:0:583a:22ff:fe40:ea80] (unknown [IPv6:2001:980:3f2a:0:583a:22ff:fe40:ea80]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: frans@fransdb.nl) by pubserv1.fransdb.nl (Postfix) with UTF8SMTPSA id 735C3A03C2; Thu, 26 Aug 2021 10:00:35 +0200 (CEST) Message-ID: <9bc1ffb2-894d-a71b-bd1d-e9e27d83a481@fransdb.nl> Date: Thu, 26 Aug 2021 10:00:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.1 Subject: Re: bug#50151: Coreutils, aarch64 and chroot Content-Language: en-US To: Assaf Gordon References: <352f0c71-cd1f-10c3-047d-f0f6462abb73@gmail.com> <79ce7d70-e78e-4cdf-4084-4c1df1e130fe@fransdb.nl> From: Frans de Boer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 50151 Cc: Paul Eggert , 50151@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) On 8/26/21 01:25, Assaf Gordon wrote: > tag 50151 notabug > close 50151 > stop > > On 2021-08-25 12:54 p.m., Frans de Boer wrote: >> On 8/25/21 10:16 AM, Assaf Gordon wrote: >>>   qemu-aarch64 -strace -L /newroot \ >>>       /newroot/usr/sbin/chroot /newroot /usr/bin/env --version 2&1 \ >>>           | tee log.txt >>> >> @assaf: your suggestions no. 1 and 2, had the predicted results. >> Thus, suggestion no. 3 failed because of suggestion no.2. I followed >> then suggestion 4 and attached the strace output to this message. It >> seems that chroot is working as expected, only env seems to fail with >> an error. > > Not exactly: > The 'chroot' system-call *seems* to succeed, > followed by a failed "execve(2)" system call to execute another binary. > That "execve" system fails - so it is not 'env' per-se, > it is any program that will try to execute another aarch64 binary. > > Learning that, searching for "qemu-user", "chroot" and "architecture" > leads to several web pages detailing similar errors (and few suggested > solutions): > > https://wiki.gentoo.org/wiki/Crossdev_qemu-static-user-chroot > > https://newbedev.com/how-can-i-chroot-into-a-filesystem-with-a-different-architechture > > > https://ownyourbits.com/2018/06/13/transparently-running-binaries-from-any-architecture-in-linux-with-qemu-and-binfmt_misc/ > > >> I hope you have some clue of what is going wrong. > > With the above information, we can conclude this is not a bug > in coreutils - it is a limitation of the linux+qemu-user setup. > > So I'm closing this item and marking it as "not a bug", > but discussion can continue by replying to this thread. > > regards, >  - assaf > Okay, thanks anyhow for your effort. I will explore the suggested solutions next. I was not sure, but I tried the same also with x86_64 cross compiled programs using qemu-i386, which worked. So, using your conclusion too, it looks like qemu is not behaving as expected. Regards, Frans. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 26 04:19:21 2021 Received: (at 50151) by debbugs.gnu.org; 26 Aug 2021 08:19:21 +0000 Received: from localhost ([127.0.0.1]:48358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJAbV-0005BD-Mb for submit@debbugs.gnu.org; Thu, 26 Aug 2021 04:19:21 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:51411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJAbQ-0005B0-EH for 50151@debbugs.gnu.org; Thu, 26 Aug 2021 04:19:16 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4GwG335CX3z1qxld; Thu, 26 Aug 2021 10:19:11 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4GwG330pXXz1r6Np; Thu, 26 Aug 2021 10:19:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id dsc7QnOQ6DJu; Thu, 26 Aug 2021 10:19:10 +0200 (CEST) X-Auth-Info: 5f97pR2TwSlY5GHoPXIPP8afKEa3Ubucur14iNyAQStIIORMJxBfSIZHoW9CQQzr Received: from igel.home (ppp-46-244-172-67.dynamic.mnet-online.de [46.244.172.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 26 Aug 2021 10:19:10 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 2F6CD2C25AD; Thu, 26 Aug 2021 10:19:09 +0200 (CEST) From: Andreas Schwab To: Frans de Boer Subject: Re: bug#50151: Coreutils, aarch64 and chroot References: <352f0c71-cd1f-10c3-047d-f0f6462abb73@gmail.com> <79ce7d70-e78e-4cdf-4084-4c1df1e130fe@fransdb.nl> <9bc1ffb2-894d-a71b-bd1d-e9e27d83a481@fransdb.nl> X-Yow: I can see you GUYS an' GALS need a LOT of HELP...You're all very STUPID!! I used to be STUPID, too..before I started watching UHF-TV!! Date: Thu, 26 Aug 2021 10:19:09 +0200 In-Reply-To: <9bc1ffb2-894d-a71b-bd1d-e9e27d83a481@fransdb.nl> (Frans de Boer's message of "Thu, 26 Aug 2021 10:00:26 +0200") Message-ID: <87o89kvcsi.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 50151 Cc: Assaf Gordon , 50151@debbugs.gnu.org, Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) On Aug 26 2021, Frans de Boer wrote: > I was not sure, but I tried the same also with x86_64 cross compiled > programs using qemu-i386, which worked. Of course, they can be natively executed. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 26 05:14:32 2021 Received: (at 50151) by debbugs.gnu.org; 26 Aug 2021 09:14:32 +0000 Received: from localhost ([127.0.0.1]:48390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJBSy-0006UJ-De for submit@debbugs.gnu.org; Thu, 26 Aug 2021 05:14:32 -0400 Received: from fransdb.nl ([80.101.31.146]:39148 helo=pubserv1.fransdb.nl) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJBSs-0006Tz-DB for 50151@debbugs.gnu.org; Thu, 26 Aug 2021 05:14:30 -0400 Received: from localhost (localhost [127.0.0.1]) by pubserv1.fransdb.nl (Postfix) with UTF8SMTP id C3410A0A99; Thu, 26 Aug 2021 11:14:19 +0200 (CEST) X-Virus-Scanned: amavisd-new at fransdb.nl Received: from pubserv1.fransdb.nl ([127.0.0.1]) by localhost (pubserv1.fransdb.nl [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id cpwuWuW8JrMJ; Thu, 26 Aug 2021 11:14:19 +0200 (CEST) Received: from [IPV6:2001:980:3f2a:0:583a:22ff:fe40:ea80] (unknown [IPv6:2001:980:3f2a:0:583a:22ff:fe40:ea80]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: frans@fransdb.nl) by pubserv1.fransdb.nl (Postfix) with UTF8SMTPSA id 42DA2A098E; Thu, 26 Aug 2021 11:14:19 +0200 (CEST) Message-ID: <0243f765-c03a-6442-6a09-d945f4210734@fransdb.nl> Date: Thu, 26 Aug 2021 11:14:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.1 Subject: Re: bug#50151: Coreutils, aarch64 and chroot Content-Language: en-US To: Andreas Schwab References: <352f0c71-cd1f-10c3-047d-f0f6462abb73@gmail.com> <79ce7d70-e78e-4cdf-4084-4c1df1e130fe@fransdb.nl> <9bc1ffb2-894d-a71b-bd1d-e9e27d83a481@fransdb.nl> <87o89kvcsi.fsf@igel.home> From: Frans de Boer In-Reply-To: <87o89kvcsi.fsf@igel.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 50151 Cc: Assaf Gordon , 50151@debbugs.gnu.org, Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) On 8/26/21 10:19, Andreas Schwab wrote: > On Aug 26 2021, Frans de Boer wrote: > >> I was not sure, but I tried the same also with x86_64 cross compiled >> programs using qemu-i386, which worked. > Of course, they can be natively executed. > > Andreas. > I understand now better how things are connected. Until some time ago I always used qemu-system-xxx, but have failed to understand that the qemu-xxx user emulation is only about the cpu. So, starting programs with a different coding will fail. The binfmt is the way to solve this issue. Now only find a decent explanation how to setup the /etc/binfmt.d/register for the aarch64, powerpc and maybe other architectures. At kernel.org there is an explanation, but fairly limited and thus not very helpful at this point in time. I keep on digging. Frans From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 26 05:38:54 2021 Received: (at 50151) by debbugs.gnu.org; 26 Aug 2021 09:38:54 +0000 Received: from localhost ([127.0.0.1]:48405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJBqY-00076k-1O for submit@debbugs.gnu.org; Thu, 26 Aug 2021 05:38:54 -0400 Received: from fransdb.nl ([80.101.31.146]:39150 helo=pubserv1.fransdb.nl) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJBqW-00076V-I0 for 50151@debbugs.gnu.org; Thu, 26 Aug 2021 05:38:53 -0400 Received: from localhost (localhost [127.0.0.1]) by pubserv1.fransdb.nl (Postfix) with UTF8SMTP id 445D7A0A99; Thu, 26 Aug 2021 11:38:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at fransdb.nl Received: from pubserv1.fransdb.nl ([127.0.0.1]) by localhost (pubserv1.fransdb.nl [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id ACpgg9AR-7TP; Thu, 26 Aug 2021 11:38:45 +0200 (CEST) Received: from [IPV6:2001:980:3f2a:0:583a:22ff:fe40:ea80] (unknown [IPv6:2001:980:3f2a:0:583a:22ff:fe40:ea80]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: frans@fransdb.nl) by pubserv1.fransdb.nl (Postfix) with UTF8SMTPSA id AA48CA0502; Thu, 26 Aug 2021 11:38:45 +0200 (CEST) Message-ID: <14dbfc18-3605-5d1b-4c8b-2eb084d8704f@fransdb.nl> Date: Thu, 26 Aug 2021 11:38:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.1 Subject: Re: bug#50151: Coreutils, aarch64 and chroot Content-Language: en-US From: Frans de Boer To: Andreas Schwab References: <352f0c71-cd1f-10c3-047d-f0f6462abb73@gmail.com> <79ce7d70-e78e-4cdf-4084-4c1df1e130fe@fransdb.nl> <9bc1ffb2-894d-a71b-bd1d-e9e27d83a481@fransdb.nl> <87o89kvcsi.fsf@igel.home> <0243f765-c03a-6442-6a09-d945f4210734@fransdb.nl> In-Reply-To: <0243f765-c03a-6442-6a09-d945f4210734@fransdb.nl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 50151 Cc: Assaf Gordon , 50151@debbugs.gnu.org, Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) On 8/26/21 11:14, Frans de Boer wrote: > On 8/26/21 10:19, Andreas Schwab wrote: >> On Aug 26 2021, Frans de Boer wrote: >> >>> I was not sure, but I tried the same also with x86_64 cross compiled >>> programs using qemu-i386, which worked. >> Of course, they can be natively executed. >> >> Andreas. >> > I understand now better how things are connected. Until some time ago > I always used qemu-system-xxx, but have failed to understand that the > qemu-xxx user emulation is only about the cpu. So, starting programs > with a different coding will fail. The binfmt is the way to solve this > issue. Now only find a decent explanation how to setup the > /etc/binfmt.d/register for the aarch64, powerpc and maybe other > architectures. > At kernel.org there is an explanation, but fairly limited and thus not > very helpful at this point in time. > > I keep on digging. > > Frans Ok, found the magic number list and (mostly) how to read it. Time to experiment... Frans. -- A: Yes, just like that A: Ja, net zo Q: Oh, Just like reading a book backwards Q: Oh, net als een boek achterstevoren lezen A: Because it upsets the natural flow of a story A: Omdat het de natuurlijke gang uit het verhaal haalt Q: Why is top-posting annoying? Q: Waarom is Top-posting zo irritant? From unknown Fri Jun 20 07:16:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 23 Sep 2021 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator