Re: convert libpgport's pqsignal() to a void function
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Fujii Masao <masao.fujii@oss.nttdata.com>, Andy Fan <zhihuifan1213@163.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-01-15T19:47:18Z
Lists: pgsql-hackers
On Thu, Jan 16, 2025 at 08:21:08AM +1300, Thomas Munro wrote: > On Thu, Jan 16, 2025 at 8:15 AM Nathan Bossart <nathandbossart@gmail.com> wrote: >> On Tue, Jan 14, 2025 at 11:08:05PM -0500, Tom Lane wrote: >> > I wonder why we redefine those values? >> >> I wondered the same. Those redefines have been there since commit 5049196, >> but I haven't been able to find any real discussion in the archives about >> it. Maybe I will bug Magnus about it sometime, in case he happens to >> remember the reason. > > My guess would be: perhaps some ancient version of MinGW didn't define > them? They're defined by MinGW and native signal.h now and they have > the same values, so we should remove them I think. Okay. If nothing else, it'd be interesting to see what the buildfarm thinks. > Assertion failed: 0, file ../src/port/pqsignal.c, line 147 > > Could be due to calling native signal() with a signal number other > than the 6 values required to work by the C standard? Looking closer, that probably makes more sense than my SIG_ERR redefinition theory. If that assertion is getting hit, that means signal() _is_ returning SIG_ERR (either the system one or our redefined version), and it looks like it's pretty common to use -1 for SIG_ERR. That'd only affect Windows frontend programs, but it still sounds scary. I'll try getting more details about the error with some custom cfbot runs. -- nathan
Commits
-
Remove redefinitions of SIG_* macros in win32_port.h.
- 0dc9c7d200e5 18.0 landed
-
Convert libpgport's pqsignal() to a void function.
- d4a43b283751 18.0 landed
-
Avoid calling pqsignal() with invalid signals on Windows frontends.
- 5cda4fdb0beb 18.0 landed
-
Avoid symbol collisions between pqsignal.c and legacy-pqsignal.c.
- 9a45a89c38f3 18.0 cited
-
Check that MyProcPid == getpid() in backend signal handlers.
- 3b00fdba9f20 17.0 cited
-
Further refactoring of c.h and nearby files.
- ed9b3606dadb 11.0 cited
-
Here's the latest win32 signals code, this time in the form of a patch
- 50491963cb6e 8.0.0 cited
-
Add C version of initdb, from Andrew Dunstan.
- 279598bb7138 8.0.0 cited
-
Allow Win32 to compile under MinGW. Major changes are:
- 12c942383296 7.4.1 cited