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.94.2) (envelope-from ) id 1tt5er-008Up7-70 for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Mar 2025 14:05:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tt5ep-008HLY-DQ for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Mar 2025 14:05:03 +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.94.2) (envelope-from ) id 1tt5ep-008HLQ-58 for pgsql-bugs@lists.postgresql.org; Fri, 14 Mar 2025 14:05:03 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tt5en-002oSW-1B for pgsql-bugs@lists.postgresql.org; Fri, 14 Mar 2025 14:05:02 +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 52EE4x9v3051194; Fri, 14 Mar 2025 10:04:59 -0400 From: Tom Lane To: Daniel Gustafsson cc: pm91.arapov@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18845: DEREF_OF_NULL.RET guc_malloc possibly returns NULL In-reply-to: References: <18845-582c6e10247377ec@postgresql.org> Comments: In-reply-to Daniel Gustafsson message dated "Fri, 14 Mar 2025 14:50:46 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3051192.1741961099.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 14 Mar 2025 10:04:59 -0400 Message-ID: <3051193.1741961099@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: > Why would we want FATAL here? Wouldn't it be better to return false lik= e how > other check_ functions already do? Indeed. Also, a quick survey shows a lot of inconsistency in guc_malloc callers --- some are lazy and just use ERROR rather than LOG-and-return. That's probably all right for PGC_POSTMASTER variables (since there's no chance of continuing anyway) but perhaps it's worth improving elsewhere. regards, tom lane