From owner-freebsd-toolchain@freebsd.org Sun Jun 2 21:00:28 2019 Return-Path: Delivered-To: freebsd-toolchain@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 E8C3B15BFA01 for ; Sun, 2 Jun 2019 21:00:27 +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 71423805BF for ; Sun, 2 Jun 2019 21:00:27 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id 1D32915BF9F8; Sun, 2 Jun 2019 21:00:27 +0000 (UTC) Delivered-To: toolchain@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 04F9915BF9F7 for ; Sun, 2 Jun 2019 21:00:27 +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 7B168805B1 for ; Sun, 2 Jun 2019 21:00:26 +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 A4F0C10004 for ; Sun, 2 Jun 2019 21:00:25 +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 x52L0PL5009120 for ; Sun, 2 Jun 2019 21:00:25 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x52L0PIH009119 for toolchain@FreeBSD.org; Sun, 2 Jun 2019 21:00:25 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <201906022100.x52L0PIH009119@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: toolchain@FreeBSD.org Subject: Problem reports for toolchain@FreeBSD.org that need special attention Date: Sun, 2 Jun 2019 21:00:25 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2019 21:00:28 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 234232 | clang Assertion failed when building the port dev 1 problems total for which you should take action. From owner-freebsd-toolchain@freebsd.org Wed Jun 5 21:27:59 2019 Return-Path: Delivered-To: freebsd-toolchain@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 0131615B97FC for ; Wed, 5 Jun 2019 21:27:59 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic316-55.consmr.mail.gq1.yahoo.com (sonic316-55.consmr.mail.gq1.yahoo.com [98.137.69.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 3F48D6DAF8 for ; Wed, 5 Jun 2019 21:27:56 +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 sonic316.consmr.mail.gq1.yahoo.com with HTTP; Wed, 5 Jun 2019 21:27:49 +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: 3F48D6DAF8 X-Spamd-Bar: +++ X-Spamd-Result: default: False [3.86 / 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.74)[0.739,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.87)[ip: (7.66), ipnet: 98.137.64.0/21(0.96), asn: 36647(0.77), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.98)[0.976,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.79)[0.788,0]; RCVD_IN_DNSWL_NONE(0.00)[31.69.137.98.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 21:27:59 -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-toolchain@freebsd.org Thu Jun 6 06:30:00 2019 Return-Path: Delivered-To: freebsd-toolchain@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 90C2615C58C6 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 4E80C86F18 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: 4E80C86F18 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-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain 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-toolchain@freebsd.org Fri Jun 7 23:09:34 2019 Return-Path: Delivered-To: freebsd-toolchain@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 44AF815B989F for ; Fri, 7 Jun 2019 23:09:34 +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 D1A998E366 for ; Fri, 7 Jun 2019 23:09:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 94E8D15B989D; Fri, 7 Jun 2019 23:09:33 +0000 (UTC) Delivered-To: toolchain@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 7254C15B989C for ; Fri, 7 Jun 2019 23:09:33 +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 0BA6C8E365 for ; Fri, 7 Jun 2019 23:09:33 +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 20DBE9A9C for ; Fri, 7 Jun 2019 23:09:32 +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 x57N9WwU029196 for ; Fri, 7 Jun 2019 23:09:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x57N9VjC029193 for toolchain@FreeBSD.org; Fri, 7 Jun 2019 23:09:31 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 238404] AddressSanitizer should intercept pthread_get_name_np (FreeBSD), not pthread_getname_np (Glibc) symbol Date: Fri, 07 Jun 2019 23:09:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jbeich@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2019 23:09:34 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238404 Bug ID: 238404 Summary: AddressSanitizer should intercept pthread_get_name_np (FreeBSD), not pthread_getname_np (Glibc) symbol Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: toolchain@FreeBSD.org Reporter: jbeich@FreeBSD.org AC_CHECK_FUNCS() doesn't check declaration, only library symbol. For one, FreeBSD never had pthread_getname_np() but added a similar function in base r337983. See contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.= inc $ cat >a.c char pthread_getname_np(); int main() { pthread_getname_np(); return 0; } $ cc a.c -fsanitize=3Daddress $ cc a.c ld: error: undefined symbol: pthread_getname_np >>> referenced by a.c >>> /tmp/a-101e7b.o:(main) cc: error: linker command failed with exit code 1 (use -v to see invocation) $ pkg install python27 $ hash git 2>/dev/null || pkg install mercurial $ hg clone https://hg.mozilla.org/mozilla-unified firefox || git clone https://github.com/mozilla/gecko-dev firefox $ cd firefox $ hg update central || git checkout origin/master $ echo "ac_add_options --with-libclang-path=3D${LOCALBASE-/usr/local}/llvm8= 0/lib" >>.mozconfig $ echo "ac_add_options --enable-address-sanitizer" >>.mozconfig $ ./mach bootstrap # select Firefox for Desktop $ ./mach build [...] In file included from objdir/js/src/Unified_cpp_js_src9.cpp:29: js/src/threading/posix/Thread.cpp:174:8: error: use of undeclared identifier 'pthread_getname_np'; did you mean 'pthread_get_name_np'? rv =3D pthread_getname_np(pthread_self(), nameBuffer, len); ^~~~~~~~~~~~~~~~~~ pthread_get_name_np /usr/include/pthread_np.h:52:6: note: 'pthread_get_name_np' declared here void pthread_get_name_np(pthread_t, char *, size_t); ^ In file included from objdir/js/src/Unified_cpp_js_src9.cpp:29: js/src/threading/posix/Thread.cpp:174:8: error: assigning to 'int' from incompatible type 'void' rv =3D pthread_getname_np(pthread_self(), nameBuffer, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-toolchain@freebsd.org Sat Jun 8 15:55:17 2019 Return-Path: Delivered-To: freebsd-toolchain@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 D356B15ABBF1 for ; Sat, 8 Jun 2019 15:55:16 +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 666048EFD2 for ; Sat, 8 Jun 2019 15:55:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 2617815ABBF0; Sat, 8 Jun 2019 15:55:16 +0000 (UTC) Delivered-To: toolchain@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 131F215ABBEE for ; Sat, 8 Jun 2019 15:55:16 +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 9C1358EFCD for ; Sat, 8 Jun 2019 15:55:15 +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 BEC0512CF8 for ; Sat, 8 Jun 2019 15:55:14 +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 x58FtE7X043899 for ; Sat, 8 Jun 2019 15:55:14 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x58FtE6H043896 for toolchain@FreeBSD.org; Sat, 8 Jun 2019 15:55:14 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 237688] lang/gcc8 fails to build: /usr/local/bin/ld: /wrkdirs/usr/ports/lang/gcc8/work/.build/./gcc/liblto_plugin.so: error loading plugin: Service unavailable Date: Sat, 08 Jun 2019 15:55:14 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: gerald@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Resolution: Not A Bug X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status 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-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 15:55:17 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237688 Gerald Pfeifer changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |Not A Bug Status|Open |Closed --- Comment #13 from Gerald Pfeifer --- (In reply to tech-lists from comment #12) > should I close this or would you rather it be left open as per your comme= nt? Let's close this, and I'll ask on freebsd-ports@ and (one last time here) how to practically go about implementing .if $(binutils built statically) IGNORE=3D GCC requires dynamically linked binutils .endif --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-toolchain@freebsd.org Sat Jun 8 17:44:58 2019 Return-Path: Delivered-To: freebsd-toolchain@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 B7A1B15AE97C for ; Sat, 8 Jun 2019 17:44:58 +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 463096BFD8 for ; Sat, 8 Jun 2019 17:44:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 00F1A15AE97B; Sat, 8 Jun 2019 17:44:58 +0000 (UTC) Delivered-To: toolchain@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 D098415AE97A for ; Sat, 8 Jun 2019 17:44:57 +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 4712E6BFC1 for ; Sat, 8 Jun 2019 17:44:57 +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 7AD6213C8B for ; Sat, 8 Jun 2019 17:44:56 +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 x58Hiur5064305 for ; Sat, 8 Jun 2019 17:44:56 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x58HiupH064304 for toolchain@FreeBSD.org; Sat, 8 Jun 2019 17:44:56 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: toolchain@FreeBSD.org Subject: [Bug 230857] loading carp module panic i386 kernel (VIMAGE related) Date: Sat, 08 Jun 2019 17:44:55 +0000 X-Bugzilla-Reason: CC 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: panic, toolchain, vimage X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@freebsd.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bz@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-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 17:44:59 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D230857 --- Comment #12 from commit-hook@freebsd.org --- A commit references this bug: Author: bz Date: Sat Jun 8 17:44:43 UTC 2019 New revision: 348808 URL: https://svnweb.freebsd.org/changeset/base/348808 Log: Fix dpcpu and vnet panics with complex types at the end of the section. Apply a linker script when linking i386 kernel modules to apply padding to a set_pcpu or set_vnet section. The padding value is kind-of random and is used to catch modules not compiled with the linker-script, so possibly still having problems leading to kernel panics. This is needed as the code generated on certain architectures for non-simple-types, e.g., an array can generate an absolute relocation on the edge (just outside) the section and thus will not be properly relocated. Adding the padding to the end of the section will ensure that even absolute relocations of complex types will be inside the section, if they are the last object in there and hence relocation will work properly and avoid panics such as observed with carp.ko or ipsec.ko. There is a rather lengthy discussion of various options to apply in the mentioned PRs and their depends/blocks, and the review. There seems no best solution working across multiple toolchains and multiple version of them, so I took the liberty of taking one, as currently our users (and our CI system) are hitting this on just i386 and we need some solution. I wish we would have a proper fix rather than another "hack". Also backout r340009 which manually, temporarily fixed CARP before 12.0-R "by chance" after a lead-up of various other link-elf.c and related fixes. PR: 230857,238012 With suggestions from: arichardson (originally last year) Tested by: lwhsu Event: Waterloo Hackathon 2019 Reported by: lwhsu, olivier MFC after: 6 weeks Differential Revision: https://reviews.freebsd.org/D17512 Changes: head/UPDATING head/sys/conf/kmod.mk head/sys/conf/ldscript.set_padding head/sys/kern/link_elf.c head/sys/netinet/ip_carp.c head/sys/sys/param.h --=20 You are receiving this mail because: You are on the CC list for the bug.= From owner-freebsd-toolchain@freebsd.org Sat Jun 8 17:45:54 2019 Return-Path: Delivered-To: freebsd-toolchain@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 1173F15AEA04 for ; Sat, 8 Jun 2019 17:45:54 +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 983CA6C062 for ; Sat, 8 Jun 2019 17:45:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 59BCD15AEA03; Sat, 8 Jun 2019 17:45:53 +0000 (UTC) Delivered-To: toolchain@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 483FE15AEA02 for ; Sat, 8 Jun 2019 17:45:53 +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 D91C86C05B for ; Sat, 8 Jun 2019 17:45:52 +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 1526B13C94 for ; Sat, 8 Jun 2019 17:45:52 +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 x58HjpIl065523 for ; Sat, 8 Jun 2019 17:45:51 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x58HjpTk065522 for toolchain@FreeBSD.org; Sat, 8 Jun 2019 17:45:51 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 230857] loading carp module panic i386 kernel (VIMAGE related) Date: Sat, 08 Jun 2019 17:45:51 +0000 X-Bugzilla-Reason: CC 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: panic, toolchain, vimage X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bz@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bz@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-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 17:45:54 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D230857 --- Comment #13 from Bjoern A. Zeeb --- *** Bug 238012 has been marked as a duplicate of this bug. *** --=20 You are receiving this mail because: You are on the CC list for the bug.= From owner-freebsd-toolchain@freebsd.org Sat Jun 8 17:46:41 2019 Return-Path: Delivered-To: freebsd-toolchain@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 E689F15AEA64 for ; Sat, 8 Jun 2019 17:46:40 +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 7C6446C0CA for ; Sat, 8 Jun 2019 17:46:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 38FA915AEA62; Sat, 8 Jun 2019 17:46:40 +0000 (UTC) Delivered-To: toolchain@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 2783415AEA61 for ; Sat, 8 Jun 2019 17:46:40 +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 A747E6C0C4 for ; Sat, 8 Jun 2019 17:46:39 +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 D7FDE13C9A for ; Sat, 8 Jun 2019 17:46:38 +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 x58HkcE3066301 for ; Sat, 8 Jun 2019 17:46:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x58HkcCB066300 for toolchain@FreeBSD.org; Sat, 8 Jun 2019 17:46:38 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 232291] ld.bfd (newer) and ld.lld (6 and imho 7) create empty sections when they should not Date: Sat, 08 Jun 2019 17:46:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: bz@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc assigned_to 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-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 17:46:41 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D232291 Bjoern A. Zeeb changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bz@FreeBSD.org Assignee|bugs@FreeBSD.org |toolchain@FreeBSD.org --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-toolchain@freebsd.org Sat Jun 8 22:57:43 2019 Return-Path: Delivered-To: freebsd-toolchain@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 8F0F815B5EE4 for ; Sat, 8 Jun 2019 22:57:43 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic308-55.consmr.mail.gq1.yahoo.com (sonic308-55.consmr.mail.gq1.yahoo.com [98.137.68.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 8942876D2A for ; Sat, 8 Jun 2019 22:57:41 +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 sonic308.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: 8942876D2A X-Spamd-Bar: ++ X-Spamd-Result: default: False [2.62 / 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.18)[0.175,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.59)[ip: (6.28), ipnet: 98.137.64.0/21(0.95), asn: 36647(0.76), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.85)[0.850,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.51)[0.514,0]; RCVD_IN_DNSWL_NONE(0.00)[31.68.137.98.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2019 22:57:43 -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)