Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wRki1-002emL-2a for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 05:52:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRkhz-003ABP-2K for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 05:52:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wRkhz-003ABH-1S for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 05:52:08 +0000 Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wRkhy-00000000oCy-1j9K for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 05:52:07 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id B03EBEC0093; Tue, 26 May 2026 01:52:05 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Tue, 26 May 2026 01:52:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1779774725; x=1779861125; bh=9kabpKWyeL 2MlFYPDJ8YMh6JGJed8CIE508rzn73CEA=; b=s5LiaDOTkknmomc/Nccj6EgqZP tGVyLpLa5iB2VE+VgDLMfkpGhN9Af8nf4gnOsjGYGuByHTs44F7KjdZ1lc3+1PDi 7bC0tnA9U2auWHUevXYDJw0RiV2Do5iPQuw1FHvvdOISvLqZVThBDdGTTO4VzHhZ cvOt2qbuiz+UMzqniN6FdcQR7Ir9YwgVgLRBT8lOcHtq5R8DgF9Mz7dV4ZdzBfCX iR+jilYmOIU+cfeE9YmWik4flzbjG9nW4bm92Bur3jNo1TwjMorYMgrAkF/kaktu QwtsB8K/yOQ6Bbr0MqCmxfuY6Ma6/L9Y9DdIhqtkP6hZ+4IFqAs6bz8P1W9Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1779774725; x=1779861125; bh=9kabpKWyeL2MlFYPDJ8YMh6JGJed8CIE508 rzn73CEA=; b=RTsxiFZj3m71GSFkEXwmUW/4FdA1JG7yKHNgSSYAtWhutJLI6Du t4OkTMjzzsFHXURShfiD6i1ZGahlRj0IawVwyqe75B5rrxHfP3wJsi78BoNEJw1L qBnBcWgtjzq1PXgqZ78vetcmEIyi3T3Rgzzam/Iaol2j97ZXd9cckigUOcm2/469 Zep+3TENn8bET02maq7lYsZOWKNNbCYYw2Xws9EqPdjF9IFTQ7LmZXtc/IbLZ/mj CGjiobOdbApRjEMhyFdDKSy94GFp3jFeTEpF4T6eLX9P3hMY8f82nAdlakoCdH3k bgTwNhyWYn9GGCOHKrXjGTC+JRuXwEzwcqA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFXU3m44ov1MFoJlI7SHMw2W+bd2x6t47OdmUDY8RNuGPG9mjUqBSpvWugrow26nZ 6elYp+zRDbNLLQhoRSY1s2ppMczrSi80iFx1orafI41HJyPThgvHOsXCueIpDx36bJUmCw n+yfM8yCGWKzIxRLVrPT4+F0vvnNw5O9QofKlznAfQSkAwAeScLV7OrY7gJ1PeL/D0lsG5 4nV5nt/ASXjPBfuWeG/ps/9jqfqDNHqM5qQXjwcniwfK2DgZKU2OCRKxsu/jprKyGU9asJ rFflXDqB8omJY8reYIPLvm4KdTvXm2pS0XcpQwqEo/fceeNq2w3Z0yVQd18KqENsG+17ob wI/XdSTyhWykn/Bhk5lJVV2q1JnqIpLaKiejwMvovr+ULbI2FFmiBscQf6WA3+RL6LHtyu 6e78YoyoIzjymN0dftkmIf+ZLXT0Dac8a5CLRlR94UitAqRXpwkGFezkfjK7g9qq++gQNO xNdZQW1LdTU5OiloiUZp33xDUtjqqR3BUW0Bod594WZa08vamuLd5ml3Q7bif61WyQIy+Y LCZIXThN6kzpjeZuafy+2ECGCnBYBL9KwWoDZsmg3EEjkdJA/KRUU0w4OiawiVkoYunqrj i+ejpH59YhKPQXvq4rC4UvItfUoPp9XHj46t7lCBzGTBIrv0ZusRkRWMXhHw X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 May 2026 01:52:04 -0400 (EDT) Date: Tue, 26 May 2026 14:52:00 +0900 From: Michael Paquier To: Kyotaro Horiguchi Cc: euler@eulerto.com, pgsql-hackers@lists.postgresql.org, alvherre@kurilemu.de Subject: Re: NULL pointer dereference in syslogger with load_libraries() and -DEXEC_BACKEND at startup Message-ID: References: <746eb248-0787-4633-94fe-f3dbef249f85@app.fastmail.com> <20260526.143912.747526067628586626.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="M1+xE4L+6gL8Zmeb" Content-Disposition: inline In-Reply-To: <20260526.143912.747526067628586626.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --M1+xE4L+6gL8Zmeb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 26, 2026 at 02:39:12PM +0900, Kyotaro Horiguchi wrote: > In write_syslogger_file, there's already a fallback path to > write_stderr() when fwrite fails. Would it make sense to treat logfile > == NULL as an error case as well? It does not make much sense to me. A write failure is based on the fact that something went wrong in the underlying OS, most likely in the file system, and that's not something Postgres has any idea about. This issue is different, it is a Postgres logic bug, so adding an exception like the one you are suggesting is just a shortcut hiding the real issue: the log file is not ready yet, but the syslogger is invoked at a point when it thinks the log file exists. -- Michael --M1+xE4L+6gL8Zmeb Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmoVNQAACgkQnvQgOdby QH1Ftw//c08aIZ6oE9PXhkPeAgzckJKFiObkGg7efRTwnX32QqHn7aclI+H7HRDn 6rGIa5/USeiLhP0WjIJrWoPq1tD54VuEGQHOiCpxrij6JMaifrNI3y2CMbgxY7NI XES8rCbnRRQXtcoC8wdiefoYJplViVkYRKxyorhFSL3Q4HcglB/gQGpl4uQQRQrX HbtLHkeWNVtjh4PJgNUUbdnW2hNFA7h6eP4euUd0C3A8wp4hMs/xd9wS3oR8Y48+ jX8ds2ylou4KSMcIwduSY+d5WAgmGLXE8sRgSneK7/I7H0Sx13D3O7FUn/3PJQ7e YwwYkGJYHDwpeREp5Z7+YPtYbPld9AoCcihc8J9z5dzlU0QDwCTI1igO89QP+/8w cbOzSobw3U5kPQxLgEVwJf32/CiFqPH30lm/hX9xHAOu0Vb7nnO+rg73WxARfGKN j+JZWKUWL+R3541d01ZY+4OxFazDZ/ZeFzm0eL6DWjLEX2hzwZ6b7R4DJV1LL4yR WMvpt2FxEurYz1UtlsyT0dOG562cM5edJCjGThLHY1T7P9fjqabmpGCHnYMKYhK1 6M/d/Yk41R1GVqyqJFyP22HlrjtkuMdKO7AdMQVlfPEf+Vi1QdzlIlTfgvnqG/hN TMNL79ljEFyUjG5w1L3D4DOsCHdNEMPJthihtI0bTza35BuPE4o= =FZ2+ -----END PGP SIGNATURE----- --M1+xE4L+6gL8Zmeb--