From nobody Tue Mar 14 13:20:15 2023 X-Original-To: bugs@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 4PbYzh1JtXz3yGNY for ; Tue, 14 Mar 2023 13:20:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbYzh0Hn0z40vC for ; Tue, 14 Mar 2023 13:20:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678800016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xRjNfOwg8H1A0YzDGkIwEAoR2UgOxtpbbGbkTxIhAys=; b=Sbr0qnYuedwpFY2ZJFeiBMZ4/3jhIEF7uCoqQkN8APj2TccQXUMRCevoWrwCiuH+68g2Ud wUXU5Wtlf3tAzS+cyHlYW8Xgjk5T1ncN8KS7PXO6kvXF8//StAF+WWYVrUHXVAB88UOFt6 WP5FQF3KpI+DU4gD5sosIH8ROr4B7bDXpAROaa6apgTp/Ey91uvJo46Q70974S5rnBmDYZ RL8wzewt1bsSfFhtvgr5unUou+HkdaAHaPq0ATtqZddXlW77HnAz/a9SBu7kPY742+0BRx wxtgkciymDPF5Zup1xwn0NRpT8Ut8cMtxtIm43opO/pfQfg58B0UQ55PrOc5kQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678800016; a=rsa-sha256; cv=none; b=wEq46DKxFUENPGgkQzz8FD1rwTfcvmRsg5jP53qj0xUMzmTNMUPPZ/5D9fweWCQv+f2cgc zQzhmcCTMB5DiPcK/bqVP4co8VU3gJLe3fSbGciA4KgdCDPiJuxrlDI5UigEFWGoDWQOvZ bXOHSqxP0qlVtmQ1IhyN27FDXqfFOBMALMcQWOZkdErNS7dfMzxlLhARUao12l6nbgu8hf 5cFVWGMqMufl5bCXr+/dNUUBwBFBD8xZrVrpoT6rztQXNIItBA+DX6h1gbihip3H9oX3rc 9i2136DReviChy8R6KNrl18z5zQSMG/a3rStllsmcVLd8jfJrM9YrrEt6aEiXw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbYzg68MczcS9 for ; Tue, 14 Mar 2023 13:20:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 32EDKFCX079854 for ; Tue, 14 Mar 2023 13:20:15 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 32EDKFq1079853 for bugs@FreeBSD.org; Tue, 14 Mar 2023 13:20:15 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: bugs@FreeBSD.org Subject: [Bug 269568] strip(1) creates an executable which crashes in ld-elf.so.1 Date: Tue, 14 Mar 2023 13:20:15 +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: fernape@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status version cc 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 List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269568 Fernando Apestegu=C3=ADa changed: What |Removed |Added ---------------------------------------------------------------------------- Status|New |Open Version|13.1-RELEASE |CURRENT CC| |fernape@FreeBSD.org --- Comment #1 from Fernando Apestegu=C3=ADa --- The program fails in this line memset(&objtmp, 0, sizeof(objtmp)); in=20 static void=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info) in rtld.c objtmp is already zeroed and its address is=20 (gdb) p &objtmp $9 =3D (Obj_Entry *) 0x7fffffffe150 which is not addressable. After creating the jdupes executable with LOW_MEMORY=3D1, we can inspect th= e ELF of the original file and the files stripped with strip(1) in base (fails), = gnu strip and llvm-strip (both work). Having a look at the headers, The relocation information for the versions that work is this: GNU_RELRO 0x0000000000007400 0x0000000000209400 0x0000000000209400 0x00000000000001a0 0x0000000000000c00 R 0x1 which is different from the header generated by strip(1): GNU_RELRO 0x0000000000007400 0x0000000000209400 0x0000000000209400 0x00000000000001a0 0x00000000000001a0 R 0x1 Notice how MemSiz is smaller in the latter case (1a0 vs c00). There is another difference that I can spot. In the three versions that wor= k, this is the GNU_STACK header: GNU_STACK 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000001000000 RW 0 But strip(1) generates this: GNU_STACK 0x0000000000000000 0x000000000020a770 0x0000000000000000 0x0000000000000000 0x0000000000002308 RW 0 Again, the MemSiz is much smaller in this case. However, the .bss section in all four executables is identical: [25] .bss NOBITS 000000000020a770 00007768 0000000000002308 0000000000000000 WA 0 0 16 Changing Version to CURRENT since it fails there too. --=20 You are receiving this mail because: You are the assignee for the bug.=