| From: | BharatDB <bharatdbpg(at)gmail(dot)com> |
|---|---|
| To: | Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Fwd: BUG #19095: Test if function exit() is used fail when linked static |
| Date: | 2025-11-12 05:54:31 |
| Message-ID: | CAAh00EQOX-+NcfYqrZ=qdE1rsGBttN7JAtQBtz=jzKmSprBx_A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs pgsql-hackers |
---------- Forwarded message ---------
From: BharatDB <bharatdbpg(at)gmail(dot)com>
Date: Wed, Nov 12, 2025 at 11:23 AM
Subject: Re: BUG #19095: Test if function exit() is used fail when linked
static
To: <torsten(dot)rupp(at)gmx(dot)net>, <pgsql-bugs(at)lists(dot)postgresql(dot)org>, <
michael(at)paquier(dot)xyz>
Cc: VASUKI M <vasukim1992002(at)gmail(dot)com>
> Hello Hackers,
>
> While reproducing a static linking issue between libpq and libcrypto.a,
> I observed that the Makefile's symbol check incorrectly reports missing
> exit() symbols because 'grep exit' also matches 'atexit' and
> 'OPENSSL_atexit', etc.
>
> As discussed in the thread by Michael Paquier
> (https://www.postgresql.org/message-id/aQA1obboZFjqjaBI%40paquier.xyz)
> it seems a related fix was committed earlier. However, I was able to
> reproduce this issue again using PostgreSQL 18 (latest release).
>
> Steps to reproduce:
> nm -A -u ./src/interfaces/libpq/libpq.a
> /usr/lib/x86_64-linux-gnu/libcrypto.a 2>/dev/null | grep -v __cxa_atexit |
> grep exit
>
> Output:
> /usr/lib/x86_64-linux-gnu/libcrypto.a:libcrypto-lib-init.o:
> U atexit
> /usr/lib/x86_64-linux-gnu/libcrypto.a:libdefault-lib-rand_unix.o:
> U OPENSSL_atexit
>
> This falsely triggers an undefined exit() error.
> [1]Changing the grep pattern to match the exact symbol ('grep -x exit')
> prevents
> such false positives.
[2]Alternatively, excluding pthread_exit() (similar to
> __cxa_atexit) would also avoid the issue.
>
> But [1] will handle all the false positives instead of just pthread_exit
.LGTM
Expected (after fix):
> no output — no false positives.
>
> Patch attached.I would love to hear any suggestions from the committers.
>
Thanks in advance
>
> Best regards,
> Vasuki M
>
BharatDB,
> CDAC Chennai.
>
| Attachment | Content-Type | Size |
|---|---|---|
| 0001-Fix-prevent-false-exit-match-in-libpq-static-link-ch.patch | application/x-patch | 1.2 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Haiyang Li | 2025-11-12 06:35:22 | Re: BUG #19109: catalog lookup with the wrong snapshot during logical decoding causes coredump |
| Previous Message | BharatDB | 2025-11-12 05:53:10 | Re: BUG #19095: Test if function exit() is used fail when linked static |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2025-11-12 05:58:09 | Re: [PATCH] Add pg_get_subscription_ddl() function |
| Previous Message | BharatDB | 2025-11-12 05:53:10 | Re: BUG #19095: Test if function exit() is used fail when linked static |