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 1lzguN-0003BD-KG for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Jul 2021 14:46:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lzguJ-00023u-Ih for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Jul 2021 14:46:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lzguJ-00023m-6n for pgsql-hackers@lists.postgresql.org; Sat, 03 Jul 2021 14:46:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lzguD-0001gn-1B for pgsql-hackers@postgresql.org; Sat, 03 Jul 2021 14:46:10 +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 163Ejxft1233493; Sat, 3 Jul 2021 10:45:59 -0400 From: Tom Lane To: Noah Misch cc: Alvaro Herrera , Michael Paquier , Jacob Champion , "pgsql-hackers@postgresql.org" , Daniel Gustafsson , info@cspug.cz Subject: Re: Preventing abort() and exit() calls in libpq In-reply-to: <1231771.1625321413@sss.pgh.pa.us> References: <202107021459.7c2dkzyg5lua@alvherre.pgsql> <819502.1625239217@sss.pgh.pa.us> <20210703001639.GB2374652@rfd.leadboat.com> <1231771.1625321413@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sat, 03 Jul 2021 10:10:13 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1233491.1625323559.1@sss.pgh.pa.us> Date: Sat, 03 Jul 2021 10:45:59 -0400 Message-ID: <1233492.1625323559@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > I'm now wondering about applying the test to *.o in libpq, > as well as libpgport_shlib.a and libpgcommon_shlib.a. > The latter would require some code changes, and it would make > the prohibition extend further than libpq alone. On the bright > side, we could reinstate the check for abort(). After consuming a bit more caffeine, I'm afraid that won't work. I'd imagined leaving, e.g., psprintf.c out of libpgcommon_shlib.a. But if someone mistakenly introduced a psprintf call into libpq, it'd still compile just fine; the symbol would be resolved against psprintf in the calling application's code. We'd only detect a failure when trying to use libpq with an app that didn't contain that function, which feels like something that our own testing could miss. What I'm now thinking about is restricting the test to only be run on platforms where use of foo.a libraries is deprecated, so that we can be pretty sure that we won't hit this situation. Even if we only run the test on Linux, that'd be plenty to catch any mistakes. regards, tom lane