public inbox for [email protected]  
help / color / mirror / Atom feed
From: Daniel Gustafsson <[email protected]>
To: Michael Paquier <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: BharatDB <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: VASUKI M <[email protected]>
Subject: Re: BUG #19095: Test if function exit() is used fail when linked static
Date: Fri, 14 Nov 2025 13:11:15 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<CAAh00ETwx8_AEM0wgoi-v875uC-FLuGGOMTaP9fCNdVw4Zq=Vg@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>

> On 12 Nov 2025, at 09:15, Michael Paquier <[email protected]> wrote:
> 
> On Wed, Nov 12, 2025 at 09:13:09AM +0100, Daniel Gustafsson wrote:
>> On 12 Nov 2025, at 07:38, Tom Lane <[email protected]> wrote:
>>> Personally I'm okay with whitelisting pthread_exit() as
>>> Torsten suggested.
>> 
>> +1, we already have a few whitelisted entries and pthread_exit seems perfectly
>> reasonable to add to that list.
> 
> WFM.

The attached trivial diff adds this to the whitelist clause in the Makefile.  I
experimented with adding this to Meson, and while it's trivial enough to do the
run_command with libpq_so.full_path, it's less clear to me exactly where in the
build it should be added.  I've pinged my colleague Bilal who is much better at
Meson than me to collaborate on that as a separate fix.

--
Daniel Gustafsson



Attachments:

  [application/octet-stream] pthread_exit_whitelist.diff (629B, 2-pthread_exit_whitelist.diff)
  download | inline diff:
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index da6650066d4..3bd0e4f3840 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -144,7 +144,7 @@ $(stlib): $(OBJS_STATIC)
 libpq-refs-stamp: $(shlib)
 ifneq ($(enable_coverage), yes)
 ifeq (,$(filter solaris,$(PORTNAME)))
-	@if nm -A -u $< 2>/dev/null | grep -v -e __cxa_atexit -e __tsan_func_exit | grep exit; then \
+	@if nm -A -u $< 2>/dev/null | grep -v -e __cxa_atexit -e __tsan_func_exit -e pthread_exit | grep exit; then \
 		echo 'libpq must not be calling any function which invokes exit'; exit 1; \
 	fi
 endif


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: BUG #19095: Test if function exit() is used fail when linked static
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox