From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3AC53C83F09 for ; Tue, 8 Jul 2025 15:32:15 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4bc4q164JYz3bjG; Wed, 9 Jul 2025 01:32:13 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=115.124.30.131 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1751988733; cv=none; b=LWMqC9KkVv/v00bTZl6ZIcq/fEqTVDnJs7BDcN/TUE3kVc9nNEP3QaALNIE9HR7TSxeV/3V/aXc0rFg3Di7s2TMvf3HpAnrOXCs4jhH7aE+HRN5Y+cLq9MYifeE8o+k8md96VwsuVF1XawstxLvNyYnfXafpobzfxFPw/sXc13wpqYLJBP1b+RIzWIMM+r+3EWojsJa35ECDXhwm9cC7DiU5Ky5D24n6qxKRLfSRbrC7rb4EiPiURT0SvJbadlXX4Y2JYdfpVk/pyxwlF18XNYmXs1WGCslGiBsn/4t1Db2jC/LPlUjIFgJFsvlfPenEKIy7pQ1hwZiHwwHBONe37g== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1751988733; c=relaxed/relaxed; bh=EeG7VhJ+3VL+xoKGwYSETtPL5tcP8qm4ksM/Bn5qQkg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Nku1oxnS9lpF1+6YSKdBU6TXf8ZRl1S/wTAMNFsh4RFaikY9hs6T2Vrw8jHZhDyryFIuZpHYQyd85A2ZpDyn6fAQ9hiru4LznOV5k7t9r5eX00LEBMR12tKyjqtBMtBXjOSqNrmA+KSGNiq9WVM00jJaDigNEn4VVj/l97LrO0ZHIXS78ey7FaMBp5HvxPyHHoOKls0aiRMaMmoiJn0BjNfYrAQ5blI4tnv09NCtb6ZBbaZQEtCJVWKY7oKsyK7znti0IKHiLqhDoXeYBP4yMp6bmDajRNQGDTl6Nc/u7IydJTcAFGLTNdlWX5JA4JVGKuW0ulTGSV7nl5uZZ06JZw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=tBmnK4KD; dkim-atps=neutral; spf=pass (client-ip=115.124.30.131; helo=out30-131.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=lists.ozlabs.org) smtp.mailfrom=linux.alibaba.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=tBmnK4KD; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.131; helo=out30-131.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=lists.ozlabs.org) Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4bc4q012fsz3bVW for ; Wed, 9 Jul 2025 01:32:10 +1000 (AEST) DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1751988726; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=EeG7VhJ+3VL+xoKGwYSETtPL5tcP8qm4ksM/Bn5qQkg=; b=tBmnK4KDH636pBRDuHr9aNhj5NP9hTS7VRSodi/5kFhl0Ik5tH0xLK4R1+x7N7Ux+oxPq414uVHqE8DzkXtmTxeY/TxsZNRAomPO+Xqpwn4So1HSu7KA/x87SL1W+SYXPU/0VQtipJxmtILVDWtRcf8ZV31nLJ7O84oUysMlpmU= Received: from 30.170.233.0(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WiPlTZ4_1751988724 cluster:ay36) by smtp.aliyun-inc.com; Tue, 08 Jul 2025 23:32:05 +0800 Message-ID: <6216008a-dc0c-4f90-a67c-36bead99d7f2@linux.alibaba.com> Date: Tue, 8 Jul 2025 23:32:03 +0800 X-Mailing-List: linux-erofs@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Executable loading issues with erofs on arm? To: Jan Kiszka , Gao Xiang , Chao Yu , linux-erofs@lists.ozlabs.org Cc: Linux Kernel Mailing List References: <38d43fae-1182-4155-9c5b-ffc7382d9917@siemens.com> <452a2155-ab3b-43d1-8783-0f1db13a675f@siemens.com> <81a3d28b-4570-4d44-8ed6-51158353c0ff@siemens.com> From: Gao Xiang In-Reply-To: <81a3d28b-4570-4d44-8ed6-51158353c0ff@siemens.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2025/7/8 23:22, Jan Kiszka wrote: > On 08.07.25 17:12, Gao Xiang wrote: >> Hi Jan, >> >> On 2025/7/8 20:43, Jan Kiszka wrote: >>> On 08.07.25 14:41, Jan Kiszka wrote: >>>> Hi all, >>>> >>>> for some days, I'm trying to understand if we have an integration issue >>>> with erofs or rather some upstream bug. After playing with various >>>> parameters, it rather looks like the latter: >>>> >>>> $ ls -l erofs-dir/ >>>> total 132 >>>> -rwxr-xr-x 1 1000 users 132868 Jul  8 10:50 dash >>>> (from Debian bookworm) >>>> $ mkfs.erofs -z lz4hc erofs.img erofs-dir/ >>>> mkfs.erofs 1.8.6 (trixie version, but same happens with bookworm 1.5) >>>> Build completed. >>>> ------ >>>> Filesystem UUID: aae0b2f0-4ee4-4850-af49-3c1aad7fa30c >>>> Filesystem total blocks: 17 (of 4096-byte blocks) >>>> Filesystem total inodes: 2 >>>> Filesystem total metadata blocks: 1 >>>> Filesystem total deduplicated bytes (of source files): 0 >>>> >>>> Now I have 6.15-rc5 and a defconfig-close setting for the 32-bit ARM >>>> target BeagleBone Black. When booting into init=/bin/sh, then running >>>> >>>> # mount -t erofs /dev/mmcblk0p1 /mnt >>>> erofs (device mmcblk0p1): mounted with root inode @ nid 36. >>>> # /mnt/dash >>>> Segmentation fault >>>> >>>> I once also got this: >>>> >>>> Alignment trap: not handling instruction 2b00 at [<004debc0>] >>>> 8<--- cut here --- >>>> Unhandled fault: alignment exception (0x001) at 0x000004d9 >>>> [000004d9] *pgd=00000000 >>>> Bus error >>>> >>>> All is fine if I >>>>   - run the command once more >>>>   - dump the file first (cat /mnt/dash > /dev/null; /mnt/dash) >>> >>> Forgot to mention: That first dump when done via md5sum or so actually >>> gives the right checksum. So pure reading of the binary is also ok, just >>> trying to load it for execution fails on the first attempt. >> >> Thanks for your report.  I rarely take care arm32 platform >> because I don't have such setup. >> >> but could you share a reproducible rootfs image and >> I wonder if qemu could reproduce this? > > The image can be generated from isar-cip-core > (https://gitlab.com/cip-project/cip-core/isar-cip-core), bbb image with > swupdate extension and erofs as immutable rootfs. As I wrote, those will > be 6.12 or 6.1 based, but I also injected a mainline kernel into that > with the same result. But all that only helps if you have some > beaglebone black in reach right now. Could you check 5.4 lts, 5.15 lts, 5.10 lts if possible? I wonder if it's a regression or it does not work from the beginning. Anyway, I have no chance to look after arm32 due to lack of use cases and hardware resource. > > The same configuration, just for qemuarm as target, unfortunately does > not reproduce the issue. That is too bad for me honestly because I do think it's much easier for me to quickly shooting down with a reproducable environment on my side... > >> >> Otherwise it's hard for me to debug this issue... > > If you tell me how I could do that, I'm happy to instrument and analyze. > I just have no understanding of erofs yet, specifically how reading > files might be different from loading executables. I have no idea too. But it seems this issue is quite similar to https://lore.kernel.org/r/76f0ea6f-d4c2-434a-8ca5-4bd93921209f@linux.alibaba.com/T/#t I've given several ways to help finding the cause, but it seems that data checksum is all good, and that issue is still not resolved now either. Thanks, Gao Xiang > > Jan >