Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT4yl-00088S-KB for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 17:24:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oT4yk-0000Nu-8N for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 17:24:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT4yj-0000Nl-Vv for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 17:24:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT4yh-0001mK-SW for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 17:24:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 27UHOd9i3705481; Tue, 30 Aug 2022 13:24:39 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org Subject: Re: Postmaster self-deadlock due to PLT linkage resolution In-reply-to: <20220830171720.iai6jwwo756z7ivw@awork3.anarazel.de> References: <3384826.1661802235@sss.pgh.pa.us> <20220830171720.iai6jwwo756z7ivw@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 30 Aug 2022 10:17:20 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3705479.1661880279.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 30 Aug 2022 13:24:39 -0400 Message-ID: <3705480.1661880279@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2022-08-29 15:43:55 -0400, Tom Lane wrote: >> The attached patch seems to fix the problem, by forcing resolution of >> the PLT link before we unblock signals. It depends on the assumption >> that another select() call appearing within postmaster.c will share >> the same PLT link, which seems pretty safe. > Hm, what stops the same problem from occuring with other functions? These few lines are the only part of the postmaster that runs with signals enabled and unblocked. > Perhaps it'd be saner to default to building with -Wl,-z,now? That shoul= d fix > the problem too, right (and if we combine it with relro, it'd be a secur= ity > improvement to boot). Hm. Not sure if that works on NetBSD, but I'll check it out. regards, tom lane