Re: Preventing abort() and exit() calls in libpq

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jacob Champion <pchampion@vmware.com>
Cc: "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>, "daniel@yesql.se" <daniel@yesql.se>, "info@cspug.cz" <info@cspug.cz>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "michael@paquier.xyz" <michael@paquier.xyz>
Date: 2021-07-02T22:20:25Z
Lists: pgsql-hackers
Jacob Champion <pchampion@vmware.com> writes:
> With latest HEAD, building with --enable-coverage still fails on my
> Ubuntu 20.04:

>     ! nm -A -u libpq.so.5.15 2>/dev/null | grep -v __cxa_atexit | grep exit
>     libpq.so.5.15:                 U exit@@GLIBC_2.2.5

Hm, weird.  I don't see that here on RHEL8, and 
https://coverage.postgresql.org seems to be working so it doesn't fail on
Alvaro's Debian setup either.  What configure options are you using?
Does "nm -u" report "exit" being referenced from any *.o in libpq,
or from any *_shlib.o in src/port/ or src/common/ ?

			regards, tom lane



Commits

  1. Further restrict the scope of no-exit()-in-libpq test.

  2. Improve build-time check that libpq doesn't call exit().

  3. Fix portability fallout from commit dc227eb82.

  4. Add a build-time check that libpq doesn't call exit() or abort().