From nobody Sun Jun 25 09:31:59 2023 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qpm2m08Kmz4j1yG for ; Sun, 25 Jun 2023 09:32:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qpm2l5PnPz40TW for ; Sun, 25 Jun 2023 09:31:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687685519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WJVh2iNf3lIpzyUCb8e4WavRV7I6TmQmohF4DWiiUxw=; b=O6lkkuB/doHd5jJ02QBjwkZ7Aav/0gubWPkO+jtgq2B9hMh3bh5GoIsWbeaIm/Vl8xJUET kClOYqKPwb/qVsoCkNfMdrjQNeXbQQLQfAYrIOPW8SZ8LihAZprYTHzanORbqhglsilNvx HSknEYaEc3dGgT9KcMcsHbqfOadOdwiCcvSeiZOhOvcfuFZ8qpLmqZSd0oj+oyLFeGXtS7 mHvhKMalht/fpNYlREShOxurf+EV7lftfhxuPg+zcxmDwOX7Xz3ip3Ca/Y4zSeOtuhGUDH 0d5dKgss8RgK4EuKVOC9dhtn7+lMeIUcborE/UXWmoDqVqdUUzy/8pUn07hBTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687685519; a=rsa-sha256; cv=none; b=pvlzLNYVUZp75xOLf1ozAKQzgB1CAC19EA0/0MSVuJ8dBRAUcvdTIxO+MSzza7sq24J16Q XAPDI62mmvou0cCYjzjeBn2LhQ66DV9muoEfPjsiHmBKQaVk2rRRD7q5tIlTLc6XY0zpV8 uSjfhR5rctRxloGz2sP2bRpefGqjgBPAiRcLXBlBVjnPlQg3v/nN+q/vRsf+TUZpgmqMvM yLaMiFRT4bFzbKs6kUrIVpvG6hoGlu944Op/rWgbNo6PDzMd5lq5zgl1VQWNHCKjXd4s+7 +rSvaHtN35vIvVMMX/JJ9Zl25TrAlHJ9I5q9kOJ2KprrgBhpI8ehe0MlrXynrg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qpm2l4SfMzN37 for ; Sun, 25 Jun 2023 09:31:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 35P9Vxov047244 for ; Sun, 25 Jun 2023 09:31:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35P9VxWn047243 for ports-bugs@FreeBSD.org; Sun, 25 Jun 2023 09:31:59 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 272203] git crashes on start in rtld on AArch64 Date: Sun, 25 Jun 2023 09:31:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: theraven@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: garga@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272203 Bug ID: 272203 Summary: git crashes on start in rtld on AArch64 Product: Ports & Packages Version: Latest Hardware: arm64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: garga@FreeBSD.org Reporter: theraven@FreeBSD.org Assignee: garga@FreeBSD.org Flags: maintainer-feedback?(garga@FreeBSD.org) Using the latest package (same behaviour on the version from the stable bra= nch) on AArch64: ``` $ uname -a FreeBSD freebsd 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC arm64 $ pkg info git git-2.41.0 Name : git Version : 2.41.0 Installed on : Sat Jun 24 12:14:59 2023 UTC Origin : devel/git Architecture : FreeBSD:13:aarch64 Prefix : /usr/local Categories : devel Licenses : GPLv2 Maintainer : garga@FreeBSD.org WWW : https://git-scm.com/ Comment : Distributed source code management tool Options : CONTRIB : on CURL : on GITWEB : on HTMLDOCS : off ICONV : on NLS : on PCRE2 : on PERL : on SEND_EMAIL : on SUBTREE : on Shared Libs required: libpcre2-8.so.0 libintl.so.8 libexpat.so.1 libcurl.so.4 Annotations : FreeBSD_version: 1301000 cpe : cpe:2.3:a:git-scm:git:2.41.0:::::freebsd13:aarch64 flavor : default repo_type : binary repository : FreeBSD Flat size : 33.4MiB Description : Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficien= cy. WWW: https://git-scm.com/ $ git Bus error (core dumped) $ lldb git (lldb) target create "git" Current executable set to 'git' (aarch64). (lldb) r Process 6542 launched: '/usr/local/bin/git' (aarch64) This version of LLDB has no plugin for the language "assembler". Inspection= of frame variables will be limited. Process 6542 stopped * thread #1, name =3D 'git', stop reason =3D signal SIGBUS: hardware error frame #0: 0x00003dcda641e08c ld-elf.so.1`memset at memset.S:136 (lldb) bt * thread #1, name =3D 'git', stop reason =3D signal SIGBUS: hardware error * frame #0: 0x00003dcda641e08c ld-elf.so.1`memset at memset.S:136 frame #1: 0x00003dcda64188f8 ld-elf.so.1`map_object(fd=3D3, path=3D"/usr/local/lib/libpcre2-8.so.0", sb=3D0x00000000811450e0) at map_object.c:262:3 frame #2: 0x00003dcda64133f8 ld-elf.so.1`load_object [inlined] do_load_object(fd=3D3, name=3D"libpcre2-8.so.0", path=3D, sbp=3D0x00000000811450e0, flags=3D0) at rtld.c:2833:11 frame #3: 0x00003dcda64133a8 ld-elf.so.1`load_object(name=3D"libpcre2-8.so.0", fd_u=3D, refobj=3D, flags=3D0) at rtld.c:2805:11 frame #4: 0x00003dcda640d200 ld-elf.so.1`_rtld [inlined] process_needed(obj=3D0x00000000820ac008, needed=3D0x00000000820a9028, flags= =3D0) at rtld.c:2638:23 frame #5: 0x00003dcda640d1e0 ld-elf.so.1`_rtld [inlined] load_needed_objects(first=3D, flags=3D0) at rtld.c:2659:6 frame #6: 0x00003dcda640d1c0 ld-elf.so.1`_rtld(sp=3D, exit_proc=3D0x0000000081146cc0, objp=3D) at rtld.c:861:9 frame #7: 0x00003dcda640b0d8 ld-elf.so.1`.rtld_start at rtld_start.S:41 (lldb) disas ld-elf.so.1`memset: 0x3dcda641e000 <+0>: dup v0.16b, w1 0x3dcda641e004 <+4>: add x4, x0, x2 0x3dcda641e008 <+8>: cmp x2, #0x60 0x3dcda641e00c <+12>: b.hi 0x3dcda641e084 ; <+132> 0x3dcda641e010 <+16>: cmp x2, #0x10 0x3dcda641e014 <+20>: b.hs 0x3dcda641e054 ; <+84> 0x3dcda641e018 <+24>: mov x1, v0.d[0] 0x3dcda641e01c <+28>: tbz w2, #0x3, 0x3dcda641e030 ; <+48> 0x3dcda641e020 <+32>: str x1, [x0] 0x3dcda641e024 <+36>: stur x1, [x4, #-0x8] 0x3dcda641e028 <+40>: ret=20=20=20=20 0x3dcda641e02c <+44>: nop=20=20=20=20 0x3dcda641e030 <+48>: tbz w2, #0x2, 0x3dcda641e040 ; <+64> 0x3dcda641e034 <+52>: str w1, [x0] 0x3dcda641e038 <+56>: stur w1, [x4, #-0x4] 0x3dcda641e03c <+60>: ret=20=20=20=20 0x3dcda641e040 <+64>: cbz x2, 0x3dcda641e050 ; <+80> 0x3dcda641e044 <+68>: strb w1, [x0] 0x3dcda641e048 <+72>: tbz w2, #0x1, 0x3dcda641e050 ; <+80> 0x3dcda641e04c <+76>: sturh w1, [x4, #-0x2] 0x3dcda641e050 <+80>: ret=20=20=20=20 0x3dcda641e054 <+84>: str q0, [x0] 0x3dcda641e058 <+88>: tbnz w2, #0x6, 0x3dcda641e070 ; <+112> 0x3dcda641e05c <+92>: stur q0, [x4, #-0x10] 0x3dcda641e060 <+96>: tbz w2, #0x5, 0x3dcda641e06c ; <+108> 0x3dcda641e064 <+100>: str q0, [x0, #0x10] 0x3dcda641e068 <+104>: stur q0, [x4, #-0x20] 0x3dcda641e06c <+108>: ret=20=20=20=20 0x3dcda641e070 <+112>: str q0, [x0, #0x10] 0x3dcda641e074 <+116>: stp q0, q0, [x0, #0x20] 0x3dcda641e078 <+120>: stp q0, q0, [x4, #-0x20] 0x3dcda641e07c <+124>: ret=20=20=20=20 0x3dcda641e080 <+128>: nop=20=20=20=20 0x3dcda641e084 <+132>: and w1, w1, #0xff 0x3dcda641e088 <+136>: and x3, x0, #0xfffffffffffffff0 -> 0x3dcda641e08c <+140>: str q0, [x0] 0x3dcda641e090 <+144>: cmp x2, #0x100 (lldb) register read x0 x0 =3D 0x0000000082c1ea40 $ procstat -v 6542 PID START END PRT RES PRES REF SHD FLAG TP = PATH 6542 0x200000 0x2b3000 r-- 179 840 5 1 CN--- vn /usr/local/bin/git 6542 0x2c2000 0x53b000 r-x 633 840 5 1 CN--- vn /usr/local/bin/git 6542 0x54a000 0x54b000 rw- 1 0 1 0 C---- vn /usr/local/bin/git 6542 0x55a000 0x56b000 rw- 17 840 5 1 CN--- vn /usr/local/bin/git 6542 0x56b000 0x592000 rw- 1 1 1 0 ----- df= =20 6542 0x41148000 0x81128000 --- 0 0 0 0 ----- gd= =20 6542 0x81128000 0x81148000 rw- 4 4 1 0 ---D- df= =20 6542 0x820a9000 0x820ca000 rw- 7 7 1 0 ----- df= =20 6542 0x82b48000 0x82b70000 r-- 8 8 5 1 CN--- vn /usr/local/lib/libpcre2-8.so.0.11.2 6542 0x82b70000 0x82b7f000 --- 0 0 0 0 CN--- gd= =20 6542 0x82b7f000 0x82bff000 r-x 0 8 5 1 CN--- vn /usr/local/lib/libpcre2-8.so.0.11.2 6542 0x82bff000 0x82c0e000 --- 0 0 0 0 CN--- gd= =20 6542 0x82c0e000 0x82c0f000 rw- 0 8 5 1 CN--- vn /usr/local/lib/libpcre2-8.so.0.11.2 6542 0x82c0f000 0x82c1e000 --- 0 0 0 0 CN--- gd= =20 6542 0x82c1e000 0x82c1f000 rw- 0 0 1 0 C---- vn /usr/local/lib/libpcre2-8.so.0.11.2 6542 0x83aca000 0x83acb000 r-- 1 8 5 1 CN--- vn /usr/local/lib/libpcre2-8.so.0.11.2 6542 0x3dcda63f5000 0x3dcda63fc000 r-- 7 28 109 51 CN--- vn /libexec/ld-elf.so.1 6542 0x3dcda640b000 0x3dcda6420000 r-x 21 0 1 0 C---- vn /libexec/ld-elf.so.1 6542 0x3dcda642f000 0x3dcda6430000 r-- 1 0 1 0 C---- vn /libexec/ld-elf.so.1 6542 0x3dcda643f000 0x3dcda6440000 rw- 1 0 1 0 C---- vn /libexec/ld-elf.so.1 6542 0x3dcda6440000 0x3dcda6441000 rw- 1 1 1 0 ----- df= =20 6542 0xfffffffff000 0x1000000000000 r-x 1 1 32 0 ----- ph= =20 ``` I don't believe this is a bug in git itself, since it appears to be trigger= ed before any user code runs. If I'm reading the disassembly correctly, it's slightly dubious that the str instruction appears to be using the same regi= ster as the address the address as the value stored. This appears to be from the Linaro string routines, which are [unchanged in CURRENT](https://github.com/freebsd/freebsd-src/blob/main/contrib/arm-optim= ized-routines/string/aarch64/memset.S#L55). I am probably missing some understanding of Arm assembly here, but it at l= east looks like a store that shouldn't fault. The memset appears to be faulting writing into a region that is mapped read-write and the address is strongly aligned and so I'm not sure what's causing the bus error. This is on QEMU with Hypervisor.framework on a M2 MacBook Pro (virtualised AArch64). --=20 You are receiving this mail because: You are the assignee for the bug.=