Re: pgbench error: (setshell) of script 0; execution of meta-command failed
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Andy Fan <zhihuifan1213@163.com>,
Nathan Bossart <nathandbossart@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2025-01-11T19:04:13Z
Lists: pgsql-hackers
Attachments
- v1-fix-pqsignal-HEAD.patch (text/x-diff) patch v1
- v1-fix-pqsignal-REL17.patch (text/x-diff) patch v1
I wrote: > Actually, after re-reading the thread that led to 06843df4a [1], > I think a better idea is to introduce some macro magic to force > frontend clients to use libpgport's version of pqsignal() instead > of the one from libpq. We mustn't change the real name of libpq's > version, but I think we could get away with that for libpgport. After studying this more, I think what we should do in HEAD is even more aggressive: let's make the real name of port/pqsignal.c's function be either pqsignal_fe in frontend, or pqsignal_be in backend. This positively ensures that there's no collision with libpq's export, and it seems like a good idea for the additional reason that the frontend and backend versions are not really interchangeable. However, we can't get away with that in released branches because it'd be an ABI break for any outside code that calls pqsignal. What I propose doing in the released branches is what's shown in the attached patch for v17: rename port/pqsignal.c's function to pqsignal_fe in frontend, but leave it as pqsignal in the backend. Leaving it as pqsignal in the backend preserves ABI for extension modules, at the cost that it's not entirely clear which pqsignal an extension that's also linked with libpq will get. But that hazard affects none of our code, and it existed already for any third-party extensions that call pqsignal. In principle using "pqsignal_fe" in frontend creates an ABI hazard for outside users of libpgport.a. But I think it's not really a problem, because we don't support that as a shared library. As long as people build with headers and .a files from the same minor release, they'll be OK. BTW, this decouples legacy-pqsignal.c from pqsignal.c enough that we could now do what's contemplated in the comments from 3b00fdba9: simplify that version by making it return void, or perhaps better just a true/false success report. I've not touched that point here, though. regards, tom lane
Commits
-
Avoid symbol collisions between pqsignal.c and legacy-pqsignal.c.
- cfd7aadebea1 13.19 landed
- b935691b8b2f 16.7 landed
- a3b709cf73e0 15.11 landed
- a0dfeae0dc9a 17.3 landed
- 9a45a89c38f3 18.0 landed
- 02e69313ad0c 14.16 landed
-
Suppress macOS warnings about duplicate libraries in link commands.
- 06843df4abc5 17.0 cited