From nobody Fri Feb 04 09:19:39 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 24BDA19AC028 for ; Fri, 4 Feb 2022 09:19:55 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-54.consmr.mail.gq1.yahoo.com (sonic307-54.consmr.mail.gq1.yahoo.com [98.137.64.30]) (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 4JqqkL1fb4z4TB5 for ; Fri, 4 Feb 2022 09:19:54 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1643966386; bh=3aBFvr6yfTB/HIvZwAKFOjf1OYsuURluo6FNAfo82rY=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=r0erANS1ViwfYren+yKPiNnlJsqTHu7sqntragQ1w45e2utNJo2RvsBzqp13azYF0p5PBWlFih6QzG4Ea5A0A2vICrco7qE5MDIv8qOLx8JKF5L5kkSVPyWDJKcELRJfh4XZFb2XwiGSvQjOQkPHYHHh86x6eNg58l1TxkunEeVrBWaeVZxjVB5QTedrQcjbwdgLi/3bYRRYmYlykM/w5JLnOHouvXJkhEwDOgY7aUNAYV1myunvztoewcuzBv+u8tyNj3stIhlFerdCfvdKa/GZL58FEdxG6bntjAkg6L1RxQs8/BEkEXIztp3ne4n09J0ynnNkwnSX97hG3S0Szw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1643966386; bh=RDnaD/vbjX03OzGsR7ACwIGL8uCeeGeXYeJFV+kMgLR=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=IpQ2jFsUX2H+b/BcS8uL8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IWsGaB27CnemagwdFjiIMtE_77PMBXu7H0d9if8IVUf1ZkYmAeSnD6oRx4fiSY txfOoYkB.l7rgM5Gn59X1z7TJPyB_Usbmz7A6iawdBI70DcM2XGOknWu7KJCzxSxM87aPpAcv4WC p2XVoy6Pr40HjG8Mdf2k8Yfl0k09FeVjyV0wocqzXIanFUyesFjSuXrQQxA.scHA4un0DeVPnBmh Dan.TIBKSP02Lt.edpGk6j1tEt.au8W0vLNZBE76E5NyEu2..Vvw2JCKZO9JzUQWq9CjSvTj2UiT 11DoG5N6Z9cfKGOkDaU39y1PtuByX1gytj8AHH63NCRRszqYa25wD7frUGWimUWJiJl3jgEyuloM Gp9eoYj5xnw71lf4vS8R6AjAZje5Al0hYXHmSsiQgvAGfh3Uve8hb82A_hP8ssrQg6JL4zracso5 NX2nkYSb6ZBtOJIjL_LQ.iHEgaIfXI.bo0qkPbRUC74lX4LFnWuiz8WKoCBJfq8q8CoEJS9Jfw.1 89M9ZtT_iXs4P X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Fri, 4 Feb 2022 09:19:46 +0000 Received: by kubenode550.mail-prod1.omega.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID f2b0f969ab3954cbf220cc4574b08d87; Fri, 04 Feb 2022 09:19:41 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: Troubles building world on stable/13 [Try sysctl kern.elf64.aslr.enable=0 for avoiding SIGSEGV using your stable/13 c++ compiler on RPi3*] From: Mark Millard In-Reply-To: <9787056B-D173-460A-821C-1386F7F2D5EC@yahoo.com> Date: Fri, 4 Feb 2022 01:19:39 -0800 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <8595CFBD-DC65-4472-A0A1-8A7BE1C031D6@yahoo.com> <20220124165449.GA39982@www.zefox.net> <5FAC2B2C-7740-435E-A183-FB3EF1FCE7F9@yahoo.com> <20220202223208.GA78110@www.zefox.net> <70550346-BC53-458F-B01B-68559E5C9847@yahoo.com> <20220203015149.GA78722@www.zefox.net> <8A85F917-F4E8-4382-B777-15AF7401E616@yahoo.com> <20220203230428.GA81336@www.zefox.net> <9787056B-D173-460A-821C-1386F7F2D5EC@yahoo.com> To: bob prohaska X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4JqqkL1fb4z4TB5 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=r0erANS1; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.30 as permitted sender) smtp.mailfrom=marklmi@yahoo.com X-Spamd-Result: default: False [-1.02 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; 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:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.37)[-0.367]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.85)[0.847]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.30:from]; MLMMJ_DEST(0.00)[freebsd-arm]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.30:from]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N Note: The experiments reported are from a .sh/.cpp pair produced by system clang++ (a.k.a. c++) that is used to repeat the problem without doing a buidlworld . In my context, using a main [so: 14] kernel and your stable/13 c++ (system clang++), I get: A) sysctl kern.elf64.aslr.enable=3D1 leads to later tries = sometimes/usually failing vs. B) sysctl kern.elf64.aslr.enable=3D0 has so far lead to later tries = working This is with kern.elf64.aslr.stack_gap being 0 without my having set it. WARNING: Doing (B) may have security implications. stable/13 also has kern.elf64.aslr.enable and the like from what I can tell. You can let me know if you get any .sh/.cpp pair(s) failing vs. if all tries work. I found this by noticing that: sysctl -a vm.aslr_restarts was usually incrementing by 2 during the .sh/.cpp runs. For reference: # sysctl -ad vm.aslr_restarts vm.aslr_restarts: Number of aslr failures Something like: # ./c++ -v it got an increment of 1. Something like: # date it got no increment. I suspect only large processes would get failures, especially double failures (or more). It might be that a debug kernel would panic, reporting a try count that was no longer <=3D 2 if some of the code I saw is currently in use in the kernels. I'm running a non-debug kernel and, so, do not see the KASSERT related behavior. I do not have detailed knowledge of how the failure works. I'd guess some sort of stack-growth related problem that is leading to corrupted register content afterwards. =3D=3D=3D Mark Millard marklmi at yahoo.com