From nobody Mon Jul 22 03:58:18 2024 X-Original-To: arm@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 4WS62g2sr5z5RDJl for ; Mon, 22 Jul 2024 03:58:35 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic309-22.consmr.mail.gq1.yahoo.com (sonic309-22.consmr.mail.gq1.yahoo.com [98.137.65.148]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS62f0Dvjz426Q for ; Mon, 22 Jul 2024 03:58:33 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=Y+5p7tEr; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.148 as permitted sender) smtp.mailfrom=marklmi@yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1721620712; bh=x7pFIdtt4oRR+lxpO2H3yFWRrcrumNMB4y8KxdVPFAo=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=Y+5p7tEr2zFa4wuPkB0hKau6g8CaqpXAQ0LQouoZqUu1vn94rrGXpcxPpGWxPRnqywVTfdYxzC/5LSHjRHVypqvJ1lx5cIlmi56hmYmYtqPaBfLBRErr6PdekDdqvxDc48GufJ2tx4oe+jXjURdrkEBcCddU6yeAYsJDR5IGBdaB1No3SI4LunRpF058UI3WmwSIM/irg+GspbpBJmNkMkP5XPtp4793UafibdImzbE4B9VpKdsJulkPWKr6bo0UhGovqPLen7L2JmvXa2m0nsfmX2jx+ecVp8HE8nRTHfdvn+4t+YLt03cLvpfZnk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lo.z.dDxf4Dy4.EMJdfHnc4u1q3N0LdK.dz2Ky18mBNmHlNYIkPYB5f5ToOX7xgan.jG2 OSnCuifeKmrdz7_8z6ayQI6x_iRiSs9Xx7OHlTzf7ulG6x837mucOc_7TeBF5SWyXF0PdY8fsNFH 3YF3l2J6Kb_5ayI52Tto_4IRJaMZS22YyhBEx0ntitKn0jE.ROPG1yT2Y9ORZp.KbMA8m4.wo2Ev 03BGfm.HDJVtIYOqIQBaGZbn0W5vlQB3eeLq3_3vZYJ8YrhPALQyB4URrs_1ndIiHuwZ1UJ5aJyX PjdxUe6EdYCZni8ON38djWZSDZgSH7XFj1bTb14qHEAAmNijSKHHq_YmJopWaR5t69BRhun0e.Dx Xh15XwEin1DByhsslovsp6477MfGMJSdoB0mbzdvT5Qfneczz9ncGWVn2Y2MuD7SXN5PsAbf3rEr 6z02EdmkJiK_RFjY0vt2CZhOVxbZX57VbHTmOz5xK8BJW8Xs0JZceNUs5Rncgj1q4_Tzj9zw6geD VXSXzrrLNVAPJcvaB0YCauToxAonh37l9LqvpeTuG1c7QSFlBpWB8u3ni9Vk8WP0L8ASwAC5bZXC ELoWMVxyc2T1MRKGqLRcYCiJTD9wskEEoXY12Dq.91AsrfrznNiOIBmb0zDqckXRXhQMxnbRWJ7Z DSFaM0s.TL4vdZpb7EwAgRbAclFI6BPA2yLpDOLzwN22r1AHQMgAbD0Q8cyUGQOVBCxr9NP3UkCC 6pHNG9.uX X-Sonic-MF: X-Sonic-ID: 757b0104-4d8a-47b2-99f9-79c6522e1225 Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.gq1.yahoo.com with HTTP; Mon, 22 Jul 2024 03:58:32 +0000 Received: by hermes--production-gq1-799bb7c8cf-mlhxz (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 4b98fa44d8f83b1df02d5d9c44384a4d; Mon, 22 Jul 2024 03:58:29 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: armv7-on-aarch64 stuck at urdlck: I got a replication of the "ampere2" bulk build hangup problem on a Windows DevKit 2023 From: Mark Millard In-Reply-To: Date: Sun, 21 Jul 2024 20:58:18 -0700 Cc: arm@freebsd.org, current@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <705AE360-C1C3-4B54-B6EE-FC81548D46B8@yahoo.com> References: <8214703E-AB28-4FB3-A3DD-03C87363D8C6@yahoo.com> <8E9579B7-2ABF-4446-B65E-E993E7B67C5C@yahoo.com> <9E98F6F6-6896-4958-9D88-FF68C4AB57F2@mit.edu> To: John F Carr , Konstantin Belousov , Baptiste Daroussin X-Mailer: Apple Mail (2.3774.600.62) X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[mit.edu,gmail.com,FreeBSD.org]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.148:from]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MLMMJ_DEST(0.00)[arm@freebsd.org]; APPLE_MAILER_COMMON(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.148:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim] X-Rspamd-Queue-Id: 4WS62f0Dvjz426Q I found a significant difference in my failing vs. working armv7 contexts as installed: Presence vs. Lack of a .symtab entry for the symbol _rtld_get_stack_prot in /libexec/ld-elf.so.1 . gdb inspection of operation shows distinctions based on the difference. This is related to the code: (gdb) list 140 135 void 136 _thr_stack_fix_protection(struct pthread *thrd) 137 { 138=09 139 mprotect((char *)thrd->attr.stackaddr_attr + 140 round_up(thrd->attr.guardsize_attr), 141 round_up(thrd->attr.stacksize_attr), 142 _rtld_get_stack_prot()); 143 } Working context (Personal build): NOTE THE .symtab ENTRY BELOW. It allows the gdb run to work: # readelf -a /libexec/ld-elf.so.1 | grep -E "(^[^ = 0-9]|.*_rtld_get_stack_prot)" | less ELF Header: Elf file type is DYN (Shared object file) Entry point 0x14548 There are 10 program headers, starting at offset 52 Program Headers: There are 24 section headers, starting at offset 0x1f2b8: Section Headers: Key to Flags: Dynamic section at offset 0x199f8 contains 15 entries: Relocation section (.rel.dyn): r_offset r_info r_type st_value st_name Symbol table '.dynsym' contains 27 entries: 5: 000000000001b9ac 16 FUNC GLOBAL DEFAULT 11 = _rtld_get_stack_prot@@FBSDprivate_1.0 (11) Symbol table '.symtab' contains 911 entries: 903: 000000000001b9ac 16 FUNC GLOBAL DEFAULT 11 = _rtld_get_stack_prot Notes at offset 0x00000174 with length 0x00000018: Histogram for bucket list length (total of 6 buckets): Histogram for bucket list length (total of 27 buckets): Version symbol section (.gnu.version): Version definition section (.gnu.version_d): Attribute Section: aeabi File Attributes Breakpoint 8.3, _thr_stack_fix_protection (thrd=3D0x2006f000) at = /usr/main-src/lib/libthr/thread/thr_stack.c:139 139 mprotect((char *)thrd->attr.stackaddr_attr + (gdb) si 141 round_up(thrd->attr.stacksize_attr), (gdb)=20 140 round_up(thrd->attr.guardsize_attr), (gdb)=20 round_up (size=3D4096) at = /usr/main-src/lib/libthr/thread/thr_stack.c:129 129 if (size % _thr_page_size !=3D 0) (gdb)=20 0x201110b8 129 if (size % _thr_page_size !=3D 0) 130 size =3D ((size / _thr_page_size) + 1) * (gdb)=20 0x201110c0 130 size =3D ((size / = _thr_page_size) + 1) * (gdb)=20 0x201110c4 in round_up (size=3D4096) at = /usr/main-src/lib/libthr/thread/thr_stack.c:130 130 size =3D ((size / _thr_page_size) + 1) * (gdb)=20 0x201110c8 130 size =3D ((size / = _thr_page_size) + 1) * (gdb)=20 round_up (size=3D67108864) at = /usr/main-src/lib/libthr/thread/thr_stack.c:129 129 if (size % _thr_page_size !=3D 0) (gdb)=20 0x201110d0 in round_up (size=3D4096) at = /usr/main-src/lib/libthr/thread/thr_stack.c:129 129 if (size % _thr_page_size !=3D 0) (gdb)=20 0x201110d4 in round_up (size=3D67108864) at = /usr/main-src/lib/libthr/thread/thr_stack.c:129 129 if (size % _thr_page_size !=3D 0) (gdb)=20 0x201110d8 129 if (size % _thr_page_size !=3D 0) (gdb)=20 0x201110dc in round_up (size=3D4096) at = /usr/main-src/lib/libthr/thread/thr_stack.c:129 129 if (size % _thr_page_size !=3D 0) (gdb)=20 0x201110e0 129 if (size % _thr_page_size !=3D 0) (gdb)=20 _thr_stack_fix_protection (thrd=3D0x2006f000) at = /usr/main-src/lib/libthr/thread/thr_stack.c:139 139 mprotect((char *)thrd->attr.stackaddr_attr + (gdb)=20 142 _rtld_get_stack_prot()); (gdb)=20 0x20114880 in ?? () from /lib/libthr.so.3 (gdb)=20 0x20114884 in ?? () from /lib/libthr.so.3 (gdb)=20 0x20114888 in ?? () from /lib/libthr.so.3 (gdb)=20 Breakpoint 9.1, _rtld_get_stack_prot () at = /usr/main-src/libexec/rtld-elf/rtld.c:5884 5884 return (stack_prot); (gdb)=20 0x2005b9b0 5884 return (stack_prot); (gdb)=20 0x2005b9b4 5884 return (stack_prot); Failing context (Official PkgBase build): NOTE THE *LACK OF* THE .symtab ENTRY ABOVE. _rtld_bind_start ends up in use instead, which looks to lead to the gdb run not working. IN FACT, NOTE THE LACK OF ANY "Symbol table '.symtab' contains" TEXT AT ALL! # readelf -a /libexec/ld-elf.so.1 | grep -E "(^[^ = 0-9]|.*_rtld_get_stack_prot)" | less ELF Header: Elf file type is DYN (Shared object file) Entry point 0x147b0 There are 10 program headers, starting at offset 52 Program Headers: There are 22 section headers, starting at offset 0x1a960: Section Headers: Key to Flags: Dynamic section at offset 0x1a4cc contains 15 entries: Relocation section (.rel.dyn): r_offset r_info r_type st_value st_name Symbol table '.dynsym' contains 27 entries: 5: 000000000001bcd8 16 FUNC GLOBAL DEFAULT 11 = _rtld_get_stack_prot@@FBSDprivate_1.0 (11) Notes at offset 0x00000174 with length 0x00000018: Histogram for bucket list length (total of 6 buckets): Histogram for bucket list length (total of 27 buckets): Version symbol section (.gnu.version): Version definition section (.gnu.version_d): Attribute Section: aeabi File Attributes Breakpoint 2.3, _thr_stack_fix_protection (thrd=3D0x20070000) at = /home/pkgbuild/worktrees/main/lib/libthr/thread/thr_stack.c:140 140 round_up(thrd->attr.guardsize_attr), (gdb) si 139 mprotect((char *)thrd->attr.stackaddr_attr + (gdb)=20 141 round_up(thrd->attr.stacksize_attr), (gdb)=20 round_up (size=3D4096) at = /home/pkgbuild/worktrees/main/lib/libthr/thread/thr_stack.c:129 129 if (size % _thr_page_size !=3D 0) (gdb)=20 130 size =3D ((size / _thr_page_size) + 1) * (gdb)=20 129 if (size % _thr_page_size !=3D 0) (gdb)=20 130 size =3D ((size / _thr_page_size) + 1) * (gdb)=20 0x20112ef8 130 size =3D ((size / = _thr_page_size) + 1) * (gdb)=20 0x20116b60 in ?? () from /lib/libthr.so.3 (gdb)=20 0x20116b64 in ?? () from /lib/libthr.so.3 (gdb)=20 0x20116b68 in ?? () from /lib/libthr.so.3 (gdb)=20 0x20116760 in ?? () from /lib/libthr.so.3 (gdb)=20 0x20116764 in ?? () from /lib/libthr.so.3 (gdb)=20 0x20116768 in ?? () from /lib/libthr.so.3 (gdb)=20 0x2011676c in ?? () from /lib/libthr.so.3 (gdb)=20 _rtld_bind_start () at = /home/pkgbuild/worktrees/main/libexec/rtld-elf/arm/rtld_start.S:78 78 stmdb sp!,{r0-r5,sl,fp} (gdb) si 80 sub r1, ip, lr /* r1 =3D 4 * (n + 1) */ (gdb)=20 81 sub r1, r1, #4 /* r1 =3D 4 * n */ (gdb)=20 82 add r1, r1, r1 /* r1 =3D 8 * n */ (gdb)=20 84 ldr r0, [lr, #-4] /* get obj ptr from = GOT[1] */ (gdb)=20 85 mov r4, ip /* save GOT location */ (gdb)=20 87 mov r5, sp /* Save the stack = pointer */ (gdb)=20 88 bic sp, sp, #7 /* Align the stack = pointer */ (gdb)=20 _rtld_bind_start () at = /home/pkgbuild/worktrees/main/libexec/rtld-elf/arm/rtld_start.S:89 89 bl _rtld_bind /* Call the binder */ I have not checked for other .symtab entry problems. Nor have I figured out why the installed materials are different for Symbol table '.symtab' . So this is not yet root-cause information. =3D=3D=3D Mark Millard marklmi at yahoo.com