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 1ntf9g-0007Or-Nm for pgsql-bugs@arkaria.postgresql.org; Wed, 25 May 2022 00:45:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ntf9f-0002nU-Hg for pgsql-bugs@arkaria.postgresql.org; Wed, 25 May 2022 00:45:39 +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 1ntf9f-0002nL-9B for pgsql-bugs@lists.postgresql.org; Wed, 25 May 2022 00:45:39 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntf9d-0005tf-CF for pgsql-bugs@lists.postgresql.org; Wed, 25 May 2022 00:45:38 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 4BB0F5C0302; Tue, 24 May 2022 20:45:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 24 May 2022 20:45:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1653439536; x=1653525936; bh=FWPCfgclNq ujuEljSCQNuBJuC0v8vDbeSTIeHFc5sEE=; b=BDDaoOATyai/rFiOmkr8Xq1niq j/gIyWm8rTnSQ1fY49xhK/tv745tk5lb9OEMLnOQ4aoGCIDPVM1Deon0gWCqH4Sg J5PsbImhdWtc91BaM9sJtSpM1XLx74KFJd2Y8upU1J7Pr9OMxKplRcwhUiGcVm3r uNsBCGOwolEIaXnChhZ4JyI9D5AlDwpIwwkd6W0rd/JzXaU64oA5+Y4G40946rYZ drSzOxHYIcsZjpE03rCG1uJMcYccaz/sKR+Ye3FuIK02Kd1ozFlam4irT3z396sZ rySdwgQ8pUsabQvmaYtaNMZvtCYx10+P3/Qm8ZcL8fxajvRBkhQYEgxaO5Og== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1653439536; x=1653525936; bh=FWPCfgclNqujuEljSCQNuBJuC0v8 vDbeSTIeHFc5sEE=; b=Q5lMQBOlpnMIw/gV+sN7jtmsJDpISnmaoeHyjUr5s6r6 FQX6Hv5vpfBW79lf6W/ZKLJu8UFu7UpP4ngr8/1s0G8npnjFOTHC8+7GwUibqrS7 GDC0scfziSjw3yh0XfpeqZIC+OQo+TCHVfNLNFcc0xsO+1UyUfSIAFQB9t6FvtzY tpSIpN//PzcaZPvujCobNDndhnw9HUxZd7UOGUQj3dTPk30QI4XCUR7rdc6b4B9p 0Esr9q6qHd7LfY1KdKMCbLhRvSdqphHtPBOiTo/GqnNVCuSVRhH03c8Wj7HdXpO1 lejvKWWTKwmJjDOzNbhB1UNb2mGnrjZOyvnK4/H6cw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrjeeggdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 May 2022 20:45:34 -0400 (EDT) Date: Wed, 25 May 2022 09:45:31 +0900 From: Michael Paquier To: Tom Lane Cc: Julien Rouhaud , Mats Kindahl , pgsql-bugs@lists.postgresql.org Subject: Re: Use of signal-unsafe functions from signal handlers Message-ID: References: <20220524101418.7pp65powa362vzln@jrouhaud> <20220524123739.6glyxyx4owqpqjnr@jrouhaud> <1531973.1653401755@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="g9TqLzR1nFmIdtqq" Content-Disposition: inline In-Reply-To: <1531973.1653401755@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --g9TqLzR1nFmIdtqq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 24, 2022 at 10:15:55AM -0400, Tom Lane wrote: > ereport() itself is just the tip of the iceberg; even if it's safe > (which I concur it isn't), there's also the atexit/on_proc_exit > functions that are likely to be called during shutdown. So yeah, > this coding is not too safe. I'm not sure that getting rid of it > would be a net win though, as we'd replace it-might-crash hazards > with it-might-never-exit hazards, from bgworkers that neglect to > respond to ShutdownRequestPending. Hmm. Shouldn't we worry about FloatExceptionHandler() that gets used on SIGFPE? -- Michael --g9TqLzR1nFmIdtqq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmKNfCoACgkQnvQgOdby QH1DPhAAkAcuNfEiXMMJqSASYLw7iw+FJLljJTMC2/mKc4+TZHpGB1UZF7FjcvIh 3We4tXUBCpVd8fS6ReJmCMC1xIeQx+Owr1OlMhrh3yFzARX+l3yp0xcZOMGHIQl/ Yx4T+/HJFXOS6jZ3o1L5g5AvQAr372aUSogSKMrU6OqPnTl8Qyi+us56uU2ESbOM MUHSt30ZWJzBiioA8gNriXMkxg5t2LQiVSQEOyksTU7sl9lFLzCbtX5uGxOK7TGz AfVKZguCeN5PShtRPYCTwIlKkAl8iNcjv00g8Pr7bMmsQH8Cw4pvoFAr8IcUItuM eoRHR9jKnF3Qp2xwaUsXC8zkjDqP89awbAqDGSy2K1W2naeYgo1xkMzCYZNUXDI4 Q/xUD3OSvoIp8CGXRXnppMb5waOpDpQ8VWVoaKMF0f090X2/lEv7gl/NMbnKV7HG vklr6SmKZlv2TNcUHkL8dPdNhksEDmM5DKxvC/5LZ/7jKkkHAnatTp0HD8kDXUKh iiTDawGV2yMxX8CsG8DRzTX/nrqwZTws5VwfVyZDVh1juaJbepyf7g9wpO9lEgsu fIwCDjf/mZq0MA5IHp+1lJUb22C7e0W9hbkNsVcnJcbyQfYsoJYUu0iAC3y5fFIy QojAPkqgRk25mdGp17yB0fw5yXsd5eGAtIWtHA/kBPmlmB0pM5I= =7dzJ -----END PGP SIGNATURE----- --g9TqLzR1nFmIdtqq--