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 1oSrCe-0001ua-1C for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 02:42:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oSrCc-0008EY-TX for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 02:42:10 +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 1oSrCc-0008EO-Dz for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 02:42:10 +0000 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oSrCa-0002p8-36 for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 02:42:09 +0000 Received: by mail-qk1-x72f.google.com with SMTP id b2so7486962qkh.12 for ; Mon, 29 Aug 2022 19:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc; bh=cTda+YB5v0DQcDo1tUyF9C20WsBFlHEerbr74sm0wAM=; b=eDeA3gDZf8ZO+KTZ4p7zSLEzxlMXXm5WmPF8oHwJjzR/dfd17H1vvXrkd1MMvutQ0H HF0pJnpO6U0YyHcLSoKX9i0rWFMczKRctZLMzlPCDsvO3Mjfyfi6/bYfLo0HlpPbQNeW PRy+zuS/Olc4o9GHbxvT/F1wvHRJlXcia0z0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=cTda+YB5v0DQcDo1tUyF9C20WsBFlHEerbr74sm0wAM=; b=Pz1xEr6nSur9lDgJb2ND1HEoL/CDZd27vVMR3IdOME1oyxd5ZGBio+4xMUbRzAwaW/ Od5bBvBat9DI8dUtNEIPGS0sG8V7yhQKsF+cCffPU/2ol/nLeLcAWmVl2sg/HbbvX9PB DimOS7pBkV1Ituqt+scAsvx6poy9kwWsPW4I1UupvZBt6jhTlGqeTvhpuHdzlayMR3yL 0VDmWllSjkOQ93Mx+Marpl2Mb2rLNnGCS4fac+tmWA1cUCrhSDRkoNTo4c0k8pW2vg9E Xxjf/uvfj1rugKyjhvDnvSj6RWHexLZDDjIleej+o4Ha54fE7WaDAalwS+f4iBB7yenH CdBg== X-Gm-Message-State: ACgBeo2aNdtwQ1N1RZShC1Awfjgq7HGbLqP72BRjDTud8gc9neboQU3P Ozv4SuK85JUTBz/KtZyCoZT70yIvWxCCSg== X-Google-Smtp-Source: AA6agR5itzMr35L4lpYnYWJdhpAFPN26E4i3kHOLMOXs79K1KGsVrW+FU181qAQKzNzbBeukgRlLsQ== X-Received: by 2002:ae9:ed89:0:b0:6bb:9968:de30 with SMTP id c131-20020ae9ed89000000b006bb9968de30mr10305104qkg.774.1661827325977; Mon, 29 Aug 2022 19:42:05 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::2e]) by smtp.gmail.com with ESMTPSA id bs43-20020a05620a472b00b006bb619a6a85sm7395884qkb.48.2022.08.29.19.42.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2022 19:42:04 -0700 (PDT) Date: Mon, 29 Aug 2022 19:42:01 -0700 From: Noah Misch To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Postmaster self-deadlock due to PLT linkage resolution Message-ID: <20220830024201.GA932727@rfd.leadboat.com> References: <3384826.1661802235@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3384826.1661802235@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Aug 29, 2022 at 03:43:55PM -0400, Tom Lane wrote: > I'd originally intended to make this code "#ifdef __NetBSD__", > but on looking into the FreeBSD sources I find much the same locking > logic in their dynamic loader, and now I'm wondering if such behavior > isn't pretty standard. I doubt it's standard. POSIX specifies select() to be async-signal-safe. This NetBSD bug makes select() not be async-signal-safe. > The added calls should have negligible cost, > so it doesn't seem unreasonable to do them everywhere. Agreed. I would make the comment mention the NetBSD version that prompted this, so we have a better chance of removing the workaround in a few decades.