Re: Preventing abort() and exit() calls in libpq
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Michael Paquier <michael@paquier.xyz>,
Jacob Champion <pchampion@vmware.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Daniel Gustafsson <daniel@yesql.se>
Date: 2021-06-28T13:54:16Z
Lists: pgsql-hackers
Fabien COELHO <coelho@cri.ensmp.fr> writes: > A possible trick is to add ccp flags such as: -Dexit=exit_BAD > -Dabort=abort_BAD. Not really going to work, at least not without a lot of fragile kluges, because the main problem here is to prevent libpq from *indirectly* calling those functions via stuff it imports from src/port or src/common. It's possible that we could make it work by generalizing the policy that "libpq may not call abort/exit" into "no PG shlib may call abort/exit", and then apply the cpp #defines while compiling the xxx_shlib.o variants of those files. This does not seem more attractive than what I proposed, though. regards, tom lane
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