Re: Preventing abort() and exit() calls in libpq
Jacob Champion <pchampion@vmware.com>
From: Jacob Champion <pchampion@vmware.com>
To: "tgl@sss.pgh.pa.us" <tgl@sss.pgh.pa.us>, "alvherre@alvh.no-ip.org" <alvherre@alvh.no-ip.org>
Cc: "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:15:45Z
Lists: pgsql-hackers
On Wed, 2021-06-30 at 10:42 -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > On 2021-Jun-30, Tom Lane wrote:
> > > You mentioned __gcov_exit, but I'm not sure if we need an
> > > exception for that. I see it referenced by the individual .o
> > > files, but the completed .so has no such reference, so at least
> > > on RHEL8 it's apparently satisfied during .so linkage. Do you
> > > see something different?
> > Well, not really. I saw it but only after I removed -fprofile-arcs from
> > Makefile.shlib's link line; but per my other email, that doesn't really
> > work.
> > Everything seems to work well for me after removing abort from that grep.
>
> OK, thanks, will push a fix momentarily.
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
I don't see any exit references in the libpq objects or in
libpgport_shlib, so it seems like libpgcommon_shlib is the culprit... I
assume turning off optimizations leads to less dead code elimination?
--Jacob
Commits
-
Further restrict the scope of no-exit()-in-libpq test.
- 792259591c0f 15.0 landed
-
Improve build-time check that libpq doesn't call exit().
- 2f7bae2f924d 15.0 landed
-
Fix portability fallout from commit dc227eb82.
- e45b0dfa1f10 15.0 landed
-
Add a build-time check that libpq doesn't call exit() or abort().
- dc227eb82ea8 15.0 landed