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

Noah Misch <noah@leadboat.com>

From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Michael Paquier <michael@paquier.xyz>, Jacob Champion <pchampion@vmware.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Daniel Gustafsson <daniel@yesql.se>, info@cspug.cz
Date: 2021-07-01T04:53:09Z
Lists: pgsql-hackers
On Wed, Jun 30, 2021 at 11:45:10PM -0400, Tom Lane wrote:
> we're still left with the question of why
> Solaris' "nm" doesn't support the POSIX-required options.

In POSIX, -g and -u are mutually exclusive.  Solaris ignores all but the first
of these in a command:

[nm@gcc-solaris11 5:0 2021-07-01T06:48:54 postgresql 1]$ /usr/bin/nm -u -g src/interfaces/libpq/libpq.so|grep exec
nm: -u or -e set, -g ignored
[nm@gcc-solaris11 5:0 2021-07-01T06:49:41 postgresql 1]$ /usr/bin/nm -g -u src/interfaces/libpq/libpq.so|grep exec
nm: -e or -g set, -u ignored
[405]   |              208320|                  84|FUNC |GLOB |3    |14     |PQexec
[818]   |              208416|                 128|FUNC |GLOB |3    |14     |PQexecParams
[729]   |              208672|                 112|FUNC |GLOB |3    |14     |PQexecPrepared
[nm@gcc-solaris11 5:0 2021-07-01T06:49:45 postgresql 0]$ /usr/bin/nm -u src/interfaces/libpq/libpq.so|grep exec
[nm@gcc-solaris11 5:0 2021-07-01T06:49:48 postgresql 1]$ 



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().