From owner-freebsd-ppc@freebsd.org Sun Jun 2 20:26:03 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ADDF15BED4B for ; Sun, 2 Jun 2019 20:26:03 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-22.consmr.mail.gq1.yahoo.com (sonic301-22.consmr.mail.gq1.yahoo.com [98.137.64.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44560774B0 for ; Sun, 2 Jun 2019 20:26:02 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: hId8CpwVM1kG5AEErmCqgzN1wF87hUHe4_Q49WtjTpRlwE1yu3.ZQ_gU_ungyV5 n7Z8Rc4c6NLhUK6DSSKXCjM3t1UiJYeOwaGIT0PxPxi50waRJC2us4k31TkDYr4EGaeulbYpMBtI q0BLfeQXJ5IdF9bJuqhcn57H.WG1ESupx3DLLgIcsMW_WHnzDCqPbMMfEATHezscyGytjz69t71X RxE5HvetuMoZY41EeJNKBUSPAr5iZ8YGanGGguFENWSVW9AXBFfYMJcS4uuD9_Qq31JZ7EdWs2s6 YtsOQVDKX0SPb_QdTQQl6OOo7hzjUpVsR0sW6FQG.Ac.yCQ5Ly3ObTtkkLy0cRujtLGMNBeaNfEg FUVlMSs295DX5xiofg.N6owO1mViw4LNoaz7N9CXdMkcAnOj5Od76encDUQw3rtvh_ndzAZZ9qBh 0OXkAd2kBp0wakzWL_38DGy2Ni7tVFWNhRr1y7tu1brZLmbuIB81BEhtK40gWnzc983b2jtBvs2O G_VtkJSvDHGiNPLxWeNHJ7nMVnG8ACl8Z8zQhm_c0dsnXDnkzt29YuFmYK8fIBYeKKyfYNJKvCWP 3Rwq6GWOWfojxF958yKy4_lW83nz_DTGpgeV_KOxvHoIU8nXTVdJqABDHHmJ.5dnEdYO3.Nek.Wm 2vVQ2RfYkJ2n8thehsjS3TO6t3fr._MOvgAnaZW.IFeUsHZE9zNUtLT8CzOfjlOZzRsW7ESiblVV k1kj7KDbzpnhpVZVWb2WN2lCyv91gluLBrg2WghQPqfZENUUwwiEzWLBrYBVLcDUZtlY1ZHjScxW Rlb84jqq09xenJpAKFsfFtdglOokKOkpcZjz0pzwM.ZRq_NVXK6Fvnqo_ooLh9iTKh4vaYmWKDTE QdWEr68xPNP7mmu9S56qlU.JzEk6au4p9eX.m02XIqtMLcCs_6jr6QgIzVdh.7EyGoOHpyFDpwve b5H0h8B_kN.lHVCJwFpxoLdbIUJNKMZce2HWb87HHvyrgu3Y7I1Cc9rC.xzwHrKcQ0dc.YEyt4aN svXW8hFqh3qRH76K16Uvebw.aPc84BkiRANoyJ.Naosu6oLJ1jx4S1tAqawhHm9aZ6ix0qwUdZnr dK9S2yJ6yCU.BPQjnRkP1.1VKLmquSzy4mJ5Tu5jv2fW5U.CtTSfIopWoBOcF2s4d_Pessc59mYn sy_290PKua1B728dSJ.EYVPwrXqO6KKMUoAcrO.yBSiNZFC2r9YjKBkyIxJp.YKE- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.gq1.yahoo.com with HTTP; Sun, 2 Jun 2019 20:25:53 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp409.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID a447431f82cd16affbb47a280b0c48be; Sun, 02 Jun 2019 20:25:49 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: 32-bit powerpc and powerpc64 kernel relocation types when built via system-clang-8 and devel/powerpc64-binutils: a few R_PPC*_ADDR32 mixed in with the R_PPC*_RELATIVE Message-Id: <51FF912A-46FD-49D7-A981-9370FFD0CE75@yahoo.com> Date: Sun, 2 Jun 2019 13:25:48 -0700 To: FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 44560774B0 X-Spamd-Bar: +++ X-Spamd-Result: default: False [3.11 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.80)[0.796,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.61)[ip: (6.37), ipnet: 98.137.64.0/21(0.97), asn: 36647(0.77), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.55)[0.546,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.67)[0.673,0]; RCVD_IN_DNSWL_NONE(0.00)[148.64.137.98.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2019 20:26:03 -0000 I'm not sure if getting a few R_PPC_ADDR32/R_PPC64_ADDR64 in the kernel is expected or not. This was a amd64 -> powerpc cross build from/for: # uname -apKU FreeBSD FBSDFSSD 13.0-CURRENT FreeBSD 13.0-CURRENT #20 r347549M: Fri May = 31 17:00:45 PDT 2019 = markmi@FBSDFSSD:/usr/obj/amd64_clang/amd64.amd64/usr/src/amd64.amd64/sys/G= ENERIC-NODBG amd64 amd64 1300025 1300025 system clang was used for the build but devel/powerpc64-binutils was = used. # readelf -asW = /usr/obj/DESTDIRs/clang-powerpc-installkernel_altbinutils/boot/kernel/kern= el | grep -v R_PPC_RELATIVE | less . . . Relocation section with addend (.rela.dyn): r_offset r_info r_type st_value st_name + r_addend 00da1744 00275101 R_PPC_ADDR32 00000000 uart_quicc_class + 0 Relocation section with addend (.rela.text): r_offset r_info r_type st_value st_name + r_addend Relocation section with addend (.rela.data): r_offset r_info r_type st_value st_name + r_addend Relocation section with addend (.rela.got): r_offset r_info r_type st_value st_name + r_addend Relocation section with addend (.rela.got2): r_offset r_info r_type st_value st_name + r_addend 00e646d0 00117401 R_PPC_ADDR32 00000000 mfs_root_end + 0 00e646d4 002d7c01 R_PPC_ADDR32 00000000 mfs_root + 0 00e67c94 002b3a01 R_PPC_ADDR32 00000000 = __stop_set_uart_fdt_class_set + 0 00e67c98 00210301 R_PPC_ADDR32 00000000 = __start_set_uart_fdt_class_set + 0 . . . # readelf -asW = /usr/obj/DESTDIRs/clang-powerpc64-installkernel_altbinutils/boot/kernel/ke= rnel | grep -v R_PPC64_RELATIVE | less . . . Relocation section with addend (.rela.dyn): r_offset r_info r_type st_value = st_name + r_addend 000000000130c360 00002d2800000026 R_PPC64_ADDR64 = 0000000000000000 uart_quicc_class + 0 0000000001362008 0000143600000026 R_PPC64_ADDR64 = 0000000000000000 mfs_root_end + 0 0000000001362010 0000343300000026 R_PPC64_ADDR64 = 0000000000000000 mfs_root + 0 0000000001362018 000031a000000026 R_PPC64_ADDR64 = 0000000000000000 __stop_set_uart_fdt_class_set + 0 0000000001362020 000025fd00000026 R_PPC64_ADDR64 = 0000000000000000 __start_set_uart_fdt_class_set + 0 Relocation section with addend (.rela.text): r_offset r_info r_type st_value = st_name + r_addend Relocation section with addend (.rela.data): r_offset r_info r_type st_value = st_name + r_addend . . . So it is always: uart_quicc_class mfs_root_end mfs_root __stop_set_uart_fdt_class_set __start_set_uart_fdt_class_set but the .rela.got2 vs. .rela.dyn status varies for all but uart_quicc_class in my context. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Sun Jun 2 23:16:03 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F8BA15C3041 for ; Sun, 2 Jun 2019 23:16:03 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-10.consmr.mail.ne1.yahoo.com (sonic307-10.consmr.mail.ne1.yahoo.com [66.163.190.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C69E84A82 for ; Sun, 2 Jun 2019 23:15:59 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: geXBEjoVM1l4l4M38nBEFnIdTVwE2Nn8On8cvTLNp4idU2coif8.V39IQJRz4t7 MhtVc807ZyfMgANIP8NT2zszPEdF4BOWpF6eI7.iKJTr7QRe2lkXS4me6KxXgwCRs5MtaB..xYDV xt.cniZV_DkoC2BSCBCh4xywYJKigvDSGJd2USMZ2_Li0ecb1a8HBOqODHuWHb0Pg78NFVbJUY.Z fnvWkzqrnR8PbuENG4gkzgqHtlbyRenxDyZ6NZ2j4MWtIMz3r86eZvdbfO_d7LhPumcJngCoWyiP cwtyzBzxFdluJCg32iSAxtPG9Oc38V1zNDmdBeEmy6txFKDj95l_i9z1xcVKe_tgkn19wTR99bSF rB1H28Bdi.xrEITWywSgkzTYyrODig5YKsQjo57fEE3L6kbR_MlPtvuXGZ_JdWQL1qB1PnNfO039 pJXcMMGvCpm98QQ628zV8_786_KTSMQCm9P1XdegmvPizjFyiXeC.EZYta9H0eZYjKJ7.ZuOdlfJ RC0jvhggc_bEgJpQfOnZwlEr_RWWae64CRRWgsNPw5eRlFOt4jx3muxh7Ucp5We8jDTrbh7SgJhG hgPXxnYgB_RtIHOFacFNkUthY5NpYPe2o7.mQ3HuwepYHnNK.e05auLOH48Fvs.BCwvDAOqYzva7 hEQ45NMwe59NEFNBVEDUa8um.WMx62zB9OM3TUHoCD6jclTG13SIQBTHoT5vGZhYQHRZPMCvpy2n fpjo9SYMsMGR7LWdqgi_5aIpeojCHsDHQjE9MpI8JkotHU7Wl60FPg5yx6VLmIYBg94qKFaNHBoQ .1rRKDh7HBancQAxkTZY5AzZFiP0xSqLtXjg2aie68SSt5phP22VmNEuaIMdwQvhYdOHz9xrIxYg x8zLxMGfJa8JTLvt79v.inJg7n30BAXGkuxr1qIjO5HoUr77dXayAcTXEVzNxqC9oP8f5E79wC6o 1LFI2ZqLSROAtVRj7EOrf8uaHDKbT24Yl4_hVYgMI82IYjZkuUdXLQSDyqmebBbBdz1FeGmoimh9 pGH7UcubppPf4tnaFTDmWrm.pRCv8hFCvtN.iqNPKptafcRGRWbOBgjwJNj.Zh9GSPjIEuJsIjoy Di0oSUZjMQstweWV70WGIXaPVd6Slkc1IFsLik3urQlZMvv46ntE1lvcduOq9F3XB4.OZI_o3ANC 4Y.asD32z__4B5VxSp6aE_XPb0ycmn9a6zQ.EpTlCrKGJzFTsqc2qjykk6OcoUHePSg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Sun, 2 Jun 2019 23:15:53 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp420.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 0f81cf71b9ab7f4b252a6446a25923b0; Sun, 02 Jun 2019 23:05:45 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: 32-bit powerpc and powerpc64 kernel relocation types when built via system-clang-8 and devel/powerpc64-binutils: a few R_PPC*_ADDR32 mixed in with the R_PPC*_RELATIVE From: Mark Millard In-Reply-To: <51FF912A-46FD-49D7-A981-9370FFD0CE75@yahoo.com> Date: Sun, 2 Jun 2019 16:05:42 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <51FF912A-46FD-49D7-A981-9370FFD0CE75@yahoo.com> To: FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 2C69E84A82 X-Spamd-Bar: ++ X-Spamd-Result: default: False [2.78 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.99)[0.988,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.34)[ip: (4.32), ipnet: 66.163.184.0/21(1.37), asn: 36646(1.09), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.53)[0.532,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.43)[0.427,0]; RCVD_IN_DNSWL_NONE(0.00)[33.190.163.66.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2019 23:16:03 -0000 On 2019-Jun-2, at 13:25, Mark Millard wrote: > I'm not sure if getting a few R_PPC_ADDR32/R_PPC64_ADDR64 > in the kernel is expected or not. >=20 > This was a amd64 -> powerpc cross build from/for: >=20 > # uname -apKU > FreeBSD FBSDFSSD 13.0-CURRENT FreeBSD 13.0-CURRENT #20 r347549M: Fri = May 31 17:00:45 PDT 2019 = markmi@FBSDFSSD:/usr/obj/amd64_clang/amd64.amd64/usr/src/amd64.amd64/sys/G= ENERIC-NODBG amd64 amd64 1300025 1300025 >=20 > system clang was used for the build but devel/powerpc64-binutils was = used. >=20 > # readelf -asW = /usr/obj/DESTDIRs/clang-powerpc-installkernel_altbinutils/boot/kernel/kern= el | grep -v R_PPC_RELATIVE | less > . . . > Relocation section with addend (.rela.dyn): > r_offset r_info r_type st_value st_name + r_addend > 00da1744 00275101 R_PPC_ADDR32 00000000 uart_quicc_class + 0 >=20 > Relocation section with addend (.rela.text): > r_offset r_info r_type st_value st_name + r_addend >=20 > Relocation section with addend (.rela.data): > r_offset r_info r_type st_value st_name + r_addend >=20 > Relocation section with addend (.rela.got): > r_offset r_info r_type st_value st_name + r_addend >=20 > Relocation section with addend (.rela.got2): > r_offset r_info r_type st_value st_name + r_addend > 00e646d0 00117401 R_PPC_ADDR32 00000000 mfs_root_end + 0 > 00e646d4 002d7c01 R_PPC_ADDR32 00000000 mfs_root + 0 > 00e67c94 002b3a01 R_PPC_ADDR32 00000000 = __stop_set_uart_fdt_class_set + 0 > 00e67c98 00210301 R_PPC_ADDR32 00000000 = __start_set_uart_fdt_class_set + 0 >=20 > . . . >=20 >=20 > # readelf -asW = /usr/obj/DESTDIRs/clang-powerpc64-installkernel_altbinutils/boot/kernel/ke= rnel | grep -v R_PPC64_RELATIVE | less > . . . > Relocation section with addend (.rela.dyn): > r_offset r_info r_type st_value = st_name + r_addend > 000000000130c360 00002d2800000026 R_PPC64_ADDR64 = 0000000000000000 uart_quicc_class + 0 > 0000000001362008 0000143600000026 R_PPC64_ADDR64 = 0000000000000000 mfs_root_end + 0 > 0000000001362010 0000343300000026 R_PPC64_ADDR64 = 0000000000000000 mfs_root + 0 > 0000000001362018 000031a000000026 R_PPC64_ADDR64 = 0000000000000000 __stop_set_uart_fdt_class_set + 0 > 0000000001362020 000025fd00000026 R_PPC64_ADDR64 = 0000000000000000 __start_set_uart_fdt_class_set + 0 >=20 > Relocation section with addend (.rela.text): > r_offset r_info r_type st_value = st_name + r_addend >=20 > Relocation section with addend (.rela.data): > r_offset r_info r_type st_value = st_name + r_addend >=20 > . . . >=20 > So it is always: >=20 > uart_quicc_class > mfs_root_end > mfs_root > __stop_set_uart_fdt_class_set > __start_set_uart_fdt_class_set >=20 > but the .rela.got2 vs. .rela.dyn status varies for all > but uart_quicc_class in my context. >=20 Turns out that the gcc 4.2.1 related toolchain for 32-bit powerpc produces: # readelf -asW = /usr/obj/DESTDIRs/gcc421-powerpc-installkernel/boot/kernel/kernel | grep = -v R_PPC_RELATIVE | less . . . Relocation section with addend (.rela.dyn): r_offset r_info r_type st_value st_name + r_addend Relocation section with addend (.rela.text): r_offset r_info r_type st_value st_name + r_addend Relocation section with addend (.rela.data): r_offset r_info r_type st_value st_name + r_addend Relocation section with addend (.rela.got): r_offset r_info r_type st_value st_name + r_addend Relocation section with addend (.rela.got2): r_offset r_info r_type st_value st_name + r_addend 00eaf92c 00117401 R_PPC_ADDR32 00000000 mfs_root_end + 0 00eaf930 002d7c01 R_PPC_ADDR32 00000000 mfs_root + 0 00eb28ec 00210401 R_PPC_ADDR32 00000000 = __start_set_uart_fdt_class_set + 0 00eb28f0 002b3b01 R_PPC_ADDR32 00000000 = __stop_set_uart_fdt_class_set + 0 00eb2940 00275101 R_PPC_ADDR32 00000000 uart_quicc_class + 0 Relocation section with addend (.rela.sdata): r_offset r_info r_type st_value st_name + r_addend . . . So uart_quicc_class varies .rela.dyn vs. .rela.got2 compared to system-clang with devel/powerpc64-binutils being used to target 32-bit powerpc. But there are still a count of 5 instances of R_PPC_ADDR32. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Tue Jun 4 00:24:51 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F03E15C23BD for ; Tue, 4 Jun 2019 00:24:51 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-33.consmr.mail.ne1.yahoo.com (sonic317-33.consmr.mail.ne1.yahoo.com [66.163.184.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EB9776723 for ; Tue, 4 Jun 2019 00:24:50 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: FnncNPQVM1mXyDdcJsjdbxYzGpawrdZVPRh5DFR3soL3NMS1ohy4ij9VOHlpxOM iHa2TVJs2hNOy0telDgv.TvnWiqzdEU0oWGFWB.jJWhjTslxoYUvNnlBgHSMhVgp1trJLff01m3s fh4vbMWoKSUxYXVJLM56VdNRFb6euRs9VFf8s7ohr17zOp872vQ4doDonV1aDVchg.36_cHP04R_ G31cgfMK4rlR9ru6tFMjEyvXhPhchAji.i38.owkGHZXGGJDZgKkIMGGyQXifs57YZ.4YOD77Ew5 i1zfQE6ovuyjLaGb5uhx0jnztLpRkE_x1WfI7w2pc9uhWQMc9B72_UYirDGJSMOqIyHcpm.7Buuq M36LxWiiahByAxOdRshq6vNE4TcEhjCYrAUbUQ6ceaqYgyATWqDCOJ5aaiWcP3h2xEDY6UH89oj2 dYoz5EI_Ati68kpsCSkdvsVNZsuxXIxHRLiXNBVkqvHrYYWwUrgJR8GghgvkUDYdqp_EIHU9jdOv XQvONIz2EYaZ2.JlqS6Ao01R4XPCAdS0xJCKb_3FJ73sYFKPya.FrwTuUBL_IrnCZeW_Jl0x4jAe QisyTqN9avtKR7TEt8mhK2LIgnQKbxefXM0aOGAP.STCoZUNdX5yDL8t9urzs.KdOswjc1csQaXo w3HjpiMEu.W.SJjlaCby1FmkpZL3MO7kY5yjm9G0Vq.UNCkou2TtXl0M80.wRga0CZLud_akLtby VgOwgVLu.VzqZqcPSeLJ4GEQo_b1dRlXO2JyzxrTTJU4.9nXdzH9I15Ha6fqEt0YSfoLdNT6RGt0 E9wO2HjQ0Dg1JwnVDh.BW_5mFVRxdfZ7pBk0_xTQ2iDzQqpIgQ.ckewyqwvSwdmmjTLL2kPZW_pB p2otsZMOZ0on4JengntZg2ze69h2BTxaH.diLWUq5obT6mKJq_VZvtHwYAKaTURy3gF5iRcm8Suc pF.3PAc7kMLED2Xr2K4MdAKwpUQkejrF16jKLhmCvsl8Bn5TTOoHtFtq7OBhewupQFlyuna5Ya5j KxYs0f6PLsEXjqQBm72eWLpAtZ39Rph8CPgyq11pnFzOT9arbRZMgGWQmN44VeJzZsf3RasxVWJW IVDB0HtMVwFwJZqovZP8VVtAOAdg4_VAkodlH3S8XL9Uhn96UT72XbX1xbUVRg6ylb6IqIZHwaGE OvyaGrvymSv83K_wJ.MWt7g6E2Gs.PiZ3m3WwVuC51zmUwhWHgQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Tue, 4 Jun 2019 00:24:48 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp420.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID ead8100dc82582fdfb49da1657bf3982 for ; Tue, 04 Jun 2019 00:24:46 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: crash of 32-bit powerpc -r347549 kernel built via system-clang-8 (crash is while trying to mount the root file system) Message-Id: <45D010BF-7654-43A6-8FF4-CCDEEF4004F6@yahoo.com> Date: Mon, 3 Jun 2019 17:24:44 -0700 To: FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 2EB9776723 X-Spamd-Bar: ++++ X-Spamd-Result: default: False [4.24 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.94)[0.944,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; NEURAL_SPAM_MEDIUM(0.72)[0.720,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(2.20)[ip: (8.60), ipnet: 66.163.184.0/21(1.36), asn: 36646(1.09), country: US(-0.06)]; NEURAL_SPAM_LONG(0.89)[0.890,0]; RCVD_IN_DNSWL_NONE(0.00)[44.184.163.66.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 00:24:51 -0000 I tried (cross) building a 32-bit powerpc kernel and world (non-debug) with system-clang (on amd64) and use of devel/powerpc64-binutils . The installed kernel panics trying to mount the root file system. FYI: Typed from picture of screen . . . Trying to mount root from ufs:/dev/ufs/FBSDG4Srootfs [rw,noatime]... panic: getnewbuf_empty: Locked buf 0xd2800000 on free queue. . . . 0xd6919080: at kdb_backtrace+0x64 0xd69190e0: at vpanic+0x200 0xd6919150: at panic+0x50 0xd6919190: at getnewbuf+0x594 0xd69191f0: at getblkx+0x540 0xd69192a0: at breadn_flags+0x90 0xd69192f0: at ffs_use_bread+0x9c 0xd6919330: at readsuper+0x68 0xd6919370: at ffs_sbget+0xcc 0xd69193c0: at ffs_mount+0x18b8 0xd69194f0: at vfs_domount+0xa74 0xd69196a0: at vfs_donmount+0x944 0xd6919700: at kernel_mount+0x64 0xd6919740: at parse_mount+0x52c 0xd6919840: at vfs_mountroot+0x71c 0xd69199b0: at start_init+0x44 0xd6919a10: at fork_exit_0xcc 0xd6919a40: at fork_trampoline+0xc KDB: enter panic [ thread pid 1 tid 100002 ] Stopped at kdb_enter+0x74: addi r3,r0,0x0 This reproduces with each boot attempt. Replacing the kernel with one built via gcc 4.2.1 and booting the result does not panic. FYI for the context of the panic call: /usr/src/sys/kern/vfs_bio.c : static struct buf * buf_alloc(struct bufdomain *bd) { struct buf *bp; int freebufs; /* * We can only run out of bufs in the buf zone if the average buf * is less than BKVASIZE. In this case the actual wait/block will * come from buf_reycle() failing to flush one of these small bufs. */ bp = NULL; freebufs = atomic_fetchadd_int(&bd->bd_freebuffers, -1); if (freebufs > 0) bp = uma_zalloc(buf_zone, M_NOWAIT); if (bp == NULL) { atomic_add_int(&bd->bd_freebuffers, 1); bufspace_daemon_wakeup(bd); counter_u64_add(numbufallocfails, 1); return (NULL); } /* * Wake-up the bufspace daemon on transition below threshold. */ if (freebufs == bd->bd_lofreebuffers) bufspace_daemon_wakeup(bd); if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0) panic("getnewbuf_empty: Locked buf %p on free queue.", bp); === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Tue Jun 4 02:40:50 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1674815C5614 for ; Tue, 4 Jun 2019 02:40:50 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic312-22.consmr.mail.bf2.yahoo.com (sonic312-22.consmr.mail.bf2.yahoo.com [74.6.128.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0207182876 for ; Tue, 4 Jun 2019 02:40:48 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: nq2POo4VM1mWkztVLOb1mtZR3bBw14wCJeZJU0hIDaJQIdGBEKLvF3Coweh5_iR HrtfNiwpMlK.NNMRVZ7ra6CPyvUxCrsKRZInHm6GanoZieEWLz45H5fTLOUU74S0H5U2LHTjeAyG qV9LNuFyTJG_p48sG6zrCMILoeCEEKauJi72MaBJwIt1rp0i4kSiC0_XPuuRzoGcph65rtn_LIjy yXNegbEF5wSA2QqHa8bnMlOAiNWSXwZarniQ1bcI2G5_HFhOK13qXxOjWoIIyAIHK7h.xCMbgnWT r2N4lBPHLva2JMNXILaCnoUuFYOLug.WW5amwLLYerAD0PzG49NKBDNKe9SCV0b7SE4c7oMSkP7K ucmPOggYnbvB.t34V7s8llQUvDkThyA2BaBQ2y0PjQvb4xgpgqa4cls8C1B9_lgHULW1gIZUx8hs BLm4OO6H2lasromxNweOn.HjcrYuu0sr3IeVrSOgMZcpFYoechoWQ5XML1eNNW0XPzX1JBrdGEuA Pv6udplMVwB9uuHCnBHE3IcYA9BTStgnOTir_J5GItRQug4es6E3QIgb0D2hUstOkm_jTAuYYeHv RezCwsl7B7Geqgfy80IAJ5s7uguQlFfTE7ZOgBEa.YJZWfVMO3YdWYczwU_sIJ8IjBkW5OiFH1ml VEBOA1ak_wGXXYAvHUVNxUIuk.UroupDjcBSg4MXw8rGdvPK0XbvQn1bFVYWDiEpRL9IjVGixDb5 HC1fBZe_i3v4VWDY.TXYmi0M7QdO.REF9VF5Tl6yddmuXey6MJx3X_klrRJA0Hag5lnCN4SgAmOE HWZ5mF0_K8HqAM_YDRX4G_db7cmz_SXP9E.iIXq1jX6JyKycAQ62iK1OLLVJiPYZBT_25xoaHn_a pdzWGXnKOVE9MeIzOcJR6ejYJa6MdUJi6jFGEjDWnOVC_Ds8LLQERLhhTrRq3lNPYedls3G1M2A5 p.8rv3iN4UJeGQcXFqHag7wD8QVcE3aa_TQaVFfE6arKSZkxvB9wk.TExwcCqxdB6NlIt6eMfFp8 7GaonjLvp4vckwEVIeyXXGQiqnI4SXbMQ3rFPx43NiUvoHM0wm96wfjo9aeJbINzWDOK7KgAcdo3 s.9A9t71irNG0X7RkYtnjW9qyUXtvps9j_NsE0Ih8MKrNx1u03u_yauacwNdp_kmyW576eykyqjF 9Jfib76HJJ49SAiD2NiW6GWJOfEM6r2SQe0FAyLueo.LsUX0- Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.bf2.yahoo.com with HTTP; Tue, 4 Jun 2019 02:40:42 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp428.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 5b8b3e44bdbb24d0ff2519a990f9226a for ; Tue, 04 Jun 2019 02:40:39 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: crash of 32-bit powerpc -r347549 kernel built via system-clang-8 (crash is while trying to mount the root file system) Date: Mon, 3 Jun 2019 19:40:36 -0700 References: <45D010BF-7654-43A6-8FF4-CCDEEF4004F6@yahoo.com> To: FreeBSD PowerPC ML In-Reply-To: <45D010BF-7654-43A6-8FF4-CCDEEF4004F6@yahoo.com> Message-Id: <4354EA25-69C2-4CAB-8273-62457333BD30@yahoo.com> X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 0207182876 X-Spamd-Bar: ++ X-Spamd-Result: default: False [2.63 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.90)[0.905,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; NEURAL_SPAM_MEDIUM(0.48)[0.477,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(1.21)[ip: (3.35), ipnet: 74.6.128.0/21(1.54), asn: 26101(1.23), country: US(-0.06)]; NEURAL_SPAM_LONG(0.54)[0.540,0]; RCVD_IN_DNSWL_NONE(0.00)[84.128.6.74.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 02:40:50 -0000 On 2019-Jun-3, at 17:24, Mark Millard wrote: > I tried (cross) building a 32-bit powerpc kernel and world (non-debug) > with system-clang (on amd64) and use of devel/powerpc64-binutils . The > installed kernel panics trying to mount the root file system. > > FYI: Typed from picture of screen . . . > > Trying to mount root from ufs:/dev/ufs/FBSDG4Srootfs [rw,noatime]... > panic: getnewbuf_empty: Locked buf 0xd2800000 on free queue. > . . . > 0xd6919080: at kdb_backtrace+0x64 > 0xd69190e0: at vpanic+0x200 > 0xd6919150: at panic+0x50 > 0xd6919190: at getnewbuf+0x594 > 0xd69191f0: at getblkx+0x540 > 0xd69192a0: at breadn_flags+0x90 > 0xd69192f0: at ffs_use_bread+0x9c > 0xd6919330: at readsuper+0x68 > 0xd6919370: at ffs_sbget+0xcc > 0xd69193c0: at ffs_mount+0x18b8 > 0xd69194f0: at vfs_domount+0xa74 > 0xd69196a0: at vfs_donmount+0x944 > 0xd6919700: at kernel_mount+0x64 > 0xd6919740: at parse_mount+0x52c > 0xd6919840: at vfs_mountroot+0x71c > 0xd69199b0: at start_init+0x44 > 0xd6919a10: at fork_exit_0xcc > 0xd6919a40: at fork_trampoline+0xc > KDB: enter panic > [ thread pid 1 tid 100002 ] > Stopped at kdb_enter+0x74: addi r3,r0,0x0 > > This reproduces with each boot attempt. > > Replacing the kernel with one built via gcc 4.2.1 and booting > the result does not panic. > > > FYI for the context of the panic call: > > /usr/src/sys/kern/vfs_bio.c : > > static struct buf * > buf_alloc(struct bufdomain *bd) > { > struct buf *bp; > int freebufs; > > /* > * We can only run out of bufs in the buf zone if the average buf > * is less than BKVASIZE. In this case the actual wait/block will > * come from buf_reycle() failing to flush one of these small bufs. > */ > bp = NULL; > freebufs = atomic_fetchadd_int(&bd->bd_freebuffers, -1); > if (freebufs > 0) > bp = uma_zalloc(buf_zone, M_NOWAIT); > if (bp == NULL) { > atomic_add_int(&bd->bd_freebuffers, 1); > bufspace_daemon_wakeup(bd); > counter_u64_add(numbufallocfails, 1); > return (NULL); > } > /* > * Wake-up the bufspace daemon on transition below threshold. > */ > if (freebufs == bd->bd_lofreebuffers) > bufspace_daemon_wakeup(bd); > > if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0) > panic("getnewbuf_empty: Locked buf %p on free queue.", bp); I tried making a debug kernel build via system-clang-8. It reports differently but still during getnewbuf being active on the stack (again typed from a picture): Trying to mount root from ufs:/dev/ufs/FBSDG4Srootfs [rw,noatime]... . . . (ignore witness/diagnostic warnings) . . . panic: bq_remove: Locked buf 0xd2a00000 not on a queue. . . . 0xd6b7bfd0: at kdb_backtrace+0x64 0xd6b7c030: at vpanic+0x200 0xd6b7c0a0: at panic+0x50 0xd6b7c0e0: at bq_remove+01e0 0xd6b7c100: at buf_import+0x8c 0xd6b7c130: at uma_zalloc_arg+0x544 0xd6b7c190: at getnewbuf+0x380 0xd6b7c1f0: at getblkx+0x620 0xd6b7c290: at breadn_flags+0x90 0xd6b7c2e0: at ffs_use_bread+0xa8 0xd6b7c320: at readsuper+0x68 0xd6b7c360: at ffs_sbget+0xcc 0xd6b7c3b0: at ffs_mount+0xefc 0xd6b7c4e0: at vfs_domount+0xa754 0xd6b7c690: at vfs_donmount+0x78c 0xd6b7c6f0: at kernel_mount+0x7c 0xd6b7c730: at parse_mount+0x52c 0xd6b7c830: at vfs_mountroot+0x660 0xd6b7c9a0: at start_init+0x4c 0xd6b7ca10: at fork_exit_0xb0 0xd6b7ca40: at fork_trampoline+0xc /usr/src/sys/kern/vfs_bio.c : static void bq_remove(struct bufqueue *bq, struct buf *bp) { CTR3(KTR_BUF, "bq_remove(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); KASSERT(bp->b_qindex != QUEUE_NONE, ("bq_remove: buffer %p not on a queue.", bp)); . . . For reference: static int buf_import(void *arg, void **store, int cnt, int domain, int flags) { struct buf *bp; int i; BQ_LOCK(&bqempty); for (i = 0; i < cnt; i++) { bp = TAILQ_FIRST(&bqempty.bq_queue); if (bp == NULL) break; bq_remove(&bqempty, bp); store[i] = bp; } BQ_UNLOCK(&bqempty); return (i); } === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Tue Jun 4 16:48:30 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4D2E15B6DF0 for ; Tue, 4 Jun 2019 16:48:30 +0000 (UTC) (envelope-from jau789@gmail.com) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1DE72140 for ; Tue, 4 Jun 2019 16:48:29 +0000 (UTC) (envelope-from jau789@gmail.com) Received: by mail-lf1-x12d.google.com with SMTP id l26so16949962lfh.13 for ; Tue, 04 Jun 2019 09:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=EcKOg87zeHwrN/qDOQsf0+Rj7TyLmxF+K5T2wUDXaIg=; b=Wl5rrkLCnnq2fpPVNEYzBWKMVD3xpzGMtioZU5TKmzY/HNGyLcI4bJuN3Yx32/XmGS hKEM/lGzLIt9SqfnLISN7vnmJwIfd8BksuqckNEyi/ifuqOGeoMMr2E9qFitHXvA8OUG IFVIcZ8RAlNJlZMZw0cGAofqcLXzXCfXHxTwVqYfwK+eYhqhbLAM2RaEztvI+CcpOwPX erdMrLh8znZJDGHgDtF+CztObPP9jVBnj2/SnL/kaSG6DHtNuw3XZhF6TnvUJ+fMSL2G vH85L4IouZtQARn67iPluUxaQmKWwvOS70DuvB31ubVqy0QzOF5P5SfmIoxeGe+YLz/6 Zvqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=EcKOg87zeHwrN/qDOQsf0+Rj7TyLmxF+K5T2wUDXaIg=; b=pWCE6vG+IaqQCYgNMT4UkxF3GKSSysNbWlUaxJ5naNsBmq9/Z5SUti/4PGPhCRcgpx qiJ3sqHte6Dw1Aa4obTq7NbPjPxET3TQQk7iJ37VczdkMQ5mhoOkj8X37k6tR/KyhGDM 6PFs8zgjBcwP+62HIvJkbnipdCHwc90zq7/rNug0w5gAu+7+wKrsIK0nn3E1K6S7BcM1 jvIHDz05POGeHVGfccfsInL30oggbTt9NGepobv0fy9eDiJHT1U5NDgYK3U+CQJO9p+3 Uw5onXLPtVmNLeLppLzDaMGe/xPcnJP2/in1nAYs8SSHHfcGbyPLDA6lXFMdVKhfM8BP TBCw== X-Gm-Message-State: APjAAAUgg76fJP9+T5tRzqjfKVPCllC1wijgIT6DN9iCUxKWwRO43mBC xKpc2wbxYr2fr21ABFuyFjItiM9h X-Google-Smtp-Source: APXvYqye4je7e+WpnNhgW8YmMi03Ja484iS7q+57Tf+N7fxVl5/oRnnA200a2+j1t0wAoX/+97uixw== X-Received: by 2002:a19:f506:: with SMTP id j6mr16999996lfb.168.1559666905581; Tue, 04 Jun 2019 09:48:25 -0700 (PDT) Received: from [83.145.205.1] (xdsl-205-1.nblnetworks.fi. [83.145.205.1]) by smtp.googlemail.com with ESMTPSA id v14sm3807897lfb.50.2019.06.04.09.48.24 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 09:48:25 -0700 (PDT) To: FreeBSD PowerPC ML From: "Jukka A. Ukkonen" Subject: What is the status of freebsd-ppc on PowerMac G4? Message-ID: <7a0a9370-8034-0a7d-035f-bf9335ce4b0e@gmail.com> Date: Tue, 4 Jun 2019 19:48:22 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9E1DE72140 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Wl5rrkLC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of jau789@gmail.com designates 2a00:1450:4864:20::12d as permitted sender) smtp.mailfrom=jau789@gmail.com X-Spamd-Result: default: False [-5.74 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-2.76)[ip: (-9.15), ipnet: 2a00:1450::/32(-2.28), asn: 15169(-2.29), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[d.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; SUBJECT_ENDS_QUESTION(1.00)[] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 16:48:30 -0000 Has anyone had any success booting anything more recent than 10.4 on a PowerMac G4? Esp. I would be interested in news about PowerMac G4 QuickSilver. AFAIK nothing since 10.4 has actually booted on that iron. I tried 11.3-BETA2 CD a couple of hours ago and it fell on its face so quickly after boot that I had no time to get a glimpse on what was the last thing displayed. --jau From owner-freebsd-ppc@freebsd.org Tue Jun 4 16:52:15 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F377715B71BF for ; Tue, 4 Jun 2019 16:52:14 +0000 (UTC) (envelope-from oggy@farscape.co.uk) Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA3F726A6 for ; Tue, 4 Jun 2019 16:52:13 +0000 (UTC) (envelope-from oggy@farscape.co.uk) Received: by mail-lj1-x231.google.com with SMTP id j24so20418985ljg.1 for ; Tue, 04 Jun 2019 09:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=farscape-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vEElyWLJAYdYBgAVZ59MdXUYhPEBdmB9+wxM2NtRRYE=; b=o8DhvoEwfqfTfZYvYPXyRNSKLJQlyiUwicTFZIPEpCjKk32GjGWhxbE7LzLENKixnW RWEObRSx7Zf9cMvJociR1C4F/1K/JJ6DzfprATwtL8cUV4NpoMxtFDlhQTS7aoaBdRYw +LAuFUYo37HClYVaSkbVNyn/tzNW2ZyW8g7qGFJaLJTEqLQ5Vvbuz+6Jrt6S56IJFhov FkO6WusQqfFAKrT7QUDF4FCf2uJTFie841i2OmPWACi7x30denqH954xRDqSC50Qlgvq KSucBMyyFA261Ie4w+0J4o8c3WaJkBwrPJqHzZcPCBOP7JIp0d1VVnn3ZKxgU3u2OjKY 4x2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vEElyWLJAYdYBgAVZ59MdXUYhPEBdmB9+wxM2NtRRYE=; b=sThXptXTkL2l8dGNwH7onPCPBclC9bDKr1/Jpk4FZGZfP1t05WMLo9TWpx3m64c359 NLGlQPl8jcA5TAO8zIsCVaBlio33Tmt9NcJGEW8MOyC48OrZLwejEa1JHOy8IXR2tjd0 p37VS6sPwmumCYkKndWGLUwevq276Ezd3olna9caxFuA8NJBQOEnXCtETEabu3P+qwDC lF0OD00y+SPrZXNvXnW3oOMgwAhXZXXBci4TgnA3iaLKTkKK0CwjzfmBorkaKnpFu0bR Rju96oD1dNvnHZLiYVs2MN5r+GsIq/gqOP+IyieuoRuZMdeqBRwH5PcAtDyEj/FSAlOe 6qUQ== X-Gm-Message-State: APjAAAX9QGwb8ptRFOg2HE1V9xIu17TRRTdLccsEKJMOQStDT1Zflvnu f/FJc9T12iOI8n8vQgqPSZ5qjxgx70o8wbL9QRk1OZJbMgQ= X-Google-Smtp-Source: APXvYqysdhadKwghY2X5ZEpzCXoYB4/Fo11dnBczQJeouv7sdXsX+mSZdLDeEGJIHXKXB53kVC5WRtK3yJ11Bcrt2iE= X-Received: by 2002:a2e:9106:: with SMTP id m6mr3170209ljg.164.1559667131899; Tue, 04 Jun 2019 09:52:11 -0700 (PDT) MIME-Version: 1.0 References: <7a0a9370-8034-0a7d-035f-bf9335ce4b0e@gmail.com> In-Reply-To: <7a0a9370-8034-0a7d-035f-bf9335ce4b0e@gmail.com> From: Francis Little Date: Tue, 4 Jun 2019 17:51:59 +0100 Message-ID: Subject: Re: What is the status of freebsd-ppc on PowerMac G4? To: "Jukka A. Ukkonen" Cc: FreeBSD PowerPC ML X-Rspamd-Queue-Id: 5FA3F726A6 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=farscape-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=o8DhvoEw; spf=pass (mx1.freebsd.org: domain of oggy@farscape.co.uk designates 2a00:1450:4864:20::231 as permitted sender) smtp.mailfrom=oggy@farscape.co.uk X-Spamd-Result: default: False [-5.28 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[farscape-co-uk.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; DMARC_NA(0.00)[farscape.co.uk]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[farscape-co-uk.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[1.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,alt4.aspmx.l.google.com,alt3.aspmx.l.google.com,alt2.aspmx.l.google.com,aspmx.l.google.com]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(-2.83)[ip: (-9.52), ipnet: 2a00:1450::/32(-2.28), asn: 15169(-2.29), country: US(-0.06)] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2019 16:52:15 -0000 I have 12.0 on a PowerMac G4, it's the MDD not a quicksilver. On Tue, 4 Jun 2019, 17:49 Jukka A. Ukkonen, wrote: > > Has anyone had any success booting anything more recent than > 10.4 on a PowerMac G4? > Esp. I would be interested in news about PowerMac G4 QuickSilver. > AFAIK nothing since 10.4 has actually booted on that iron. > I tried 11.3-BETA2 CD a couple of hours ago and it fell on its > face so quickly after boot that I had no time to get a glimpse > on what was the last thing displayed. > > --jau > _______________________________________________ > freebsd-ppc@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ppc > To unsubscribe, send any mail to "freebsd-ppc-unsubscribe@freebsd.org" > From owner-freebsd-ppc@freebsd.org Wed Jun 5 08:35:41 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1AF515C991D for ; Wed, 5 Jun 2019 08:35:41 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic309-20.consmr.mail.ne1.yahoo.com (sonic309-20.consmr.mail.ne1.yahoo.com [66.163.184.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9207971895 for ; Wed, 5 Jun 2019 08:35:39 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: OdrJJMUVM1kipM7xllMKZLb93WACgBY5bBQmXA52b85yM.eIaQ9RSwi6_CwH609 kZPu3Ffu3iKNKQxQ9CG900VMO3VjmP1Q7ymmPVlJKeitahi3CIPnL0v08aKOB8EGZaxK09Budr5z T3BxhuN_n19pJCVau241zp2BHSZ4b9qdrNlvCBYjrLt7RnymBiD2Lw0xajDnP3jBlAdffX.VSI1A .0LFMsLgXa2hMdUbSyxzd4bjRVHSZkqIrji.F36NJcQs5Z7LRzDvrjFvDOwlJXrgAfddzqRhNGuN RWqPJfZR43sS4wdCmZCSKyJVTehGew.pEr0CaMBELVT26AMrqADKaawfvHaAQxOJnq2noq2s86Vo 2yK.m7yyagM4cGrzyJn8OxJQ4zKrEeoa7wu5hl.mvCD4qnzJLEeD0xdLeaLbej6xIgB5DW.7XHqw 3g9sAKsqVUSzRECQMPZbRRsqzk6AcsbCBeVHlOdtGxwJXhZjAxV.lObQbotpTAz1ofCczF8E5r5O zZWeHXXFn78P6WwdNRbmup6OHkfxlLIpbby.UXYVEfAmQj7m64XvuuJM_FHG1IqsW.SwKWFdf2h7 16HDyjJX9eDfXkqwvAbEPIuxPiwBWL0zhGkJFkJQjmH5348UXaeu4ADJbb3I3rxAWvpBA9nrivWS 2c0G80QnTuioszUnWTdkq2ZLjgsz5WrmQl1lZmv.BO8wzEir6I_gO7gzhUxrkFwQ5J_bBL_8vcyU rd3G.PORTbIxob9HN0MoPh.Gs578O54VleSQKTTW6yMO8XlKM2DU8jt6KBlOe65YjIlijFADgBbg 0fZdecSjpL0K6IU8JIkvnOFS7vG49dDqiFPxCEGblgoWB7dEpuQvPTG0LsL5VIM9_oZPd55QtT6S uMymARx9GDTrKzvGc9fTwAF3ZafPpstwAmNlYaCCw4J63ay6HNK6tlOuhr3SbeSfgcpIl_BcoY8V gzfmpJh1Z4Zm1Wkxo.dCof2GZlWn3gu8.9AD3JFuuurU7Sh81v5HqJ3U.PQWJTljHzHGj3gfpGhH 1Nsq6zVpaN7Fi1TT3Qipvm0nHn_4cMxCnGVPO6sh.sMoh7M.0DVOV.7HMhMrdPSn7MMOZSYjBfAe G1HnkQIM6mA5hj3mwiy8UxWtFLjqdbPgUwZzfHngFO2nBaWHJsLDz2jUcKdrRCX_iqFINOLHLA2y 2IQgRsJ9HQiZnuMmP7K3KscjXIHMObKbGBAS.5ejeBixgMIh8 Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Wed, 5 Jun 2019 08:35:32 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp401.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 26e40e16668a539b998751e530f633ae for ; Wed, 05 Jun 2019 08:35:30 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: crash of 32-bit powerpc -r347549 kernel built via system-clang-8 (crash is while trying to mount the root file system) Date: Wed, 5 Jun 2019 01:35:28 -0700 References: <45D010BF-7654-43A6-8FF4-CCDEEF4004F6@yahoo.com> <4354EA25-69C2-4CAB-8273-62457333BD30@yahoo.com> To: FreeBSD PowerPC ML In-Reply-To: <4354EA25-69C2-4CAB-8273-62457333BD30@yahoo.com> Message-Id: <995DA649-9390-420B-AC95-FFD17079CDA9@yahoo.com> X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 9207971895 X-Spamd-Bar: + X-Spamd-Result: default: False [1.93 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.09)[-0.092,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; NEURAL_SPAM_MEDIUM(0.26)[0.258,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(1.47)[ip: (4.95), ipnet: 66.163.184.0/21(1.36), asn: 36646(1.09), country: US(-0.06)]; NEURAL_SPAM_LONG(0.81)[0.806,0]; RCVD_IN_DNSWL_NONE(0.00)[146.184.163.66.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 08:35:42 -0000 On 2019-Jun-3, at 19:40, Mark Millard wrote: > On 2019-Jun-3, at 17:24, Mark Millard wrote: >=20 >> I tried (cross) building a 32-bit powerpc kernel and world = (non-debug)=20 >> with system-clang (on amd64) and use of devel/powerpc64-binutils . = The >> installed kernel panics trying to mount the root file system. >>=20 >> FYI: Typed from picture of screen . . . >>=20 >> Trying to mount root from ufs:/dev/ufs/FBSDG4Srootfs [rw,noatime]... >> panic: getnewbuf_empty: Locked buf 0xd2800000 on free queue. >> . . . >> 0xd6919080: at kdb_backtrace+0x64 >> 0xd69190e0: at vpanic+0x200 >> 0xd6919150: at panic+0x50 >> 0xd6919190: at getnewbuf+0x594 >> 0xd69191f0: at getblkx+0x540 >> 0xd69192a0: at breadn_flags+0x90 >> 0xd69192f0: at ffs_use_bread+0x9c >> 0xd6919330: at readsuper+0x68 >> 0xd6919370: at ffs_sbget+0xcc >> 0xd69193c0: at ffs_mount+0x18b8 >> 0xd69194f0: at vfs_domount+0xa74 >> 0xd69196a0: at vfs_donmount+0x944 >> 0xd6919700: at kernel_mount+0x64 >> 0xd6919740: at parse_mount+0x52c >> 0xd6919840: at vfs_mountroot+0x71c >> 0xd69199b0: at start_init+0x44 >> 0xd6919a10: at fork_exit_0xcc >> 0xd6919a40: at fork_trampoline+0xc >> KDB: enter panic >> [ thread pid 1 tid 100002 ] >> Stopped at kdb_enter+0x74: addi r3,r0,0x0 >>=20 >> This reproduces with each boot attempt. >>=20 >> Replacing the kernel with one built via gcc 4.2.1 and booting >> the result does not panic. >>=20 >>=20 >> FYI for the context of the panic call: >>=20 >> /usr/src/sys/kern/vfs_bio.c : >>=20 >> static struct buf * >> buf_alloc(struct bufdomain *bd) >> { >> struct buf *bp; >> int freebufs; >>=20 >> /* >> * We can only run out of bufs in the buf zone if the average = buf >> * is less than BKVASIZE. In this case the actual wait/block = will >> * come from buf_reycle() failing to flush one of these small = bufs. >> */ >> bp =3D NULL; >> freebufs =3D atomic_fetchadd_int(&bd->bd_freebuffers, -1); >> if (freebufs > 0) >> bp =3D uma_zalloc(buf_zone, M_NOWAIT); >> if (bp =3D=3D NULL) { >> atomic_add_int(&bd->bd_freebuffers, 1); >> bufspace_daemon_wakeup(bd); >> counter_u64_add(numbufallocfails, 1); >> return (NULL); >> } >> /* >> * Wake-up the bufspace daemon on transition below threshold. >> */ >> if (freebufs =3D=3D bd->bd_lofreebuffers) >> bufspace_daemon_wakeup(bd); >>=20 >> if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) !=3D 0) >> panic("getnewbuf_empty: Locked buf %p on free queue.", = bp); >=20 >=20 > I tried making a debug kernel build via system-clang-8. It > reports differently but still during getnewbuf being active > on the stack (again typed from a picture): >=20 > Trying to mount root from ufs:/dev/ufs/FBSDG4Srootfs [rw,noatime]... > . . . (ignore witness/diagnostic warnings) . . . > panic: bq_remove: Locked buf 0xd2a00000 not on a queue. > . . . > 0xd6b7bfd0: at kdb_backtrace+0x64 > 0xd6b7c030: at vpanic+0x200 > 0xd6b7c0a0: at panic+0x50 > 0xd6b7c0e0: at bq_remove+01e0 > 0xd6b7c100: at buf_import+0x8c > 0xd6b7c130: at uma_zalloc_arg+0x544 > 0xd6b7c190: at getnewbuf+0x380 > 0xd6b7c1f0: at getblkx+0x620 > 0xd6b7c290: at breadn_flags+0x90 > 0xd6b7c2e0: at ffs_use_bread+0xa8 > 0xd6b7c320: at readsuper+0x68 > 0xd6b7c360: at ffs_sbget+0xcc > 0xd6b7c3b0: at ffs_mount+0xefc > 0xd6b7c4e0: at vfs_domount+0xa754 > 0xd6b7c690: at vfs_donmount+0x78c > 0xd6b7c6f0: at kernel_mount+0x7c > 0xd6b7c730: at parse_mount+0x52c > 0xd6b7c830: at vfs_mountroot+0x660 > 0xd6b7c9a0: at start_init+0x4c > 0xd6b7ca10: at fork_exit_0xb0 > 0xd6b7ca40: at fork_trampoline+0xc >=20 > /usr/src/sys/kern/vfs_bio.c : >=20 > static void > bq_remove(struct bufqueue *bq, struct buf *bp) > { >=20 > CTR3(KTR_BUF, "bq_remove(%p) vp %p flags %X", > bp, bp->b_vp, bp->b_flags); > KASSERT(bp->b_qindex !=3D QUEUE_NONE, > ("bq_remove: buffer %p not on a queue.", bp)); > . . . >=20 > For reference: >=20 > static int > buf_import(void *arg, void **store, int cnt, int domain, int flags) > { > struct buf *bp; > int i; >=20 > BQ_LOCK(&bqempty); > for (i =3D 0; i < cnt; i++) { > bp =3D TAILQ_FIRST(&bqempty.bq_queue); > if (bp =3D=3D NULL) > break; > bq_remove(&bqempty, bp); > store[i] =3D bp; > } > BQ_UNLOCK(&bqempty); >=20 > return (i); > } >=20 >=20 I tried building the debug kernel with KTR for KTR_BUF. Installing and booting the result did not panic. Manually forcing getting to ddb> soon enough and doing "show ktr" did show a bq_remove for 0xd2a00000 (and later activity). =46rom the looks of the KTR_BUF CTRn's, this suggests to me that the access to bp->qindex in bq_remove is racy in some way vs. updates to the value. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Wed Jun 5 14:20:13 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 325D715AF3DA for ; Wed, 5 Jun 2019 14:20:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id A43FC84F65 for ; Wed, 5 Jun 2019 14:20:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 6533715AF3CF; Wed, 5 Jun 2019 14:20:12 +0000 (UTC) Delivered-To: ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5122915AF3CE for ; Wed, 5 Jun 2019 14:20:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D56FB84F58 for ; Wed, 5 Jun 2019 14:20:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 27A68B12F for ; Wed, 5 Jun 2019 14:20:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x55EKBbs072385 for ; Wed, 5 Jun 2019 14:20:11 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x55EKBsd072384 for ppc@FreeBSD.org; Wed, 5 Jun 2019 14:20:11 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ppc@FreeBSD.org Subject: [Bug 224872] powerpc64: ddb breakpoints throwing a fast kernel trap Date: Wed, 05 Jun 2019 14:20:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ppc@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 14:20:13 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D224872 --- Comment #6 from commit-hook@freebsd.org --- A commit references this bug: Author: luporl Date: Wed Jun 5 14:19:55 UTC 2019 New revision: 348690 URL: https://svnweb.freebsd.org/changeset/base/348690 Log: MFC r343744: powerpc64: Add a trap stack area Currently, the trap code switches to the the temporary stack in the dbtrap section. It works in most cases, but in the beginning of the execution, t= he temp stack is being used, as starting in the powerpc_init() code. In this current scenario, the stack is being overwritten, which causes the return of breakpoint() to take abnormal execution. This current patchset create a small stack to use by the dbtrap: codepath avoiding the corruption of the temporary stack. PR: 224872 Submitted by: breno.leitao_gmail.com Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D14484 Changes: _U stable/12/ stable/12/sys/powerpc/aim/locore32.S stable/12/sys/powerpc/aim/locore64.S stable/12/sys/powerpc/aim/trap_subr32.S stable/12/sys/powerpc/aim/trap_subr64.S --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-ppc@freebsd.org Wed Jun 5 21:38:08 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3633D15B9BA0 for ; Wed, 5 Jun 2019 21:38:08 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-55.consmr.mail.gq1.yahoo.com (sonic315-55.consmr.mail.gq1.yahoo.com [98.137.65.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E91276DFE7 for ; Wed, 5 Jun 2019 21:38:06 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 9uiWfcMVM1k5wF7uVwtCvaWfeKkaMCLhOfN1FTpNUF_MzmBQ.TsGQmfIf.Tq55L Hkg38pdH2Zy8wilawUj4UAODtG2XvcJ05zJe9qZtFpUaIK8DtpsaiNz8c7xjBczq3wAfauokE4bI .SpgNzuyvvqobWkMq7jUIg.nPWQmiYEQgRjCsL9Bp48ll3StFY6tnqIM75YbJihF6QcOLKVoutlO w0ZWnkX403WYMp_RevKQfH7GBaS80KFIpZE7wMca.W6fgU7LO_eS95f.SkLD3HMDpaWFHhFcTFIh jNopBzw7r30fgCVJ6723o3SP7jhXOib_CRc2gXV6ZYIH6XtyGMwCqLzv1WoaN1dZmgyZaYlTplv. qWBbAyhOzA4t01qECiLNpMqSiAafb57WVH60Vjte0W.QJNp.EgeVjhd2bzyODwRu_EBp6_PMe7V7 AuEygbFibKo4WXU18cLLgmK1rP.at.nItSdXsYYyko1Q_lObOReUKR2cSUtnlVdfQ.u5usINeDbv xhn9fA6MhXS0rBQEm6ZL2JQL0alVbbu_Puv6cGTSMmeH7lBgxG4dUJC8wCZSyw5nBtkfyldnSp40 sNDP2dIf3dbQUkAt_mPGfsskp_FjkF7EQbSa747y.H39WTRPE._DyZhC6R.fpR.OsJ5q1KBj7ydx .UXZzNIVmuP177r9tTpx2_VpYvh0AECSwD8OmczWWiAZcLYnvsQe.xX9943EKqJ9yPf1PHsPsnOH qaVpW17cs0lsHL3POZ6ruK1kiYvIJ1h_0AmsqAyYtK16xB24_JOG00_SK.RmYLqjviLpbS_HYND7 _wjwth_VtFzC2jN6dJu0HWxOk0R7RJrct3c__yeNPXyUkAbv0zz0meuKm9E1ip01lrHBD1TrSi7K KWXX66Iaifyj_7Pnks3y2gyyo5VxzahpeWA9jtQohUBLnSu..EFc8qFW7r0x1f7Gx_K3KMbxrgJT 0A.koSEkkLql1Jvx6xS7t4.P0eUVMTMxSjLSnltIfCqofdR5zyOlY0Fm1BN6vsZSJOH0EsmjKkvn 8dcRWWAOtrwGIa.gEoQuK6TmIgYxI2GVPKCux5gRoK28PC10PAyWjS9ChXI6NyYoYWPS8sl2TNeY 6N9ycBfacM9yic6ZMKqfuuESaTERTTqX.NI2W.rTy7cixCUe55wl0dKL7LWndp.72gDsMpYpUo1z Q9Xc16l3Icj3DXHI_UiCY6NI5U5eVCqCTlc0LqYiaCKqLkPy_phaX8n4qzaAH4ZOr0.B9cA1b Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Wed, 5 Jun 2019 21:37:59 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp402.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 4416cad41684dbe0aaddefb100cc86f1; Wed, 05 Jun 2019 21:17:40 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: crash of 32-bit powerpc -r347549 kernel built via system-clang-8 (crash is while trying to mount the root file system) [debug kernel case: code generation error] From: Mark Millard In-Reply-To: <995DA649-9390-420B-AC95-FFD17079CDA9@yahoo.com> Date: Wed, 5 Jun 2019 14:17:39 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <45D010BF-7654-43A6-8FF4-CCDEEF4004F6@yahoo.com> <4354EA25-69C2-4CAB-8273-62457333BD30@yahoo.com> <995DA649-9390-420B-AC95-FFD17079CDA9@yahoo.com> To: FreeBSD PowerPC ML , FreeBSD Toolchain X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: E91276DFE7 X-Spamd-Bar: +++ X-Spamd-Result: default: False [3.96 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.78)[0.783,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.92)[ip: (7.91), ipnet: 98.137.64.0/21(0.96), asn: 36647(0.77), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.98)[0.977,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.80)[0.799,0]; RCVD_IN_DNSWL_NONE(0.00)[31.65.137.98.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 21:38:08 -0000 [This is from my experiments with more modern toolchains than normally/offocially used, specifically for 32-bit powerpc this time.] On 2019-Jun-5, at 01:35, Mark Millard wrote: > On 2019-Jun-3, at 19:40, Mark Millard wrote: >=20 >> On 2019-Jun-3, at 17:24, Mark Millard wrote: >>=20 >>> I tried (cross) building a 32-bit powerpc kernel and world = (non-debug)=20 >>> with system-clang (on amd64) and use of devel/powerpc64-binutils . = The >>> installed kernel panics trying to mount the root file system. >>>=20 >>> FYI: Typed from picture of screen . . . >>>=20 >>> Trying to mount root from ufs:/dev/ufs/FBSDG4Srootfs [rw,noatime]... >>> panic: getnewbuf_empty: Locked buf 0xd2800000 on free queue. >>> . . . >>> 0xd6919080: at kdb_backtrace+0x64 >>> 0xd69190e0: at vpanic+0x200 >>> 0xd6919150: at panic+0x50 >>> 0xd6919190: at getnewbuf+0x594 >>> 0xd69191f0: at getblkx+0x540 >>> 0xd69192a0: at breadn_flags+0x90 >>> 0xd69192f0: at ffs_use_bread+0x9c >>> 0xd6919330: at readsuper+0x68 >>> 0xd6919370: at ffs_sbget+0xcc >>> 0xd69193c0: at ffs_mount+0x18b8 >>> 0xd69194f0: at vfs_domount+0xa74 >>> 0xd69196a0: at vfs_donmount+0x944 >>> 0xd6919700: at kernel_mount+0x64 >>> 0xd6919740: at parse_mount+0x52c >>> 0xd6919840: at vfs_mountroot+0x71c >>> 0xd69199b0: at start_init+0x44 >>> 0xd6919a10: at fork_exit_0xcc >>> 0xd6919a40: at fork_trampoline+0xc >>> KDB: enter panic >>> [ thread pid 1 tid 100002 ] >>> Stopped at kdb_enter+0x74: addi r3,r0,0x0 >>>=20 >>> This reproduces with each boot attempt. >>>=20 >>> Replacing the kernel with one built via gcc 4.2.1 and booting >>> the result does not panic. >>>=20 >>>=20 >>> FYI for the context of the panic call: >>>=20 >>> /usr/src/sys/kern/vfs_bio.c : >>>=20 >>> static struct buf * >>> buf_alloc(struct bufdomain *bd) >>> { >>> struct buf *bp; >>> int freebufs; >>>=20 >>> /* >>> * We can only run out of bufs in the buf zone if the average = buf >>> * is less than BKVASIZE. In this case the actual wait/block = will >>> * come from buf_reycle() failing to flush one of these small = bufs. >>> */ >>> bp =3D NULL; >>> freebufs =3D atomic_fetchadd_int(&bd->bd_freebuffers, -1); >>> if (freebufs > 0) >>> bp =3D uma_zalloc(buf_zone, M_NOWAIT); >>> if (bp =3D=3D NULL) { >>> atomic_add_int(&bd->bd_freebuffers, 1); >>> bufspace_daemon_wakeup(bd); >>> counter_u64_add(numbufallocfails, 1); >>> return (NULL); >>> } >>> /* >>> * Wake-up the bufspace daemon on transition below threshold. >>> */ >>> if (freebufs =3D=3D bd->bd_lofreebuffers) >>> bufspace_daemon_wakeup(bd); >>>=20 >>> if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) !=3D 0) >>> panic("getnewbuf_empty: Locked buf %p on free queue.", = bp); >>=20 >>=20 >> I tried making a debug kernel build via system-clang-8. It >> reports differently but still during getnewbuf being active >> on the stack (again typed from a picture): >>=20 >> Trying to mount root from ufs:/dev/ufs/FBSDG4Srootfs [rw,noatime]... >> . . . (ignore witness/diagnostic warnings) . . . >> panic: bq_remove: Locked buf 0xd2a00000 not on a queue. >> . . . >> 0xd6b7bfd0: at kdb_backtrace+0x64 >> 0xd6b7c030: at vpanic+0x200 >> 0xd6b7c0a0: at panic+0x50 >> 0xd6b7c0e0: at bq_remove+01e0 >> 0xd6b7c100: at buf_import+0x8c >> 0xd6b7c130: at uma_zalloc_arg+0x544 >> 0xd6b7c190: at getnewbuf+0x380 >> 0xd6b7c1f0: at getblkx+0x620 >> 0xd6b7c290: at breadn_flags+0x90 >> 0xd6b7c2e0: at ffs_use_bread+0xa8 >> 0xd6b7c320: at readsuper+0x68 >> 0xd6b7c360: at ffs_sbget+0xcc >> 0xd6b7c3b0: at ffs_mount+0xefc >> 0xd6b7c4e0: at vfs_domount+0xa754 >> 0xd6b7c690: at vfs_donmount+0x78c >> 0xd6b7c6f0: at kernel_mount+0x7c >> 0xd6b7c730: at parse_mount+0x52c >> 0xd6b7c830: at vfs_mountroot+0x660 >> 0xd6b7c9a0: at start_init+0x4c >> 0xd6b7ca10: at fork_exit_0xb0 >> 0xd6b7ca40: at fork_trampoline+0xc >>=20 >> /usr/src/sys/kern/vfs_bio.c : >>=20 >> static void >> bq_remove(struct bufqueue *bq, struct buf *bp) >> { >>=20 >> CTR3(KTR_BUF, "bq_remove(%p) vp %p flags %X", >> bp, bp->b_vp, bp->b_flags); >> KASSERT(bp->b_qindex !=3D QUEUE_NONE, >> ("bq_remove: buffer %p not on a queue.", bp)); >> . . . >>=20 >> For reference: >>=20 >> static int >> buf_import(void *arg, void **store, int cnt, int domain, int flags) >> { >> struct buf *bp; >> int i; >>=20 >> BQ_LOCK(&bqempty); >> for (i =3D 0; i < cnt; i++) { >> bp =3D TAILQ_FIRST(&bqempty.bq_queue); >> if (bp =3D=3D NULL) >> break; >> bq_remove(&bqempty, bp); >> store[i] =3D bp; >> } >> BQ_UNLOCK(&bqempty); >>=20 >> return (i); >> } >>=20 >>=20 >=20 > I tried building the debug kernel with KTR for KTR_BUF. > Installing and booting the result did not panic. Manually > forcing getting to ddb> soon enough and doing "show ktr" > did show a bq_remove for 0xd2a00000 (and later activity). >=20 > =46rom the looks of the KTR_BUF CTRn's, this suggests to me > that the access to bp->qindex in bq_remove is racy in > some way vs. updates to the value. The code produced by clang for the debug kernel, KTR off in this case, for: KASSERT(bp->b_qindex !=3D QUEUE_NONE, ("bq_remove: buffer %p not on a queue.", bp)); is wrong [the 84(r29) accesses bp->b_qindex]: . . . 00618aa8 lbz r5,84(r29) 00618aac cmplwi r5,4 00618ab0 bgt- 00618c10 . . . 00618c10 lwz r3,-32364(r30) 00618c14 crclr 4*cr1+eq 00618c18 mr r4,r29 00618c1c bl 00541ca0 . . . Comparing against 4 does not match any part of bq_remove. Comparison via gt would make sense for: /usr/src/sys/sys/buf.h: uint8_t b_qindex; /* (Q) buffer = queue index */) if the comparison was against zero. It should have been: /usr/src/sys/kern/vfs_bio.c:#define QUEUE_NONE 0 /* on no queue = */ This is for a head -r347549 32-bit powerpc FreeBSD context, built with system clang (an amd6->powerpc cross build using devel/powerpc64-binutils ). =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Thu Jun 6 06:30:00 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A77715C58C5 for ; Thu, 6 Jun 2019 06:30:00 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic308-8.consmr.mail.gq1.yahoo.com (sonic308-8.consmr.mail.gq1.yahoo.com [98.137.68.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E8B886F19 for ; Thu, 6 Jun 2019 06:29:59 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: _HCWmj0VM1lK4tka6q3trNkY9_ZWbGmZmrH5X5mRl2T0LtEGFMXPYwJVlHaSv_m oagpdDy10JyfYUYYI9O9pgzeRbyuCUCzJPLV1W_HYgfz9FSvAh31M6Aw9Vpr.CtmNXH9TTrg39gI EBofBJFW37yaFYOAImss.mHJgc4EkKLGZNAkl64F4g6otKRRjhF20BY5JD0N21ClYgs.yN0W565C NdYENFV9JtAfXzxOJNJrjCv3MbcSDgAAZbpqQGdbdV.iwPJLgi5FQuh7_w3OoJvMLWLdV.uT1KlI PGVHOgFny0hxKaTykP4FcbdUry0TSIVljhEmj713wdBAY27rX2zoecP7m3wMY0zm_WtvcONlR3mR McGTsxUHvsTW9X.FSYIT3kPKjbZBAdb_EejndRgIXNt.01rzsVqgZxyAlwGWOIc4SfioD8u3ObrG .8kVHqOECoSUrpJ2ZI4kc_Xpu4kJfrE_XksIATpE5zq2E3s5RIGAxIlPlvnsaE8jkQZpUvD.XNMT a3U7wi6HE4c._XxJtYyUhPbFDcf9XUrm75en_q8388pe1TduRbDvFMg7HQoc_sngZusO_tR27mJc 7ZefMQ9Ep_t1F9YPbD3vZi8ZS2Mg_XGnOMhSV2j54K2aq7qlRDiLAtpTdZCuIlVfAkuT3SBdNcI6 uofz57c.wcVtwOa_6IYcuB8aaJP7RWTDaLvKNB5C1q05EpQplIUMohgLlBGsPDBqQQeOh5z6du5i ui3WAo3501LhUBfHVe5ey.1Tdn21kT4oH5mrHHh4IvnOvMPpJcvSIx12SrNkzjO2PjgndX4YVK3J 19.JziXJDBLnf0BwsskV_C5BqBE4vG7T.nyhoDPRarYaNvU8Ql3L9mjuPTfSLFXXtKsdD1SRXuHn E5r94K1ITnVIq_ULQL4VEWCIugfeK_hP1xjp.QICjjmymPbSP5hG4FGdfsGvqp7YhkfcjCzrygO8 8yb5JZP6nltIvfgXVRjt00qsW3NBzj7YeHi2pdBU0W_oqduRuuyvPKQYZc_7_fKTG9kbOkgRVGsL Wz9RWbsgHrJeNCYaA39KiMrEb.lcCvpSIOpEG0SJ0Qw7H1urLcjvITf46oKwXtVUyAdRzOnPC9t0 V1pUZQ2Q2in_v0wmgmHg5Pt1L_EiR5eGP6DZ4.uj4twbqHZ.KRHO.mdhFJMJz8J4d71u5orBJTHH P2vzNv4IVth.w8S3e5nQbToGNbv50VLNYbF7ZtGC_02G_A80DDcFMXVKsfpy2xWxMugKPbF5gKg- - Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.gq1.yahoo.com with HTTP; Thu, 6 Jun 2019 06:29:52 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp413.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID fc3bd0df7b029434349f7020e6ae02b8; Thu, 06 Jun 2019 06:29:50 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: crash of 32-bit powerpc -r347549 kernel built via system-clang-8 (crash is while trying to mount the root file system) [debug kernel case: code generation error] [I was wrong] From: Mark Millard In-Reply-To: Date: Wed, 5 Jun 2019 23:29:49 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <45D010BF-7654-43A6-8FF4-CCDEEF4004F6@yahoo.com> <4354EA25-69C2-4CAB-8273-62457333BD30@yahoo.com> <995DA649-9390-420B-AC95-FFD17079CDA9@yahoo.com> To: FreeBSD PowerPC ML , FreeBSD Toolchain X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 4E8B886F19 X-Spamd-Bar: / X-Spamd-Result: default: False [0.38 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.54)[-0.535,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.90)[0.905,0]; NEURAL_HAM_LONG(-0.38)[-0.379,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.90)[ip: (2.85), ipnet: 98.137.64.0/21(0.96), asn: 36647(0.77), country: US(-0.06)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[32.68.137.98.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 06:30:00 -0000 [I misanalysed the code. Sorry for the noise.] On 2019-Jun-5, at 14:17, Mark Millard wrote: > [This is from my experiments with more modern toolchains than > normally/offocially used, specifically for 32-bit powerpc this > time.] >=20 > On 2019-Jun-5, at 01:35, Mark Millard wrote: >=20 >> On 2019-Jun-3, at 19:40, Mark Millard wrote: >>=20 >>> On 2019-Jun-3, at 17:24, Mark Millard wrote: >>>=20 >>>> I tried (cross) building a 32-bit powerpc kernel and world = (non-debug)=20 >>>> with system-clang (on amd64) and use of devel/powerpc64-binutils . = The >>>> installed kernel panics trying to mount the root file system. >>>>=20 >>>> FYI: Typed from picture of screen . . . >>>>=20 >>>> Trying to mount root from ufs:/dev/ufs/FBSDG4Srootfs = [rw,noatime]... >>>> panic: getnewbuf_empty: Locked buf 0xd2800000 on free queue. >>>> . . . >>>> 0xd6919080: at kdb_backtrace+0x64 >>>> 0xd69190e0: at vpanic+0x200 >>>> 0xd6919150: at panic+0x50 >>>> 0xd6919190: at getnewbuf+0x594 >>>> 0xd69191f0: at getblkx+0x540 >>>> 0xd69192a0: at breadn_flags+0x90 >>>> 0xd69192f0: at ffs_use_bread+0x9c >>>> 0xd6919330: at readsuper+0x68 >>>> 0xd6919370: at ffs_sbget+0xcc >>>> 0xd69193c0: at ffs_mount+0x18b8 >>>> 0xd69194f0: at vfs_domount+0xa74 >>>> 0xd69196a0: at vfs_donmount+0x944 >>>> 0xd6919700: at kernel_mount+0x64 >>>> 0xd6919740: at parse_mount+0x52c >>>> 0xd6919840: at vfs_mountroot+0x71c >>>> 0xd69199b0: at start_init+0x44 >>>> 0xd6919a10: at fork_exit_0xcc >>>> 0xd6919a40: at fork_trampoline+0xc >>>> KDB: enter panic >>>> [ thread pid 1 tid 100002 ] >>>> Stopped at kdb_enter+0x74: addi r3,r0,0x0 >>>>=20 >>>> This reproduces with each boot attempt. >>>>=20 >>>> Replacing the kernel with one built via gcc 4.2.1 and booting >>>> the result does not panic. >>>>=20 >>>>=20 >>>> FYI for the context of the panic call: >>>>=20 >>>> /usr/src/sys/kern/vfs_bio.c : >>>>=20 >>>> static struct buf * >>>> buf_alloc(struct bufdomain *bd) >>>> { >>>> struct buf *bp; >>>> int freebufs; >>>>=20 >>>> /* >>>> * We can only run out of bufs in the buf zone if the average = buf >>>> * is less than BKVASIZE. In this case the actual wait/block = will >>>> * come from buf_reycle() failing to flush one of these small = bufs. >>>> */ >>>> bp =3D NULL; >>>> freebufs =3D atomic_fetchadd_int(&bd->bd_freebuffers, -1); >>>> if (freebufs > 0) >>>> bp =3D uma_zalloc(buf_zone, M_NOWAIT); >>>> if (bp =3D=3D NULL) { >>>> atomic_add_int(&bd->bd_freebuffers, 1); >>>> bufspace_daemon_wakeup(bd); >>>> counter_u64_add(numbufallocfails, 1); >>>> return (NULL); >>>> } >>>> /* >>>> * Wake-up the bufspace daemon on transition below threshold. >>>> */ >>>> if (freebufs =3D=3D bd->bd_lofreebuffers) >>>> bufspace_daemon_wakeup(bd); >>>>=20 >>>> if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) !=3D 0) >>>> panic("getnewbuf_empty: Locked buf %p on free queue.", = bp); >>>=20 >>>=20 >>> I tried making a debug kernel build via system-clang-8. It >>> reports differently but still during getnewbuf being active >>> on the stack (again typed from a picture): >>>=20 >>> Trying to mount root from ufs:/dev/ufs/FBSDG4Srootfs [rw,noatime]... >>> . . . (ignore witness/diagnostic warnings) . . . >>> panic: bq_remove: Locked buf 0xd2a00000 not on a queue. >>> . . . >>> 0xd6b7bfd0: at kdb_backtrace+0x64 >>> 0xd6b7c030: at vpanic+0x200 >>> 0xd6b7c0a0: at panic+0x50 >>> 0xd6b7c0e0: at bq_remove+01e0 >>> 0xd6b7c100: at buf_import+0x8c >>> 0xd6b7c130: at uma_zalloc_arg+0x544 >>> 0xd6b7c190: at getnewbuf+0x380 >>> 0xd6b7c1f0: at getblkx+0x620 >>> 0xd6b7c290: at breadn_flags+0x90 >>> 0xd6b7c2e0: at ffs_use_bread+0xa8 >>> 0xd6b7c320: at readsuper+0x68 >>> 0xd6b7c360: at ffs_sbget+0xcc >>> 0xd6b7c3b0: at ffs_mount+0xefc >>> 0xd6b7c4e0: at vfs_domount+0xa754 >>> 0xd6b7c690: at vfs_donmount+0x78c >>> 0xd6b7c6f0: at kernel_mount+0x7c >>> 0xd6b7c730: at parse_mount+0x52c >>> 0xd6b7c830: at vfs_mountroot+0x660 >>> 0xd6b7c9a0: at start_init+0x4c >>> 0xd6b7ca10: at fork_exit_0xb0 >>> 0xd6b7ca40: at fork_trampoline+0xc >>>=20 >>> /usr/src/sys/kern/vfs_bio.c : >>>=20 >>> static void >>> bq_remove(struct bufqueue *bq, struct buf *bp) >>> { >>>=20 >>> CTR3(KTR_BUF, "bq_remove(%p) vp %p flags %X", >>> bp, bp->b_vp, bp->b_flags); >>> KASSERT(bp->b_qindex !=3D QUEUE_NONE, >>> ("bq_remove: buffer %p not on a queue.", bp)); >>> . . . >>>=20 >>> For reference: >>>=20 >>> static int >>> buf_import(void *arg, void **store, int cnt, int domain, int flags) >>> { >>> struct buf *bp; >>> int i; >>>=20 >>> BQ_LOCK(&bqempty); >>> for (i =3D 0; i < cnt; i++) { >>> bp =3D TAILQ_FIRST(&bqempty.bq_queue); >>> if (bp =3D=3D NULL) >>> break; >>> bq_remove(&bqempty, bp); >>> store[i] =3D bp; >>> } >>> BQ_UNLOCK(&bqempty); >>>=20 >>> return (i); >>> } >>>=20 >>>=20 >>=20 >> I tried building the debug kernel with KTR for KTR_BUF. >> Installing and booting the result did not panic. Manually >> forcing getting to ddb> soon enough and doing "show ktr" >> did show a bq_remove for 0xd2a00000 (and later activity). >>=20 >> =46rom the looks of the KTR_BUF CTRn's, this suggests to me >> that the access to bp->qindex in bq_remove is racy in >> some way vs. updates to the value. >=20 > The code produced by clang for the debug kernel, KTR > off in this case, for: >=20 > KASSERT(bp->b_qindex !=3D QUEUE_NONE, > ("bq_remove: buffer %p not on a queue.", bp)); >=20 > is wrong [the 84(r29) accesses bp->b_qindex]: >=20 > . . . > 00618aa8 lbz r5,84(r29) > 00618aac cmplwi r5,4 > 00618ab0 bgt- 00618c10 > . . . > 00618c10 lwz r3,-32364(r30) > 00618c14 crclr 4*cr1+eq > 00618c18 mr r4,r29 > 00618c1c bl 00541ca0 > . . . >=20 > Comparing against 4 does not match any part of > bq_remove. Comparison via gt would make sense for: Wrong. The 4 and gt use comes from inlining bufqueue(bp) in the following KASSERT. For reference (from the .i): bufqueue(struct buf *bp) { switch (bp->b_qindex) { case 0: case 4: return (((void *)0)); case 1: return (&bqempty); case 2: return (&bufdomain(bp)->bd_dirtyq); case 3: return (&bufdomain(bp)->bd_subq[bp->b_subqueue]); default: break; } panic("bufqueue(%p): Unhandled type %d\n", bp, bp->b_qindex); } The code generation put the first KASSERT's related panic in to case 0 above when bufqueue was inlined. > /usr/src/sys/sys/buf.h: uint8_t b_qindex; /* (Q) buffer = queue index */) >=20 > if the comparison was against zero. It should > have been: >=20 > /usr/src/sys/kern/vfs_bio.c:#define QUEUE_NONE 0 /* on no queue = */ >=20 >=20 > This is for a head -r347549 32-bit powerpc FreeBSD context, > built with system clang (an amd6->powerpc cross build using > devel/powerpc64-binutils ). =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Fri Jun 7 01:05:50 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7020415C4B3E for ; Fri, 7 Jun 2019 01:05:50 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-33.consmr.mail.ne1.yahoo.com (sonic317-33.consmr.mail.ne1.yahoo.com [66.163.184.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D6078EA71 for ; Fri, 7 Jun 2019 01:05:49 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: W2lRwVYVM1lXvSjKLRl3y0fz1M3CZuapGEHQQ3cCP1EQf1PwnC7Lqdl.dkyDv9B Dr.__q1Vi4QT6JwbO04PJlajLzF5Juzoy3HA5iPZxSM_dBjuf_LbNsl7BecIuEh84uJ1Rp88vvWZ tI07Kun0miYcSUAh2xLiHBY0aqZcZ6DXlo4CUKEm4jv.U.v89qTVBrWr5A_587QiH9pLo9CFdOYe PKT6WFixLeEO2NJA9378ph2L_vmdq.cEOiGlao_LTNCh7f1pGvT3JW736MVy66ZhiJn7VW0ChRdT Ysx6yLO8dbUK.sGuFA4XxRaetRh._y3svKOsEL.z_gLtPnYj_0kxaFupOV4O3JRtp6gk12k828uj OmxTL_2Jetho2kYwLLSj_.oY97hTR25C4Hv5YZxd8v4LV1Q0NPjXOvFJSln0tR8h7Z3Y8GxWLS4p azayaLXWiW6QfR4ZC2zCxXfPxJDhfnF_KaN3xlRqPMzMarSXkBB4g5b3DZGU7HjJOapRSer384Mr ekYU8TLJrdEwgmLg.a.p2d2VfvxgKel24GnRUvcyEyUdoXDSTrhdQRBdJr38RQjADCQa6QNEyx2T .pYLHZl.gILlVopRB44q.nx6hmqSJa3ho8Oms9DLiwnYT1bUOXPwxZ5KbIOslOECOy8ZwmmB5fHP TZjTcZET_xihPQJSSl9eD0N9zwH8Ofc6sTGgsFM9PkqLbhj8ubHei1VC4liH2UjhnAX9OC0xjxJC 0umLcKku0d.hpUkBT0Utj0Fv31M7poH3dZZiazGOlPFdrLwybpsvDYwo7m669FceLypringJIpat kKtiYtVcNUvfWbyb5UdiZY.DZEAmBtktVq2zFyaN4rRys1JG_2arZYm0DgRAlsYzAwRdRx0jagVf itFV0ruIhUuNFznJvfCa6PqZIOGAZvsYCKSwonXqOb3lv9xjGg44vWdeH3I4Go.2rgeNpKAC772H aIYvswxNj8g48OBCFVeVkYNBemVg.RVtp9qWjwHTHtMo5wmW2yfqOg65IGD9_9bK2jgsxo.2g0RM IySEEed_6bNjC3sopTC3mq55ihYM26Yw2lhP444EE3jKLt7rQSI19QK7ilxgQWno.A3B2A3.Ug2r EqmR15YCRdEG2X2ofZk7epLTVTVsfif98Ben67TAzgOOCLFooAZa6mEanNcnNMtFCwtpUbiB3AbW xx0baHUbvTM_5qiNjfBBc0BYH5jWDU70rd6cNxVYjUYG1yQu76hYQSyibrnRexQIc5Q-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Fri, 7 Jun 2019 01:05:41 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp411.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 0600df7bc35a82fe991dc851522bfdd0; Fri, 07 Jun 2019 00:55:34 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: 32-bit powerpc's elf_reloc_internal has no support for R_PPC_JMP_SLOT but clang with devel/powerpc64-binutils uses such for building kernel modules Message-Id: Date: Thu, 6 Jun 2019 17:55:33 -0700 To: FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 3D6078EA71 X-Spamd-Bar: ++++ X-Spamd-Result: default: False [4.33 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.95)[0.953,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(2.16)[ip: (8.43), ipnet: 66.163.184.0/21(1.35), asn: 36646(1.08), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.90)[0.904,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.82)[0.824,0]; RCVD_IN_DNSWL_NONE(0.00)[44.184.163.66.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 01:05:50 -0000 /usr/src/sys/powerpc/powerpc/elf64_machdep.c has: static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void = *data, int type, int local, elf_lookup_fn lookup) { . . . case R_PPC_JMP_SLOT: /* function descriptor copy */ lookup(lf, symidx, 1, &addr); #if !defined(_CALL_ELF) || _CALL_ELF =3D=3D 1 memcpy(where, (Elf_Addr *)addr, 3*sizeof(Elf_Addr)); #else *where =3D addr; #endif __asm __volatile("dcbst 0,%0; sync" :: "r"(where) : = "memory"); break; . . . But /usr/src/sys/powerpc/powerpc/elf32_machdep.c 's elf_reloc_internal does not have any R_PPC_JMP_SLOT case in its code. Yet, from using clang as the system compiler for targeting 32-bit = powerpc, readelf -asW /boot/kernel/if_gem.ko shows the likes of: Relocation section with addend (.rela.plt): r_offset r_info r_type st_value st_name + r_addend 00018328 00000215 R_PPC_JMP_SLOT 00000000 if_maddr_runlock + 0 00018330 00000315 R_PPC_JMP_SLOT 00000000 mii_mediachg + 0 00018338 00000415 R_PPC_JMP_SLOT 00000000 m_freem + 0 00018340 00000515 R_PPC_JMP_SLOT 00000000 device_get_softc + 0 00018348 00000715 R_PPC_JMP_SLOT 00000000 device_set_desc + 0 00018350 00000815 R_PPC_JMP_SLOT 00000000 printf + 0 00018358 00000b15 R_PPC_JMP_SLOT 00000000 ether_crc32_le + 0 00018360 00000e15 R_PPC_JMP_SLOT 00000000 bpf_mtap + 0 . . . # file /boot/kernel/if_gem.ko /boot/kernel/if_gem.ko: ELF 32-bit MSB shared object, PowerPC or cisco = 4500, version 1 (FreeBSD), dynamically linked, = BuildID[sha1]=3D013a358835fddcd6bbb82d35a6ce36243eccb743, not stripped So, naturally, module loading such (manual or automatic) is a problem for the 32-bit powerpc context. The context was head -r347549 . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Fri Jun 7 02:41:21 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12B4E15C6407 for ; Fri, 7 Jun 2019 02:41:21 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E041D90EC0 for ; Fri, 7 Jun 2019 02:41:19 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lj1-x241.google.com with SMTP id k18so360913ljc.11 for ; Thu, 06 Jun 2019 19:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni-cwru-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lxx9X12wr6SFQ1dBUqofZZSSFJYnJECxQf8egrIkSg4=; b=kBhz+98703jETyOJxShRfMjlVbFb1wH8onZ9817lwYZf0I4OGsF3DVN6p4dFDNsNV9 l3R+/FqJcct4F41R52Ff9LBncXEI9Nh8hLGikGT/SXkX7y+VZvGDwxaX9W1G67mLPRuX Tih0eGQ1op5ngHSwghbI97EDwAraIeY7PbfL6jiU5xKPe7NQ8uTcYr7Brb6Q/74SaB/m lVAOIxbDy3RifpXXgJjZ8fjPGTdxDOlhVpnFyA/f93nBRYK8lLH6tfNCr+WwrMWzhHsb sJYZabOVuMJfA8uc9Pdf6azHA+eGBUbP41OY8dna4Clc9p6v1Xnch61ZCqtjfPPa8rGp 5/3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lxx9X12wr6SFQ1dBUqofZZSSFJYnJECxQf8egrIkSg4=; b=fKopSNzyt5TvLPkyMGE30rFOO2AqzBemol7pBsdCSqDNmf2eWksevX2u9McPg6+071 c4Uo4fzD++GIR3dGudt2Q0rMkAbJG8A9HiywCYh6HKRNmYaIwg4ENL38S0KhAY+uM+1w XYneXICtGH8o/37ZV84hBnPB+K9KkfK8Ksri36AaCWISuNTEJUbYtuDmwJm+whd+WvlK 1b++IBh0H5oDQjy2ZCTjaMC8jnBFLPDmYBXHHrgkYkoXR5+QZkCQ63fMKNbGHEhNkzx6 /Z+QYlzTdd+Svq+8nwW6hWbTk1xgDczRv0FR48dELeUnv29U9zZzWGa22BzTDN3mWwDM rz1w== X-Gm-Message-State: APjAAAX95rZMBxDS7hAyATuzPhVwjsXmkvPzP+QNyrPa0y9+NKWUxF7S ITvybrgBE/cNozx/RhufEjP6bMNbDUCD0SXBE/8= X-Google-Smtp-Source: APXvYqxCsPJw8wTaPWrQ5HBSlTXZuNDkvU5HpybyMEOQMIZ7Df2jJmpVCLKihVomXst+OPf8ynJxiJsKR+R9j4O9/lo= X-Received: by 2002:a2e:3912:: with SMTP id g18mr18037624lja.38.1559875277769; Thu, 06 Jun 2019 19:41:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Justin Hibbits Date: Thu, 6 Jun 2019 21:41:06 -0500 Message-ID: Subject: Re: 32-bit powerpc's elf_reloc_internal has no support for R_PPC_JMP_SLOT but clang with devel/powerpc64-binutils uses such for building kernel modules To: Mark Millard Cc: FreeBSD PowerPC ML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: E041D90EC0 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=alumni-cwru-edu.20150623.gappssmtp.com header.s=20150623 header.b=kBhz+987; spf=pass (mx1.freebsd.org: domain of chmeeedalf@gmail.com designates 2a00:1450:4864:20::241 as permitted sender) smtp.mailfrom=chmeeedalf@gmail.com X-Spamd-Result: default: False [-3.15 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.986,0]; R_DKIM_ALLOW(-0.20)[alumni-cwru-edu.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; DMARC_NA(0.00)[cwru.edu]; NEURAL_HAM_SHORT(-0.54)[-0.539,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[alumni-cwru-edu.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[1.4.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[jrh29@alumni.cwru.edu,chmeeedalf@gmail.com]; FREEMAIL_TO(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[jrh29@alumni.cwru.edu,chmeeedalf@gmail.com]; IP_SCORE(-0.42)[ip: (2.61), ipnet: 2a00:1450::/32(-2.33), asn: 15169(-2.30), country: US(-0.06)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 02:41:21 -0000 On Thu, Jun 6, 2019 at 8:06 PM Mark Millard via freebsd-ppc wrote: > > > /usr/src/sys/powerpc/powerpc/elf64_machdep.c has: > > static int > elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, > int type, int local, elf_lookup_fn lookup) > { > . . . > case R_PPC_JMP_SLOT: /* function descriptor copy */ > lookup(lf, symidx, 1, &addr); > #if !defined(_CALL_ELF) || _CALL_ELF == 1 > memcpy(where, (Elf_Addr *)addr, 3*sizeof(Elf_Addr)); > #else > *where = addr; > #endif > __asm __volatile("dcbst 0,%0; sync" :: "r"(where) : "memory"); > break; > > . . . > > But /usr/src/sys/powerpc/powerpc/elf32_machdep.c 's elf_reloc_internal > does not have any R_PPC_JMP_SLOT case in its code. > > Yet, from using clang as the system compiler for targeting 32-bit powerpc, > readelf -asW /boot/kernel/if_gem.ko shows the likes of: > > Relocation section with addend (.rela.plt): > r_offset r_info r_type st_value st_name + r_addend > 00018328 00000215 R_PPC_JMP_SLOT 00000000 if_maddr_runlock + 0 > 00018330 00000315 R_PPC_JMP_SLOT 00000000 mii_mediachg + 0 > 00018338 00000415 R_PPC_JMP_SLOT 00000000 m_freem + 0 > 00018340 00000515 R_PPC_JMP_SLOT 00000000 device_get_softc + 0 > 00018348 00000715 R_PPC_JMP_SLOT 00000000 device_set_desc + 0 > 00018350 00000815 R_PPC_JMP_SLOT 00000000 printf + 0 > 00018358 00000b15 R_PPC_JMP_SLOT 00000000 ether_crc32_le + 0 > 00018360 00000e15 R_PPC_JMP_SLOT 00000000 bpf_mtap + 0 > . . . > > # file /boot/kernel/if_gem.ko > /boot/kernel/if_gem.ko: ELF 32-bit MSB shared object, PowerPC or cisco 4500, version 1 (FreeBSD), dynamically linked, BuildID[sha1]=013a358835fddcd6bbb82d35a6ce36243eccb743, not stripped > > So, naturally, module loading such (manual or automatic) > is a problem for the 32-bit powerpc context. > > The context was head -r347549 . > > === > Mark Millard > marklmi at yahoo.com > ( dsl-only.net went > away in early 2018-Mar) Can you try this patch? Untested, just compiled. It's essentially a copy of the ELFv2 part of the elf64_machdep bit you posted above. - Justin diff --git a/sys/powerpc/powerpc/elf32_machdep.c b/sys/powerpc/powerpc/elf32_machdep.c index 11c14671d0b..219a61363cd 100644 --- a/sys/powerpc/powerpc/elf32_machdep.c +++ b/sys/powerpc/powerpc/elf32_machdep.c @@ -295,6 +295,12 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, *where = elf_relocaddr(lf, relocbase + addend); break; + case R_PPC_JMP_SLOT: + lookup(lf, symidx, 1, &addr); + *where = addr; + __asm __volatile("dcbst 0,%0; sync" :: "r"(where) : "memory"); + break; + default: printf("kldload: unexpected relocation type %d\n", (int) rtype); From owner-freebsd-ppc@freebsd.org Fri Jun 7 10:21:58 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C97D015A85A3 for ; Fri, 7 Jun 2019 10:21:58 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-15.consmr.mail.bf2.yahoo.com (sonic315-15.consmr.mail.bf2.yahoo.com [74.6.134.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADD6E6DF90 for ; Fri, 7 Jun 2019 10:21:57 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: jzMihPoVM1n4ta6LOQZqwQrO6bE6qNrrwdL0rDZGi8MvNGCaGUQgZm_pJqyxCoQ 7047RZ1CQoJuUnbO9XqTO4dk44coMd.JWp4hE8U5_WVALH4XasghkInZyBa9eR84e0nIirPHQtZi nJCwVL95WyiuidypsFkJvQewwaNYhfIwlfcltQtj8D4xJ6Q1Uy7IvAVxCAefpclrFD5XmDkasjGk Wwe86h_Mg294KmDjtpH0tnEeLdM29A32fsRnB5SHyLPz772YJenr1hg4N498gEGo4Q0Y3qZgU9Tr Z.NyOkk0CrpIpo1iz9mfu7Fa6e_ky6Qp.RVYYDyXJHgFXKkR_P6jFakKDpQAmq7ay_2BVURekpqB RDKdgHfrBhL2r1GM48akwq1JaVoEF4_ReVzH.KKexPs6qMiynaO1b8gx842KGPj_KXJ.WaJOoIRm ePhxbOl3Ag_25Arn._7lEDPjrMobNpFiJeIVoe_YCZ0bZYtA52ZHkk0EWcpjZgGIS4u_uSTqpYhg SBZsc2KnldH2zjeFDb6QKDtjmmzSnm.aPYHrdJQiY2XHPlX11G8uPLft5RVUAZSLpsQ5EgsOF_pS Qsz8XXzznrwg7bhgcVboWtDsfxms.RqrOmqQa3kHy.XakOejvnUbSm9SApNaVLGmHwDLerTltea1 tZrFVMGLtvNW5tyHa1fmHdTklQtfkuZMR7Af41i67eJL1bSns9iGAUeA5ZoMcOdjL3gID4RkGuw. bc.4UF_TIyLEZ.faY5Ayy9il4twPN6pMiPv8qdjfTKe72VZuIyCdWZoOi1YIVCyzIkTtQHiVnCvX mG4X6eApX03MvUWZuMaP8iM8gLOc3mmlYq13Fmzb7fuSCQ8DcxP1JarPKMQvbDHSy.a7x6xWBLg4 FUASx7oKgq._ndDbMBKrzQXXT.qFC_B8ceMbhXyieKcqVzTqbvHg6MpAFUqxuBPcImKizqAcaXLj .5gSeM76TQ0wGK2FilhW.SGL4mqckwfyatDpbbU2xwHc3MGKMxj5MGHh4Dk_eMSXTprMaxDrB5ri Vh6GVaM6r1Sb1G0YIsZ2vlRXYxiAfSaRFqtOuo1DbE6qGNT6_NJhuQ4.xQiWZ28LNl5RlqkVUq_4 7VWwkJDSHsaCeNGnnfA2x6xxr3GYZzQXuOdXbfp.eSpYEfI.vDXdwhKSYRQaitw3aUh44V1DyB0s ndkKYxDrPU.JzVhdPCfY5QX2vziPCo4gzLj_C8HCJjxjbT891J9QdqzXn_Jx80w-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.bf2.yahoo.com with HTTP; Fri, 7 Jun 2019 10:21:51 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.113]) ([67.170.167.181]) by smtp429.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 9d9a361610f42d057fc0bafb86364161; Fri, 07 Jun 2019 10:21:47 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: 32-bit powerpc's elf_reloc_internal has no support for R_PPC_JMP_SLOT but clang with devel/powerpc64-binutils uses such for building kernel modules From: Mark Millard In-Reply-To: Date: Fri, 7 Jun 2019 03:21:44 -0700 Cc: FreeBSD PowerPC ML Content-Transfer-Encoding: quoted-printable Message-Id: <52B6890B-1514-424B-AC4F-B6419F8CBC79@yahoo.com> References: To: Justin Hibbits X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: ADD6E6DF90 X-Spamd-Bar: +++ X-Spamd-Result: default: False [3.37 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.69)[0.687,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.61)[ip: (5.37), ipnet: 74.6.128.0/21(1.53), asn: 26101(1.22), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.83)[0.833,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.74)[0.742,0]; RCVD_IN_DNSWL_NONE(0.00)[125.134.6.74.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 10:21:59 -0000 On 2019-Jun-6, at 19:41, Justin Hibbits = wrote: > On Thu, Jun 6, 2019 at 8:06 PM Mark Millard via freebsd-ppc > wrote: >>=20 >>=20 >> /usr/src/sys/powerpc/powerpc/elf64_machdep.c has: >>=20 >> static int >> elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void = *data, >> int type, int local, elf_lookup_fn lookup) >> { >> . . . >> case R_PPC_JMP_SLOT: /* function descriptor copy */ >> lookup(lf, symidx, 1, &addr); >> #if !defined(_CALL_ELF) || _CALL_ELF =3D=3D 1 >> memcpy(where, (Elf_Addr *)addr, 3*sizeof(Elf_Addr)); >> #else >> *where =3D addr; >> #endif >> __asm __volatile("dcbst 0,%0; sync" :: "r"(where) : = "memory"); >> break; >>=20 >> . . . >>=20 >> But /usr/src/sys/powerpc/powerpc/elf32_machdep.c 's = elf_reloc_internal >> does not have any R_PPC_JMP_SLOT case in its code. >>=20 >> Yet, from using clang as the system compiler for targeting 32-bit = powerpc, >> readelf -asW /boot/kernel/if_gem.ko shows the likes of: >>=20 >> Relocation section with addend (.rela.plt): >> r_offset r_info r_type st_value st_name + r_addend >> 00018328 00000215 R_PPC_JMP_SLOT 00000000 if_maddr_runlock + 0 >> 00018330 00000315 R_PPC_JMP_SLOT 00000000 mii_mediachg + 0 >> 00018338 00000415 R_PPC_JMP_SLOT 00000000 m_freem + 0 >> 00018340 00000515 R_PPC_JMP_SLOT 00000000 device_get_softc + 0 >> 00018348 00000715 R_PPC_JMP_SLOT 00000000 device_set_desc + 0 >> 00018350 00000815 R_PPC_JMP_SLOT 00000000 printf + 0 >> 00018358 00000b15 R_PPC_JMP_SLOT 00000000 ether_crc32_le + 0 >> 00018360 00000e15 R_PPC_JMP_SLOT 00000000 bpf_mtap + 0 >> . . . >>=20 >> # file /boot/kernel/if_gem.ko >> /boot/kernel/if_gem.ko: ELF 32-bit MSB shared object, PowerPC or = cisco 4500, version 1 (FreeBSD), dynamically linked, = BuildID[sha1]=3D013a358835fddcd6bbb82d35a6ce36243eccb743, not stripped >>=20 >> So, naturally, module loading such (manual or automatic) >> is a problem for the 32-bit powerpc context. >>=20 >> The context was head -r347549 . >>=20 >> =3D=3D=3D >> Mark Millard >> marklmi at yahoo.com >> ( dsl-only.net went >> away in early 2018-Mar) >=20 > Can you try this patch? Untested, just compiled. It's essentially a > copy of the ELFv2 part of the elf64_machdep bit you posted above. >=20 > - Justin >=20 > diff --git a/sys/powerpc/powerpc/elf32_machdep.c > b/sys/powerpc/powerpc/elf32_machdep.c > index 11c14671d0b..219a61363cd 100644 > --- a/sys/powerpc/powerpc/elf32_machdep.c > +++ b/sys/powerpc/powerpc/elf32_machdep.c > @@ -295,6 +295,12 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr > relocbase, const void *data, > *where =3D elf_relocaddr(lf, relocbase + addend); > break; >=20 > + case R_PPC_JMP_SLOT: > + lookup(lf, symidx, 1, &addr); > + *where =3D addr; > + __asm __volatile("dcbst 0,%0; sync" :: "r"(where) : = "memory"); > + break; > + > default: > printf("kldload: unexpected relocation type %d\n", > (int) rtype); [I was away from the PowerMac, thus the delay.] Other things that I've not figured out block use of a clang based kernel for my oontext. So this was a test of a gcc-4.2.1-based debug kernel loading a clang built filemon.ko (also from a debug build). This was done via the loader prompt: Ok unload Ok load /boot/kerdbg/kernel Ok boot At the time /boot/kernel/* was from a clang-based build. The above context still uses /boot/kernel/ for finding modules, not /boot/kerdbg/ . Attempting kldload filemon.ko after booting (as an example of something with R_PPC_JMP_SLOT involved) caused a system crash via an illegal instruction: (typed from a picture of the screen) exception =3D 0x700 (program) srr0 =3D 0xdd3a28b0 srr1 =3D 0x89032 current msr=3D 0x9032 ls =3D 0xdd38fcd8 frame=3D 0x24f23a0 pid =3D 1247, comm =3D kldload . . . kdb_backtrace+0x5c vpanic+0x1f8 panic+0x54 trap_fatal+0x238 trap+0xca8 powerpc_interrupt+0x248 kernel PGM trap by _GLOBAL_OFFSET_TABLE+0x13c: srr1=3D0x89032 r1=3D0xe1d3e5d0 cr=3D0x8000f044 xer=3D0x2000000 ctr=3D0xdd38fcfc = frame=3D0xe1d3e518 0xca2af4 module_register_init+0xb4 linker_load_module_+0x8dc kern_kldload+0x138 sys_kldload+0x80 trap+0x54c powerpc_interrupt+0x248 user SC trap by 0x418a44f8: srr1=3D0xf032 r1=3D0xffffd750 cr=3D0x44222800 xer=3D0 ctr=3D0x418a44f0 = frame=3D0xe1d3ea48 A better test would be not from my experimental environment, say matching some artifact build, other than haivng your patch. But if I do that it will not be tonight/this-morning. I do not expect a different result. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Fri Jun 7 15:42:48 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4904415B02D5 for ; Fri, 7 Jun 2019 15:42:48 +0000 (UTC) (envelope-from bacon4000@gmail.com) Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 517027736D for ; Fri, 7 Jun 2019 15:42:47 +0000 (UTC) (envelope-from bacon4000@gmail.com) Received: by mail-io1-xd44.google.com with SMTP id e5so1759590iok.4 for ; Fri, 07 Jun 2019 08:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=qRX0nDP/gEMS+RuaXv8IYPCxusd/nMh+3P77XrTGeGU=; b=PLmBbQSfVIu8tIZR7gAtNHDmpnTnq86KEThDuvv88g1YlNTKiJv/jnWPJcMqrN7SwF BIoL9dD6CPDT43FJFqStqFHt7eXwG8XazPcK2yxs12QEdeK9BoCr36KxTxDIN3yzhBo7 Q1cCjwcx88HCs7gE5B0pUU9ENFzIELxXN2PytbcOa8mDSvwnurSGtgaxe+QUUAn5IqGc x6uzQsBZkeDRZQRAgAn7Ya3IxPqXzZ6hTauW2migh/0elSPCfM6Re76p788XDqIfBdFH U6kAJKdKX9AIXsrwWAM1f0jCkudyORrnonbjeK1fWzcct6shSJVhaFxnfjCr/aF6/OB5 hQag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=qRX0nDP/gEMS+RuaXv8IYPCxusd/nMh+3P77XrTGeGU=; b=Ko8NoWqvf7hcAN1wUGBh0G29F5cLw86w9i/0cZmQXTu57fEQgpGDgWnIm2CEVcD8ao /UzeU66g5Yex5kmtSxdBJRXUez6jjnq+CLMMa2GrMtnhPhfyPm9pv+UhW4Gzc4ZaxTa+ TfQqIgYSOIRPHg3Kgg3KJMwm1eYBY+lrV25Q02sEIYX8G7SgJrTO7z4u4spZFe99bdXM sVewEeR/kHfTR8rb8Gt2EL0Iysl85Nibkcv2lZa5bsjRuu56LVNflN8GHxvtPXRGSIPn H5qYWUruZM5h/6E0AGRWLDntIluibkkI1GGjQIZNtyzKNUBMgVJw2zGmjaRJ623jd+H3 TgLQ== X-Gm-Message-State: APjAAAWPbweNQ7YYdRmeqozhDsYOEFspUgqV65XEe2TdHYkLnaIYGWmU h99XkP+WqkdW/flfoawex6G0kOF5 X-Google-Smtp-Source: APXvYqyt4vVCoXPmOsTtKVuL/Ssf14T3rcNHa1xJgUCVcJ/6yD68ejTWqxedOU5gu5AHc9oknqYnsQ== X-Received: by 2002:a6b:6505:: with SMTP id z5mr11444873iob.295.1559922166361; Fri, 07 Jun 2019 08:42:46 -0700 (PDT) Received: from manatee.acadix.biz (cpe-174-102-163-140.wi.res.rr.com. [174.102.163.140]) by smtp.gmail.com with ESMTPSA id w194sm986413itb.33.2019.06.07.08.42.45 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 07 Jun 2019 08:42:45 -0700 (PDT) Subject: Re: powerpc64 system-clang-8 based context: x11-toolkits/qt5-declarative fails to build in poudriere: /usr/local/lib/qt5/bin/qlalr segmentation faults in std::type_info::~type_info() () from /usr/local/lib/gcc8/libstdc++.so.6 To: Mark Millard Cc: freebsd-ppc@freebsd.org References: <8B8355C5-731B-4F03-AA98-11324C618D3C@yahoo.com> <590AAD80-8D2F-4F7A-8910-001D72A5E666@yahoo.com> <22D9DF10-E58A-49E5-8372-CC9D263A7C76@yahoo.com> <33026AD5-9CB0-43CB-84EA-5B2B914A7EB0@yahoo.com> <3B3EACF3-00D8-48B7-A3C0-8AA6E0279041@yahoo.com> <20190524182522.GA17299@lonesome.com> <1A31ACF2-746A-49D2-80D5-E80392704B4E@yahoo.com> From: Jason Bacon Message-ID: Date: Fri, 7 Jun 2019 10:42:45 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 517027736D X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=PLmBbQSf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of bacon4000@gmail.com designates 2607:f8b0:4864:20::d44 as permitted sender) smtp.mailfrom=bacon4000@gmail.com X-Spamd-Result: default: False [-3.10 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; LONG_SUBJ(1.66)[221]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FREEMAIL_TO(0.00)[yahoo.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[4.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.78)[ip: (1.66), ipnet: 2607:f8b0::/32(-3.22), asn: 15169(-2.30), country: US(-0.06)] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 15:42:48 -0000 On 2019-05-28 18:51, Mark Millard wrote: > > On 2019-May-28, at 14:57, Jason Bacon wrote: > >> On 2019-05-28 14:19, Mark Millard via freebsd-ppc wrote: >>>> Plus qt5 is outside the range of gcc 4.2.1 to cover, so for it >>>> a usable "gcc in base" would mean base/gcc or some such substitution. >>>> But base/gcc does not imply any version of libstdc++ is in use either: >>>> same problem as system-clang-8-based if something like lang/gcc8 is >>>> used for qt5. >>>> >>>> Even if libstdc++ was (hypothetically) used, the vintage from >>>> base/gcc or devel/*-gcc sorts of materials would not generally >>>> match lang/gcc8 or whatever compiler:c++11-lib and the like >>>> might default to. >>>> >>>> For the likes of qt5, care must be taken that, for example, >>>> devel/icu and its: >>>> >>>> /usr/local/lib/libicui18n.so.64 >>>> /usr/local/lib/libicuuc.so.64 >>>> >>>> vs. qt5: they must use the same c++ library and vintage. >>>> >>>> Then there are things that really could use gcc 4.2.1 from >>>> base: mixed libstdc++ vintages could result, even if some >>>> port lang/gcc* toolchain is used. >>>> >>>> Definitely a messy context. >>>> >>>> The failing behavior (program crash very early when starting) >>>> was not obviously tied to c++ library mixes being involved. It >>>> would be handy if some stage of building/installing/running >>>> caught the presence of such a bad combination and was explicit >>>> about it. >>> I probably should have mentioned using the likes of >>> base/binutils and base/gcc and ending up with a gcc >>> based system c and c++ but a system libc++ / libcxxrt >>> instead of libstdc++ . This would still make for the >>> odd mix of libc++ / libcxxrt vs. libstdc++ if: >>> >>> /usr/local/lib/libicui18n.so.64 >>> /usr/local/lib/libicuuc.so.64 >>> >>> were built by the system toolchain but qt5-core was >>> built by something like lang/gcc8 . >>> >>> system-clang vs. lang/gcc* need not be the only odd >>> context. >>> >>> >> Has anyone explored using ports gcc for *all* ports (except gcc and dependencies)? >> >> e.g. in make.conf something like >> >> .if ${PKGBASE} != "gcc8" && ${PKGBASE} != "gmp" && ... >> USE_GCC=yes >> .endif >> >> I've been using this technique very successfully with pkgsrc on CentOS, which has basically the same problem with antiquated base compilers (CentOS 7 is the current maintstream and it uses gcc 4.8). >> >> This eliminates tool chain mixing and only a handful of ports need patching to work with legacy gcc. > Such is not a direction that I've been experimenting > with. (But what toolchains work for what ports is > interesting information.) > > Some folks pick toolchains by licensing issues. Some of > those might go the direction of avoiding lang/gcc* and > related material when they can, possibly using, say, > devel/llvm80 related materials instead. > > But various ports force specific toolchains and some of > those really require what they force: not "portable" code > relative to the toolchains. Some ports do things like > like use llvm infrastructure to build specialized code > generation and the like, just to list an extreme example. > Thus forcing a specific toolchain globally tends to > somewhat limit the range of ports effectively available, > some of that via dependency structures. > > poudriere bulk -a (or analogous) experiments take a while. > This would tend to limit such experiments, even if there > were no other issues involved. > > Another issue is that what range of toolchains a port > is potentially designed for is generally an upstream > matter. The matching FreeBSD port may support a smaller > range but, generally, is unlikely to support a wider > range. > > My experiments are not likely to go the direction of > overriding what all/most ports do for picking toolchains. > > === > Mark Millard > marklmi at yahoo.com > ( dsl-only.net went > away in early 2018-Mar) > Interesting points, thanks. What I was really thinking of is simply using a GCC package in place of the base GCC, but still allowing individual ports to override. I realize this would require a bit more logic than I alluded to. One of the immediate goals would be to eliminate redundant checks sprinkled across the ports tree, especially .if ${CHOSEN_COMPILER_TYPE} == gcc USE_GCC=yes .endif for ports that won't build with GCC 4.2. Cheers,     JB -- Earth is a beta site. From owner-freebsd-ppc@freebsd.org Sat Jun 8 02:35:13 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8722515BEF8C for ; Sat, 8 Jun 2019 02:35:13 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-3.consmr.mail.bf2.yahoo.com (sonic306-3.consmr.mail.bf2.yahoo.com [74.6.132.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BACC16E374 for ; Sat, 8 Jun 2019 02:35:12 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: VBW8LWUVM1kJE4LfeppJZJqTGhg3UCBxmM8IG3uBGJsQXjfYPQLneHifC0k3.4N bcpVGdIxTw5Om3ZxCyee0_M0Ow_bpgknZx57sluPC6UXb88D3HnRNnJVpFIvCue26UW5SYS7HirA GYQV.5Liweo7tlj8k_8q_0ZNUN_WjAXT_jYeYet.rmYJJqdJFsK3nOfOQXKNtoFN9F2hPx.yzNtd uKkPqpy74S_xv4EtspKxzlKSKzOnGhHOgxSsAYF2y8DlANvTeY39BQg7ulR5WPR99EIDwEFuH4Vw bYHQA5gjAm_kpIQbIP134vvRM22AmAKTmVuix8D0SDcTBFFikge4L7O9.qO.kBExR.Wdtz3ZBiDs Rnq93ae4h8TVe.K5mXgpHHthXL6UMBF.cg6I411NgfXdTeA5j7Yn3RSArTRxJSiSHD7xAowlgJAA A0quW9010IG7oev_hc7XaA.mFXc0tfybki28mVyIdWh.fPfDL2F.rGxJw5QwGNvas_On6CS80OY2 HlRvkE8JJXMLN6r3fNINKqohKWwZL5iiRog7qQL8tTbHvmn_NHWxKt5mCYPwpbF.x0aMpxxVj6bW LM_5A8HppaRM1luKYclZ..VLBHpYcfy80kr0MsYleci1P29.bnIlq.MbWhxA56_Relh1whwV7uXH 0Z8vGi2mqoMwCG_dx2lqvY8A0fMqScArSetzkIoEZ.vGmBkMFePm9sjtYKMdpCHAnipma63LQnF1 apUPLStAJ0ppXQsZGEMjBKfeG2hKcFjKA7wigjiYI8_03117GwWyu9Ar10t3yz0neykEX8pPSejM bqeB1ZhEZX.2j.KOWVA4RVY1To9qc_gxfLj6ixvZXlxKfcyOfCBTCQucWWHPKFEz3Lm0clHsrxNz pog5aWnjU4i4HoiFsUcqZO3s5C2BNay4SHSH3S8lQVicHJIK9cEXnp3sGLO04rlLpjFH_MAZvknR 3NKhARzesYlLwDwl.kB5tUs9Ut5kZvvZmyIdM9ZvXMTDv33BBPyH3aLP3R0aven3_79FgS3mDZ1W 4zO0SYsmQ8fblTiNEWpYZMXDqo5mIs8DKe3LEQTcQzp_AWYpDX4t4s3VUlm15IphiatJZBvsrhHM NxiUTapjpVW9YZVklS_KUlGaglIQFtEm31onZnKIC7UglpmLlaggJJ2qAA7iESvUBZhjYszCfPuJ 1g6Uci3MNCRx479nDQh8crbLrIkZh9wj.EcKy.SOaf7NiSQQ- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sat, 8 Jun 2019 02:35:05 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp428.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 6e8bba2b8d1a3038e0c6409b7857e155 for ; Sat, 08 Jun 2019 02:24:57 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: crash of 32-bit powerpc -r347549 kernel built via system-clang-8, an earlier problem: Process (pid 1) got signal 11 Message-Id: <7B6A6973-AB76-4DDF-8729-F6CC08CFD87C@yahoo.com> Date: Fri, 7 Jun 2019 19:24:55 -0700 To: FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: BACC16E374 X-Spamd-Bar: ++ X-Spamd-Result: default: False [2.46 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.54)[0.538,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; NEURAL_SPAM_MEDIUM(0.79)[0.785,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(1.37)[ip: (4.16), ipnet: 74.6.128.0/21(1.53), asn: 26101(1.22), country: US(-0.06)]; NEURAL_SPAM_LONG(0.28)[0.276,0]; RCVD_IN_DNSWL_NONE(0.00)[42.132.6.74.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 02:35:13 -0000 I earlier tried making a debug kernel build via system-clang-8, as reported in a different thread. Well, I tried with debug with DIAGNOSTICS and got an earlier problem: Process (pid 1) got signal 11 from sys/kern/kern_sig.c 's code that looks like: static int issignal(struct thread *td) . . . case (intptr_t)SIG_DFL: /* * Don't take default actions on system = processes. */ if (p->p_pid <=3D 1) { #ifdef DIAGNOSTIC /* * Are you sure you want to ignore = SIGSEGV * in init? XXX */ printf("Process (pid %lu) got signal = %d\n", (u_long)p->p_pid, sig); #endif break; /* =3D=3D ignore */ } So I changed the code to do a kdb_enter: static int issignal(struct thread *td) . . . switch = ((intptr_t)p->p_sigacts->ps_sigact[_SIG_IDX(sig)]) { =20 case (intptr_t)SIG_DFL: /* * Don't take default actions on system = processes. */ if (p->p_pid <=3D 1) { #ifdef DIAGNOSTIC //if (p->p_pid=3D=3D1 && sig=3D=3D11) = break; // HACK!!! /* * Are you sure you want to ignore = SIGSEGV * in init? XXX */ printf("Process (pid %lu) got signal = %d\n", (u_long)p->p_pid, sig); if (p->p_pid=3D=3D1 && sig=3D=3D11) = kdb_enter(NULL, "p_pid 1 got sig 11"); // HACK!!! #endif break; /* =3D=3D ignore */ } Testing with this reported (for example): KDB: enter p_pid 1 got signal 11 [ thread pid 1 tid 100002 ] Stopped at kdb_enter+0x74: addi r3,r0,0x0 db> bt Tracing pid 1 tid 100002 td 0x1506ae0 0xd6b7c950: at cursig+0x55c 0xd6b7ca10: at ast+0x508 0xd6b7ca40: user DSI read trap @ 0x1c000020 by 0x1812f74: srr1=3D0xd032 r1=3D0xffffde90 cr=3D0x20000000 xer=3D0 ctr=3D0 = sr=3D0x40000000 frame=3D0xd6b7ca48 db> Another example "trap @" was 0xfa5005af (still by 0x1812f74 and with the = rest matching). (The 0xfa5005af "trap @" value looks like a potentially = deliberate pattern that might indicate something.) These happen before the panic reported previously reported. This happens for both usefdt mode and not using the mode, but only for clang-based (not gcc 4.2.1 based). It may be that the usefdt mode status controls which "trap @" figure shows up. The following lines displayed just before the "got signal" line: Trying to mount root from ufs:/dev/ufs/FBSDG4rootfs [rw,noatime]... Launching APs: 1 3 2 WARNING: WITNESS option enabled, . . . WARNING: DIAGNOSTIC option enabled, . . . (Sometimes some of the text is interlaced/garbled but this gives an idea of when in the sequence the signals start.) (Note: The test machine is a 2-socket/2-core-each PowerMac G5, used via 32-bit FreeBSD here.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Sat Jun 8 22:57:44 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22D5615B5EE6 for ; Sat, 8 Jun 2019 22:57:44 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-22.consmr.mail.gq1.yahoo.com (sonic301-22.consmr.mail.gq1.yahoo.com [98.137.64.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5E6E76D2B for ; Sat, 8 Jun 2019 22:57:42 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 4YUs_PEVM1mkICEVBTlWkmvkBnGSClKatR0wmAjoFslvHAQZ8vafRCyPLf8yPZG yGxchp3L5TKSr_7Oh3r1pBBcc1kK0WHkl1bEp0V80iSLV64ilWWyZzNhCcjsHkbMWvEG5DfZKsK. YLIRh6PBvypvBLozsxEYYPlA8qCyT3Foj1Cvx8t8jzzPK2j66aK3Fg91eqcSpxNZZwOyE.e0cQ5y .z0zfLt.wrjz2bgCBWrqHaRvQDiD89nrImmzIuJbwtSZG_Eati9zv._4kJX8vNMDO4MoRwrf6LHD ZGvBeuMtxbJIPgag795CSY0oJlRShjgapseDfgk17.36CtkvoPhGymX_0sGkEYzB3tOOJxJfACue EjXk.c545sFgzAs5B4t.vQe6QqsngmI2oxhZA.WVlDFHA4wM_oQL8g9PryYdcI_buGyv0UuKHJnJ PYx_OxHWypUG7mfTvf7n8QN7NMi1_OmMOTWpWK38K.BgwvbuZa3qGF_mFrEG.2MKygANMjGOWUj4 1DZ6My4_5Kzs64ZqYhwc8FQm7iNsC9hATAWNLQRNZWpYuGOjekzUQ_b8VZQLbMtxlTWYkbfL9GRp 6eTKQ0mEcNBKb5RotPwjfuG34C44Vo32eK9CzT3nM0u0As4cIm.fAmGCXhRx.DSvYe53f8X5EcMK sF_t2pxLTmALufbClPDNUXcIVtjISDLLRJucnbzsucDybV5Su5l4ULeIgXWI5Gmc_y8OQOtiCysr P4CXJdoV4goNmf6GoDQ9SO5Z5xdOZ8bjLh0R7WA_8nfVgoQtNckEZmQTZHsq9_CqOSlfh3XC4JbK Ba3q9v29qYlzJD3KS9GY4c6F9ZkYsM.6wh5PeGt8TiNzpRyt7O7UOss2KPCVHV6CINfxT3tVKdDh 6lxrgrjcK4qeMX.uxT_9_I.4x73vnauFCacsBXs.oKXMr9X5j9DcIYoVV0eivVGSxIz_Xx7t7U1X zbR12w.Qg6nQ_HdGr1_kxgr36WSN3R2sq5iPalqT6Cg.5tQqewpnwN8IVPXu7Bx8tZSPeA3Cdaql zgdOwlkd6H3KbvVrhushmKgIxZuRe5yj4AGZrVxmKH8aRVklMaVBrSCAd3GbkELkLufJi.HDt0CS fQRNF2o7Xy0xVQq7mtEadNthg8Af5X4LcgEnDEEFhwDx2saAAbEk5w6M7oDZyLseJ_HPAxFucPZB 2Z.vAPaGz7v5WJY0g.FAl2STaFN2vxNT7yxi9zxXqPkrYi0h9LtkeMSZETIJzMwE.IE08g8g- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.gq1.yahoo.com with HTTP; Sat, 8 Jun 2019 22:57:39 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp429.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 306e6b2d3c75727293f2733e49d52872; Sat, 08 Jun 2019 22:37:22 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: crash of 32-bit powerpc -r347549 kernel built via system-clang-8, _init_tls is where the initial DIAGNOSTICS-reported SIGSEGV happens Message-Id: <8F272F27-0BC3-402A-810A-4608162F9EEE@yahoo.com> Date: Sat, 8 Jun 2019 15:37:21 -0700 Cc: Alfredo Dal Ava Junior , Justin Hibbits To: FreeBSD Toolchain , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: E5E6E76D2B X-Spamd-Bar: ++ X-Spamd-Result: default: False [2.52 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.17)[0.170,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.54)[ip: (6.05), ipnet: 98.137.64.0/21(0.95), asn: 36647(0.76), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.84)[0.841,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.48)[0.478,0]; RCVD_IN_DNSWL_NONE(0.00)[148.64.137.98.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 22:57:44 -0000 The failure is related to *sp++ in the below source code from lib/libc/gen/tls.c . extern char **environ; =20 void _init_tls(void) { #ifndef PIC Elf_Addr *sp; Elf_Auxinfo *aux, *auxp; Elf_Phdr *phdr; size_t phent, phnum; int i; void *tls; sp =3D (Elf_Addr *) environ; while (*sp++ !=3D 0) ; . . . system-clang-8 produced the following code in /sbin/init : 01812f50 <_init_tls> mflr r0 01812f54 <_init_tls+0x4> stw r0,4(r1) 01812f58 <_init_tls+0x8> stwu r1,-16(r1) 01812f5c <_init_tls+0xc> stw r31,12(r1) 01812f60 <_init_tls+0x10> mr r31,r1 01812f64 <_init_tls+0x14> lis r3,404 01812f68 <_init_tls+0x18> lwz r4,-28276(r3) #### Note: r4=3D*environ 01812f6c <_init_tls+0x1c> li r5,0 01812f70 <_init_tls+0x20> addi r3,r4,-4 01812f74 <_init_tls+0x24> lwzu r7,4(r3) #### fails here 01812f78 <_init_tls+0x28> mr r6,r5 01812f7c <_init_tls+0x2c> addi r5,r5,1 01812f80 <_init_tls+0x30> cmplwi r7,0 01812f84 <_init_tls+0x34> bne+ 01812f74 <_init_tls+0x24> . . . readelf -asW shows environ as: 2652: 000000000193918c 4 OBJECT GLOBAL DEFAULT 17 environ MAJOR CONCLUSION (so far): It appears that the values found by the sp++ are strange so *sp++ gets the SIGSEGV. The: 01812f64 <_init_tls+0x14> lis r3,404 01812f68 <_init_tls+0x18> lwz r4,-28276(r3) does match up: 0x193918c=3D=3D(404<<16)-28276 . It looks like the Elf_Addr value itself is strange when the SIGSEGV's happen. The evidence for where the failure point is was: KDB: enter p_pid 1 got signal 11 [ thread pid 1 tid 100002 ] Stopped at kdb_enter+0x74: addi r3,r0,0x0 db> bt Tracing pid 1 tid 100002 td 0x1506ae0 0xd6b7c950: at cursig+0x55c 0xd6b7ca10: at ast+0x508 0xd6b7ca40: user DSI read trap @ 0x1c000020 by 0x1812f74: srr1=3D0xd032 r1=3D0xffffde90 cr=3D0x20000000 xer=3D0 ctr=3D0 sr=3D0x40000000= frame=3D0xd6b7ca48 db> The "trap @" value can vary, such as instead being 0xfa5005af . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)