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 1vJuzW-0088L9-0Z for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Nov 2025 14:41:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vJuzT-006i3k-37 for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Nov 2025 14:41:31 +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 1vJuzT-006i3c-2G for pgsql-bugs@lists.postgresql.org; Fri, 14 Nov 2025 14:41:31 +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 1vJuzS-0077Db-0K for pgsql-bugs@lists.postgresql.org; Fri, 14 Nov 2025 14:41:30 +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 5AEEek0r3133109; Fri, 14 Nov 2025 09:40:46 -0500 From: Tom Lane To: Andres Freund cc: Daniel Gustafsson , Michael Paquier , BharatDB , torsten.rupp@gmx.net, pgsql-bugs@lists.postgresql.org, VASUKI M Subject: Re: BUG #19095: Test if function exit() is used fail when linked static In-reply-to: <2wdijz5mucqx33vqzyep44uyucauw33egvwa7cbociesqlks5x@yj63saikpzwu> References: <19095-6d8256d0c37d4be2@postgresql.org> <2305435.1762929527@sss.pgh.pa.us> <7C7B32ED-5742-49D5-9380-5E02AA5B03C4@yesql.se> <057A2AED-0116-446B-8986-57FDA70CA5A3@yesql.se> <2wdijz5mucqx33vqzyep44uyucauw33egvwa7cbociesqlks5x@yj63saikpzwu> Comments: In-reply-to Andres Freund message dated "Fri, 14 Nov 2025 09:01:06 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3133107.1763131246.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 14 Nov 2025 09:40:46 -0500 Message-ID: <3133108.1763131246@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > But more generally: If we allow pthread_exit(), what's the point of this= test? > That's one of the functions we better avoid calling, no? ATM it's not something we'd be tempted to call, but I take your point. > ISTM that if we do want to continue having this test, the issue is that = we're > testing the shared library - which will have already linked against stat= ic > libraries like the sanitizer ones or in this case libcrypto. What we oug= ht to > do is to test the .o files constituting libpq.so, rather than the alread= y > linked .so. That way we will find our own calls to exit etc, but not one= s in > static libraries. My recollection is that that doesn't help as much as you'd think. __tsan_func_exit, for one, can get injected into our own .o files if we build with appropriate sanitizers enabled. regards, tom lane