pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: torsten.rupp@gmx.net
Subject: BUG #19095: Test if function exit() is used fail when linked static
Date: Mon, 27 Oct 2025 07:56:38 +0000
Message-ID: <19095-6d8256d0c37d4be2@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      19095
Logged by:          Torsten Rupp
Email address:      torsten.rupp@gmx.net
PostgreSQL version: 15.14
Operating system:   Linux
Description:        

Note: occur from version 15.14 or newer.

In src/interfaces/libpq/Makefile is a test if the function "exit()" (or in
general: a function exists with the name part "exit") is used:

libpq-refs-stamp: $(shlib)
ifneq ($(enable_coverage), yes)
ifeq (,$(filter aix solaris,$(PORTNAME)))
        @if nm -A -u $< 2>/dev/null | grep -v __cxa_atexit | grep exit; then
\
                echo 'libpq must not be calling any function which invokes
exit'; exit 1; \
        fi
endif
endif

This test fail if libpq is linked static to an application when e. g.
libcrypto is also linked static into libpq which add indirectly a call to
"pthread_exit()".

Possible fix: exclude pthread_exit(), too (like __cxa_atexit), e.g.:

libpq-refs-stamp: $(shlib)
ifneq ($(enable_coverage), yes)
ifeq (,$(filter aix solaris,$(PORTNAME)))
        @if nm -A -u $< 2>/dev/null | grep -v __cxa_atexit | grep -v
pthread_exit | grep exit; then \
                echo 'libpq must not be calling any function which invokes
exit'; exit 1; \
        fi
endif
endif



view thread (37+ messages)  latest in thread

Message-ID: <19095-6d8256d0c37d4be2@postgresql.org>
Permalink:  ../19095-6d8256d0c37d4be2@postgresql.org/
Also on:    postgresql.org/message-id/19095-6d8256d0c37d4be2@postgresql.org

 · 

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: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, torsten.rupp@gmx.net
  Subject: Re: BUG #19095: Test if function exit() is used fail when linked static
  In-Reply-To: <19095-6d8256d0c37d4be2@postgresql.org>

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

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