Date: Sun, 21 Jul 2024 20:58:18 -0700 From: Mark Millard <marklmi@yahoo.com> To: John F Carr <jfc@mit.edu>, Konstantin Belousov <kostikbel@gmail.com>, Baptiste Daroussin <bapt@FreeBSD.org> Cc: arm@freebsd.org, current@freebsd.org Subject: Re: armv7-on-aarch64 stuck at urdlck: I got a replication of the "ampere2" bulk build hangup problem on a Windows DevKit 2023 Message-ID: <705AE360-C1C3-4B54-B6EE-FC81548D46B8@yahoo.com> In-Reply-To: <DA56EE85-F50E-46F0-A8B4-538C698A4058@yahoo.com> References: <A3BBDBA3-FF7E-47B8-8B45-C3351918FC08@yahoo.com> <8214703E-AB28-4FB3-A3DD-03C87363D8C6@yahoo.com> <E40B106D-30B7-49DC-8540-911A56E53FCA@yahoo.com> <BFCA474F-78D4-4E98-8A9B-B92C2DB6B0DE@yahoo.com> <E40627DC-35A2-4D5E-A85C-73D7FFD426DF@yahoo.com> <A208F7C8-0D9E-402C-BB85-A5022B37E3EC@yahoo.com> <Zpt79jpCFDSiffcy@kib.kiev.ua> <8E9579B7-2ABF-4446-B65E-E993E7B67C5C@yahoo.com> <CBF08B5A-A701-4D8E-AE96-3CB54137B14E@yahoo.com> <D02F1ADE-4E1B-4DAF-81C0-8EBD5315FC66@yahoo.com> <9E98F6F6-6896-4958-9D88-FF68C4AB57F2@mit.edu> <DA56EE85-F50E-46F0-A8B4-538C698A4058@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?705AE360-C1C3-4B54-B6EE-FC81548D46B8>