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 1wRkVx-002eZ8-09 for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 05:39:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRkVu-0032AF-3A for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 05:39:39 +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 1wRkVu-0032A7-2G for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 05:39:39 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wRkVt-00000000o7J-41XU for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 05:39:38 +0000 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-c80227b1f6cso3769211a12.1 for ; Mon, 25 May 2026 22:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779773977; x=1780378777; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=GVS5tD22/4xIGcDkiC47iGDhBcjN9ZJK0xkBU7MdOCA=; b=IJJja5qWmdj4dhse/6czW4RsJjhDOliepLvjC6RfBEFeQMHhjvXBWrIczky4NSiTYc 59YKWaGcLk04SqXmIodEBf/0WStu63MVreNH+NR5Mri4Y5rJ9ogKGOzaFAAQozm4f8Oj nitOJSf+gWk9ksu2GADnA4j3Wl2QlA+c5lwAlY0SF3ohQ7bxvPrZMUhbmPipDLRHjyfM T0tYtKkKK6u/8fEjxSpx46afT8g5Pk/Ane/P2WaIkTD/+uvWsbjc8mjTVzNXvm9ryAjL 5Dhcxe27XgwPf0+0Nf/w5hIGkVw03JcxaEHQhj833F1nkl13grTh4Z+BuL4euzxUc4TQ 1FFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779773977; x=1780378777; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GVS5tD22/4xIGcDkiC47iGDhBcjN9ZJK0xkBU7MdOCA=; b=I1V/GpGfw9liXdxKqinAHZpAyh2rck+mwVt2hA69BoqM7OfEf39/WJYuuqldtM2x5P 6+4TnhI0UtWncx9WYZOMMgbgJ5X9VR1zmj8LjHO+8fEYpscClYB2CHdQUp+V09zlNyxN ReX8vn/afzr8l9iL4NKYpallCHK//mtP7lLcqcAvHF9krvKcv/3sNiGWgPku8cGW88le vCyMRr1SAgyizu5PMNCFNXdXhDNLiCFFcfKzCiuFM2fbiVPJFFS5Crzx1gdpgz0hSI/c 2TXfIC7xQ2kGOG0Hp+JCMOFTDDnI0yHKnFSjqjNAtkGEUHvQZDWYxDTQYLKs9qYtidzR EOSw== X-Forwarded-Encrypted: i=1; AFNElJ/jf13duAB/bMWWhNLrHzWiyD0wzVQVKhUZ5ngPlmatRkC1jAzj0lK2kGKRLxn74DBQXXq41rR98ayxPJPK@lists.postgresql.org X-Gm-Message-State: AOJu0YzoqCRD2W1P01FCXWNCDjdD/PkzSCOPVU98CtBFPjKhzCqZZEOo sUpCZa8SkZRQ7e8ttqIQXX7CUTtLilItDDZ2zKhGZyKZQGzUzTdZJIUF X-Gm-Gg: Acq92OH2PdQnvSqs1nK+QhJyBAQigliA2dFy1BUzQa3E3A5pIxyuOCCRN7dtl2ie/6g Oov7NMnOb4BxIeuom5TslBoL2dcR35RNB36gJ3klVTzxcxbUfDUGd6VAivQxddSgsoxkZQ+3wkx 7mHhpt/Qrk+kJPANfh5sUdOwT8/w2VUqtVlGJRqyMQzmtpZmidTJygo25sWErWgaDmQkY5MGA1C Dhse0/m0Nqq3s3q1/YlsaNhOERNdGnF9yqFQh74FyZLPrJnIv+oB54sKpfh+oD4GtlIymtaTyNo GpE+gQ5KhDmhn6HRkxjPQ2BX807DXQFbvlLyCA5D3GLOZ8v9L/CYCSCut8T8Ptt6Znimob9QF3v InrdGG3s9lWa+8pYmrPPT5+kQ9w9NdPnzGJJ5kIq3vXlH5RnGc8Fu2ZGMZz6hjHK17g7A/eSdke RwAXp749GRiu7YS+7uvyM5Em+sesjMaOnBg5lZCjYv1H4ucvisA5wTsUIpY04VN0nxw2UTOPg= X-Received: by 2002:a05:6a21:330f:b0:3a8:9dd:75c6 with SMTP id adf61e73a8af0-3b32900b4dcmr17676561637.51.1779773976971; Mon, 25 May 2026 22:39:36 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c852028fe99sm9357863a12.4.2026.05.25.22.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2026 22:39:36 -0700 (PDT) Date: Tue, 26 May 2026 14:39:12 +0900 (JST) Message-Id: <20260526.143912.747526067628586626.horikyota.ntt@gmail.com> To: michael@paquier.xyz 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 From: Kyotaro Horiguchi In-Reply-To: References: <746eb248-0787-4633-94fe-f3dbef249f85@app.fastmail.com> User-Agent: Mew version 6.8 on Emacs 29.4 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Tue, 26 May 2026 14:20:52 +0900, Michael Paquier wrote in > While thinking about an approach that could allow to keep > 0c8e082fba8d, I was wondering whether we should have a boolean flag > that tracks if the log file is opened or not that gets set (we should > not care about the reset) when we are done with its creation, but I'm > feeling that this makes the logic feeble. We know only rely on 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? > MyBackendType for the job which means to complicate all these checks. > The part that makes me uneasy is that the logging facility should be > robust by design, and simpler is always better IMO. > > An exception where we don't set MyBackendType and have an exception > for this corresponding child_type value does not really feel right to > me either.. As a whole, I am not sure to like what has been done > here. Agreed. Regards. -- Kyotaro Horiguchi NTT Open Source Software Center