Date: Mon, 5 Nov 2018 21:10:13 -0500 From: Charlie Li <ml@vishwin.info> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Brooks Davis <brooks@freebsd.org>, svn-src-head@freebsd.org, toolchain@freebsd.org, current@freebsd.org Subject: svn commit: r339898 - head/lib/libc/amd64/sys Message-ID: <4907b3f9-d1c6-4368-5597-ce3d6be19461@vishwin.info> In-Reply-To: <20181103234551.GX5335@kib.kiev.ua> References: <201810300011.w9U0BUui038857@repo.freebsd.org> <a2d14762-d6f9-4c3e-b3d3-efb7dcb2640f@vishwin.info> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> <ae15161f-0728-d208-12a2-08a22fcbc50b@vishwin.info> <fdda06af-d189-b9b0-d2d5-26bcf2c6395a@vishwin.info> <20181103152936.GQ5335@kib.kiev.ua> <f8be07cd-f5eb-989c-44f1-ddcd60841411@vishwin.info> <20181103234551.GX5335@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dSTQZO6Iv0RuDNl64DlwKsKfsJ7ZgIKDH Content-Type: multipart/mixed; boundary="u0fGacMRl73mJcOe10cqYQwU7Cn5MR41u"; protected-headers="v1" From: Charlie Li <ml@vishwin.info> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Brooks Davis <brooks@freebsd.org>, svn-src-head@freebsd.org, toolchain@freebsd.org, current@freebsd.org Message-ID: <4907b3f9-d1c6-4368-5597-ce3d6be19461@vishwin.info> Subject: svn commit: r339898 - head/lib/libc/amd64/sys References: <201810300011.w9U0BUui038857@repo.freebsd.org> <a2d14762-d6f9-4c3e-b3d3-efb7dcb2640f@vishwin.info> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> <ae15161f-0728-d208-12a2-08a22fcbc50b@vishwin.info> <fdda06af-d189-b9b0-d2d5-26bcf2c6395a@vishwin.info> <20181103152936.GQ5335@kib.kiev.ua> <f8be07cd-f5eb-989c-44f1-ddcd60841411@vishwin.info> <20181103234551.GX5335@kib.kiev.ua> In-Reply-To: <20181103234551.GX5335@kib.kiev.ua> --u0fGacMRl73mJcOe10cqYQwU7Cn5MR41u Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 03/11/2018 19:45, Konstantin Belousov wrote: > Or rather, it is a middle of the valid instruction. > Next frame looks like it is process_irelocs(), if trusting the line > numbers. So most likely it is something related to calling wrong > relocator function, if anything. >=20 > Perhaps you could try to trace the things manually, doing > single-stepping of the startup code in debugger. There should be very > modest amount of the irelocs, perhaps only one, and see where things go= > off the way. >=20 After a few more complete buildworlds, including one with all bootstrapping enabled, this doesn't look compiler-specific. Static binaries built with the in-tree base LLVM (6.0.1) also crash. I stepped through bmake with base lldb, comparing the working copy in my system from circa r339990 with r340173 built with bootstrapped toolchain. Only the differing parts are shown for conciseness. Circa r339990: Process 82271 stopped * thread #1, name =3D 'make', stop reason =3D step over frame #0: 0x000000000024ab06 make`_init_tls at tls.c:471 468 } 469 tls =3D _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_AL= IGN); 470 -> 471 _set_tp(tls); 472 #endif 473 } (lldb) n Process 82271 stopped * thread #1, name =3D 'make', stop reason =3D step over frame #0: 0x0000000000255e60 make`_set_tp(tp=3D0x00000008002f7830) at= _set_tp.c:38 35 36 void 37 _set_tp(void *tp) -> 38 { 39 40 amd64_set_fsbase(tp); 41 } (lldb) s Process 82271 stopped * thread #1, name =3D 'make', stop reason =3D step in frame #0: 0x0000000000255e64 make`_set_tp(tp=3D0x00000008002f7830) at= _set_tp.c:40 37 _set_tp(void *tp) 38 { 39 -> 40 amd64_set_fsbase(tp); 41 } (lldb) s Process 82271 stopped * thread #1, name =3D 'make', stop reason =3D step in frame #0: 0x0000000000256580 make`amd64_set_fsbase(addr=3D0x00000008002f7830) at amd64_set_fsbase.c:43= 40 #include <machine/specialreg.h> 41 #include <machine/sysarch.h> 42 #include <x86/ifunc.h> -> 43 #include "libc_private.h" 44 45 static int 46 amd64_set_fsbase_cpu(void *addr) (lldb) r340173: Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D step over frame #0: 0x0000000000247c96 make`_init_tls at tls.c:471 468 } 469 tls =3D _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_AL= IGN); 470 -> 471 _set_tp(tls); 472 #endif 473 } (lldb) n Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D step over frame #0: 0x0000000000252eb0 make`_set_tp(tp=3D0x00000008002ed830) at= _set_tp.c:38 35 36 void 37 _set_tp(void *tp) -> 38 { 39 40 amd64_set_fsbase(tp); 41 } (lldb) s Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D step in frame #0: 0x0000000000252eb4 make`_set_tp(tp=3D0x00000008002ed830) at= _set_tp.c:40 37 _set_tp(void *tp) 38 { 39 -> 40 amd64_set_fsbase(tp); 41 } (lldb) s Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D step in frame #0: 0x0000000000252eb5 make`_set_tp(tp=3D0x00000008002ed830) at= _set_tp.c:40 37 _set_tp(void *tp) 38 { 39 -> 40 amd64_set_fsbase(tp); 41 } (lldb) s Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D step in frame #0: 0x00000000002ebdb0 make -> 0x2ebdb0: movq 0x3ce9(%rip), %r11 0x2ebdb7: callq 0x2ebda0 ; _fini 0x2ebdbc: jmp 0x2ebd92 ; _init + 6 0x2ebdc1: pushq $0x0 (lldb) n Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D instruction step over frame #0: 0x00000000002ebdb7 make -> 0x2ebdb7: callq 0x2ebda0 ; _fini 0x2ebdbc: jmp 0x2ebd92 ; _init + 6 0x2ebdc1: pushq $0x0 0x2ebdc6: jmp 0x2ebd80 ; __do_global_ctors_aux + = 48 (lldb) n Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D instruction step over frame #0: 0x00000000002ebda0 make`_fini at crti.S:41 38 .globl _fini 39 .type _fini,@function 40 _fini: -> 41 subq $8,%rsp 42 43 .section .note.GNU-stack,"",%progbits (lldb) n Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D step over frame #0: 0x00000000002ebda4 make`_fini + 4 make`_fini: -> 0x2ebda4 <+4>: callq 0x226310 ; __do_global_dtors_= aux 0x2ebda9 <+9>: addq $0x8, %rsp 0x2ebdad <+13>: retq 0x2ebdae: addb %al, (%rax) (lldb) n Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D instruction step over frame #0: 0x00000000002ebda9 make`_fini at crtn.S:34 31 ret 32 33 .section .fini,"ax",@progbits -> 34 addq $8,%rsp 35 ret 36 37 .section .note.GNU-stack,"",%progbits (lldb) n Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D step over frame #0: 0x00000000002ebdad make`_fini at crtn.S:35 32 33 .section .fini,"ax",@progbits 34 addq $8,%rsp -> 35 ret 36 37 .section .note.GNU-stack,"",%progbits (lldb) n Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D step over frame #0: 0x00000000002ebdbc make -> 0x2ebdbc: jmp 0x2ebd92 ; _init + 6 0x2ebdc1: pushq $0x0 0x2ebdc6: jmp 0x2ebd80 ; __do_global_ctors_aux + = 48 0x2ebdcb: int3 (lldb) n Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D instruction step over frame #0: 0x00000000002ebd92 make`_init + 6 make`_init: -> 0x2ebd92 <+6>: movsl (%rsi), %es:(%rdi) (lldb) n Process 22663 stopped * thread #1, name =3D 'make', stop reason =3D signal SIGSEGV: invalid address (fault address: 0x0) frame #0: 0x00000000002ebd92 make`_init + 6 make`_init: -> 0x2ebd92 <+6>: movsl (%rsi), %es:(%rdi) (lldb) n Process 22663 exited with status =3D -1 (0xffffffff) (lldb) --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use only; replace local-part with vishwin for off-list communication) --u0fGacMRl73mJcOe10cqYQwU7Cn5MR41u-- --dSTQZO6Iv0RuDNl64DlwKsKfsJ7ZgIKDH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAlvg+AoACgkQjnB43vID q2wNKw//QAnkScAsIvGCUcFKwd2HM1sRRCCiO0yFR5POy/TDqT2I8LiK+sz+6HnT RAtTq+yhQV6py+XYsRJW8oJE/89ppabxYXjX7i5VFuOBwAGE6uWVu5thvQnCR8fZ McfficSQJdb/1DTwZQCQOxCnWILEb8ztpOmJOHXYLHoOdJ+Tr/MlMiuKH6pNjlHG +DGXc6rUpf40t4UPc6+SPZgCW1lFqa4nE0xbTJVprhfJNbP/iO/LtEe2gpQ6c+fa UaZns+xkN9WV5XtVKJA+iF/m0r+EUYDbdVwNCdEhXPc4tTk3JNGsdJERZphWrA8m cylFEacNCFHfZCyqRo30HSGAMcUQdCp178bkbAaSvRHPKxsMiv+jh030l/UO0j+P Qv5WIBWhd35Rc6wn+rGXzZbscqplUv8OQHhPD6iI6XM82n78YRJm5WH7e3CNEzfH D8hYvI4TlkkIsmDawtOgbm6RCH+cTpiweVxLEIM0xZEG1orpjUVkz5VJ/3a2reMe 2DT05u2p1YEI9bVmGPFBnIgo0BJ1lzZj/EMHYyejpmC00ORmcHV0jJlYKjtWsXEX JA3dIYkOxyAVTxSj+sCDYtaXVyZDEWrwDNx2NVmuWo6hZ2/cMS8LfmzbVvB2xOpU Z8Oht3+M2rCjIXzSKJxgRsEnTVFdnaXltgHk+hCadTbZ9EpbotE= =cwRr -----END PGP SIGNATURE----- --dSTQZO6Iv0RuDNl64DlwKsKfsJ7ZgIKDH--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4907b3f9-d1c6-4368-5597-ce3d6be19461>