pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: walther@technowledgy.de
To: Bruce Momjian <bruce@momjian.us>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Christophe Pettus <xof@thebuild.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: PostgreSQL Bugs <pgsql-bugs@lists.postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: Regression tests fail with musl libc because libpq.so can't be loaded
Date: Mon, 25 Mar 2024 22:58:30 +0100
Message-ID: <2293691d-2adb-4502-b956-73e79dc43c55@technowledgy.de> (raw)
In-Reply-To: <Zf3fnKpHIGpe5mOi@momjian.us>
References: <CA+hUKGK2cSx3dveMqBD+E9N=zJ0WawBcbk_jnPqmdWBM0DT_3Q@mail.gmail.com>
	<477fa513-6bf0-456d-8d24-1e22a19df671@technowledgy.de>
	<ZfrmN4WHuJgD95fw@momjian.us>
	<CA+hUKGJzC4rr2Yr=QZyx9W83Wv=TVJHndKF1anjNLNXVUM7TqQ@mail.gmail.com>
	<f98cd8de-1c66-491a-8409-e62c09932080@technowledgy.de>
	<36690fcf-f0c8-4d60-af49-6a7efa0e2b14@technowledgy.de>
	<CA+hUKGJAkTZUa9JGr-zsadaqsN=K0P71t-1L2t2=MQFDMc4GuQ@mail.gmail.com>
	<ZfzLsiXbguTDatiZ@momjian.us>
	<a2463df1-be45-4a76-b90f-7676d778e7b1@technowledgy.de>
	<Zf2JU0_GDdbeBm5j@momjian.us>
	<Zf3fnKpHIGpe5mOi@momjian.us>

Bruce Momjian:
> With no one "hoping this patch dies in a fire"*, I have updated it with
> more details, which I now think is committable to master.  Is this
> something to backpatch?  Seems too rare a bug to me.

I would like to see this backpatched to be able to run the regression 
tests easily on all stable branches.

I have taken your's/Thomas' patch and extended it with a few more taking 
in many of the ideas in this thread:

0001 Don't clobber LD_*
This is the patch you posted. This applies cleanly all the way down to 
v12. This fixes the bug and allows running most of the tests with musl - 
yeah!
I also confirmed, that this will not create practical problems with 
library/postgres docker image, where this is likely used the most. While 
"postgres" is called by default without any arguments here, plenty of 
environment variables are passed. The docker image does use LD_PRELOAD 
to trick initdb, but that's not set when running the postmaster, so not 
a problem here.
This use-case also shows why the proposed patch to still partially 
clobber environ at this stage is better than to not clobber environ at 
all - in this case, the docker image would essentially have no ps status 
at all by default.-

0002 Allow setting PS_USE_NONE via CPPFLAGS
This was proposed by Andrew and applies cleanly down to v12. Thus, it 
could be backpatched, too. First and foremost this would allow setting a 
buildfarm animal to use this flag to make sure this code path is 
actually build/tested at all. This is something that Thomas and Tom 
hinted at.

0003 Don't ever clobber environ again
This is the approach I had previously posted as a PoC. This would not be 
backpatched, but I suggested this could go into v17 now. This avoids the 
undefined behavior and sets the table to eventually set ps status via 
argv by default and remove PS_USE_NONE later.
Compared to the PoC patch, I decided not to pad argv[0], because this 
will break the ps status display for the postmaster itself. Instead exec 
is called with an additional argument consisting of exactly 255 spaces.
I also tried avoiding the additional exec-call if postgres was called 
via pg_ctl, as suggested by Peter. This quickly turned out to be more 
invasive than I would have liked this to be, though.
The current approach works very well, the environment doesn't need to be 
copied anymore and the workaround for /proc/<pid>/environ in main.c can 
go away, too.

0004 Default to PS_USE_CLOBBER_ARGV
This changes the default to display ps status on all other systems, too. 
This could potentially go in now as well, or be delayed to the beginning 
of the v18 cycle. In the unlikely event that this breaks something on a 
platform not considered here and we get a bug report, we can easily 
advise to compile with CPPFLAGS=-DPS_USE_NONE, which is still there at 
this stage.

0005 Remove PS_USE_NONE
However, if no reports come in and no problems are detected with 0004, 
then this can be entirely removed. This for "later", whenever that is.

Best,

Wolfgang

Attachments: download all (5 files, .tar.gz)

0001-Don-t-clobber-LD_-environment-variables.patch (text/x-patch, 3.0K) download From 55bc8a12773d51c0ef070dfbb2714d08801390f5 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther <walther@technowledgy.de> Date: Sun, 24 Mar 2024 17:12:45 +0100 Subject: [PATCH 1/5] Don't clobber LD_* environment variables Our PS_USE_CLOBBER_ARGV code relocates the environment, which itself is allowed, in order to steal the old space to make a bigger argv[0] for ps/top to show, which is probably formally undefined behavior. Unfortunately that corrupts musl's copy of LD_LIBRARY_PATH if set, because it stashes a pointer to the initial value before main() begins. It probably doesn't matter for installed servers but breaks the regression tests. Here we look out for variables named LD_* while computing how much space to steal, so we can avoid clobbering them. No change in behaviour if not found, but otherwise you might potentially get ps status messages truncated to a smaller size than before depending on the length of preceding clobberable variables. Musl does not define any compiler symbols, so we do this for any Linux libc we don't know is safe. The truncation size shouldn't be too small or at least has an easy mitigation: define a dummy variable. Reported-by: Wolfgang Walther <walther@technowledgy.de> Discussion: https://postgr.es/m/fddd1cd6-dc16-40a2-9eb5-d7fef2101488%40technowledgy.de --- src/backend/utils/misc/ps_status.c | 32 +++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c index 5d829e6e483..7532af17dbb 100644 --- a/src/backend/utils/misc/ps_status.c +++ b/src/backend/utils/misc/ps_status.c @@ -151,7 +151,37 @@ save_ps_display_args(int argc, char **argv) for (i = 0; environ[i] != NULL; i++) { if (end_of_area + 1 == environ[i]) - end_of_area = environ[i] + strlen(environ[i]); + { + +#if defined(__linux__) && (! defined(__GLIBC__) && ! defined(__UCLIBC__ )) + /* + * The musl runtime linker stores pointers to variable values + * which are defined in the process's environment. Therefore, + * in these cases we cannot overwrite such variable values + * when setting the process title or dynamic linking (dlopen) + * might fail. Here, we truncate the update of the process + * title when either of two important dynamic linking + * environment variables are set. Musl does not define any + * compiler symbols, so we have to do this for any Linux libc + * we don't know is safe. + */ + if (strstr(environ[i], "LD_LIBRARY_PATH=") == environ[i] || + strstr(environ[i], "LD_PRELOAD=") == environ[i]) + { + /* + * We can overwrite the name, but stop at the equals sign. + * Future loops will not find contiguous space, but we + * don't break early because we want to count the total + * number. + */ + end_of_area = strchr(environ[i], '='); + } + else +#endif + { + end_of_area = environ[i] + strlen(environ[i]); + } + } } ps_buffer = argv[0]; -- 2.44.0
0002-Allow-disabling-ps-status-display-via-CPPFLAGS.patch (text/x-patch, 1.6K) download From 26b65a2f4a33463b28d15419159f49569a61d003 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther <walther@technowledgy.de> Date: Mon, 25 Mar 2024 21:08:39 +0100 Subject: [PATCH 2/5] Allow disabling ps status display via CPPFLAGS The PS_USE_NONE is deemed the safest choice and thus the default if none of the other options can safely be taken. However this option is also rarely tested, if at all. This change allows to explicitly build with CPPFLAGS=-DPS_USE_NONE for two reasons: - This can be used to have an animal in the buildfarm actually build this code path. - This will allow us to possibly change the default to PS_USE_CLOBBER_ARGV later and still have an escape hatch in case users report problems with that default. Suggested by Andrew Dunstan. --- src/backend/utils/misc/ps_status.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c index 7532af17dbb..d3513b22693 100644 --- a/src/backend/utils/misc/ps_status.c +++ b/src/backend/utils/misc/ps_status.c @@ -46,6 +46,8 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; * don't update ps display * (This is the default, as it is safest.) */ +#ifndef PS_USE_NONE + #if defined(HAVE_SETPROCTITLE_FAST) #define PS_USE_SETPROCTITLE_FAST #elif defined(HAVE_SETPROCTITLE) @@ -58,6 +60,7 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; #define PS_USE_NONE #endif +#endif /* not PS_USE_NONE */ /* Different systems want the buffer padded differently */ #if defined(__linux__) || defined(__darwin__) -- 2.44.0
0003-Don-t-clobber-any-environment-variables-for-ps-statu.patch (text/x-patch, 9.8K) download From 2834cbbbdd0794346eb6f78e9799c563b18b135c Mon Sep 17 00:00:00 2001 From: Wolfgang Walther <walther@technowledgy.de> Date: Mon, 25 Mar 2024 22:07:09 +0100 Subject: [PATCH 3/5] Don't clobber any environment variables for ps status Clobbering the environment area for ps status is formally undefined behavior and thus makes up a bad default. Here we replace the clobbering of the environment with a different mechanisum to increase the available argv area for ps status: If the given arguments have not been long enough, yet, we exec ourself with an extra argument of spaces. This argument of spaces is then removed again for further processing, but the additional space is used for ps status. This a more portable approach, because it doesn't rely on undefined behavior and can possibly be made the default instead of PS_USE_NONE later. It also allows to remove the workaround for UBSan in main.c and makes /proc/<pid>/environ work again. --- src/backend/main/main.c | 41 ++--------- src/backend/utils/misc/ps_status.c | 114 +++++++++++++---------------- src/include/utils/ps_status.h | 2 +- 3 files changed, 58 insertions(+), 99 deletions(-) diff --git a/src/backend/main/main.c b/src/backend/main/main.c index bfd0c5ed658..f2e333d74eb 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c @@ -80,14 +80,16 @@ main(int argc, char *argv[]) * Remember the physical location of the initially given argv[] array for * possible use by ps display. On some platforms, the argv[] storage must * be overwritten in order to set the process title for ps. In such cases - * save_ps_display_args makes and returns a new copy of the argv[] array. + * save_ps_display_args makes a new copy of the argv[] array. * - * save_ps_display_args may also move the environment strings to make - * extra room. Therefore this should be done as early as possible during - * startup, to avoid entanglements with code that might save a getenv() - * result pointer. + * save_ps_display_args may also exec ourself again with an extra argument + * to increase the available argv area. Therefore this should be done as + * early as possible during startup, to avoid doing more things than + * necessary twice. Once called with an the extra argument, this will be + * removed again by save_ps_display_args, which then returns the new + * number for argc. */ - argv = save_ps_display_args(argc, argv); + argc = save_ps_display_args(argc, argv); /* * Fire up essential subsystems: error and memory management @@ -414,30 +416,3 @@ check_root(const char *progname) } #endif /* WIN32 */ } - -/* - * At least on linux, set_ps_display() breaks /proc/$pid/environ. The - * sanitizer library uses /proc/$pid/environ to implement getenv() as it wants - * to work independent of libc. When just using undefined and alignment - * sanitizers, the sanitizer library is only initialized when the first error - * occurs, by which time we've often already called set_ps_display(), - * preventing the sanitizer libraries from seeing the options. - * - * We can work around that by defining __ubsan_default_options, a weak symbol - * libsanitizer uses to get defaults from the application, and return - * getenv("UBSAN_OPTIONS"). But only if main already was reached, so that we - * don't end up relying on a not-yet-working getenv(). - * - * As this function won't get called when not running a sanitizer, it doesn't - * seem necessary to only compile it conditionally. - */ -const char *__ubsan_default_options(void); -const char * -__ubsan_default_options(void) -{ - /* don't call libc before it's guaranteed to be initialized */ - if (!reached_main) - return ""; - - return getenv("UBSAN_OPTIONS"); -} diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c index d3513b22693..c1161e85507 100644 --- a/src/backend/utils/misc/ps_status.c +++ b/src/backend/utils/misc/ps_status.c @@ -23,8 +23,6 @@ #include "utils/guc.h" #include "utils/ps_status.h" -extern char **environ; - /* GUC variable */ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; @@ -38,7 +36,7 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; * use the function setproctitle(const char *, ...) * (other BSDs) * PS_USE_CLOBBER_ARGV - * write over the argv and environment area + * write over the argv area * (Linux and most SysV-like systems) * PS_USE_WIN32 * push the string out as the name of a Windows event @@ -78,6 +76,7 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; static char ps_buffer[PS_BUFFER_SIZE]; static const size_t ps_buffer_size = PS_BUFFER_SIZE; #else /* PS_USE_CLOBBER_ARGV */ +#define PS_BUFFER_MIN_SIZE 256 static char *ps_buffer; /* will point to argv area */ static size_t ps_buffer_size; /* space determined at run time */ static size_t last_status_len; /* use to minimize length of clobber */ @@ -107,15 +106,13 @@ static char **save_argv; * If needed, we make a copy of the original argv[] array to preserve it * from being clobbered by subsequent ps_display actions. * - * (The original argv[] will not be overwritten by this routine, but may be - * overwritten during init_ps_display. Also, the physical location of the - * environment strings may be moved, so this should be called before any code - * that might try to hang onto a getenv() result.) + * The original argv[] will not be overwritten by this routine, but may be + * overwritten during init_ps_display. * * Note that in case of failure this cannot call elog() as that is not * initialized yet. We rely on write_stderr() instead. */ -char ** +int save_ps_display_args(int argc, char **argv) { save_argc = argc; @@ -125,11 +122,9 @@ save_ps_display_args(int argc, char **argv) /* * If we're going to overwrite the argv area, count the available space. - * Also move the environment to make additional room. */ { char *end_of_area = NULL; - char **new_environ; int i; /* @@ -145,71 +140,60 @@ save_ps_display_args(int argc, char **argv) { ps_buffer = NULL; ps_buffer_size = 0; - return argv; - } - - /* - * check for contiguous environ strings following argv - */ - for (i = 0; environ[i] != NULL; i++) - { - if (end_of_area + 1 == environ[i]) - { - -#if defined(__linux__) && (! defined(__GLIBC__) && ! defined(__UCLIBC__ )) - /* - * The musl runtime linker stores pointers to variable values - * which are defined in the process's environment. Therefore, - * in these cases we cannot overwrite such variable values - * when setting the process title or dynamic linking (dlopen) - * might fail. Here, we truncate the update of the process - * title when either of two important dynamic linking - * environment variables are set. Musl does not define any - * compiler symbols, so we have to do this for any Linux libc - * we don't know is safe. - */ - if (strstr(environ[i], "LD_LIBRARY_PATH=") == environ[i] || - strstr(environ[i], "LD_PRELOAD=") == environ[i]) - { - /* - * We can overwrite the name, but stop at the equals sign. - * Future loops will not find contiguous space, but we - * don't break early because we want to count the total - * number. - */ - end_of_area = strchr(environ[i], '='); - } - else -#endif - { - end_of_area = environ[i] + strlen(environ[i]); - } - } + return argc; } ps_buffer = argv[0]; last_status_len = ps_buffer_size = end_of_area - argv[0]; + } - /* - * move the environment out of the way - */ - new_environ = (char **) malloc((i + 1) * sizeof(char *)); - if (!new_environ) - { - write_stderr("out of memory\n"); - exit(1); - } - for (i = 0; environ[i] != NULL; i++) + /* + * If the argv area wasn't big enough, also exec ourself an additional + * argument to make more room. + * + * Create a new argument which is just a big number of spaces. While this + * could technically be a valid filename and thus a valid argument to one + * of the other options, it should still be safe enough to break the case + * of passing exactly 256 spaces as a path. If someone really wants to do + * that, they could work around this, by just adding another argument + * after that, because we match the very last argument to this pattern. + */ + { + char *extra_arg; + + extra_arg = (char *) malloc(PS_BUFFER_MIN_SIZE); + MemSet(extra_arg, ' ', PS_BUFFER_MIN_SIZE - 1); + extra_arg[PS_BUFFER_MIN_SIZE - 1] = NULL; + + if (ps_buffer_size <= PS_BUFFER_MIN_SIZE) { - new_environ[i] = strdup(environ[i]); - if (!new_environ[i]) + char **padded_argv; + int i; + + padded_argv = (char **) malloc((argc + 2) * sizeof(char *)); + if (!padded_argv) { write_stderr("out of memory\n"); exit(1); } + for (i = 0; i < argc; i++) + padded_argv[i] = argv[i]; + padded_argv[argc] = extra_arg; + padded_argv[argc + 1] = NULL; + + execvp(argv[0], padded_argv); + write_stderr("exec failed: %s\n", strerror(errno)); + exit(1); + } + else if (strcmp(argv[argc - 1], extra_arg) == 0) + { + /* + * To hide the extra_arg spaces on the ps output for the + * postmaster, we need to overwrite them with PS_PADDING. + */ + MemSet(argv[argc - 1], PS_PADDING, PS_BUFFER_MIN_SIZE - 1); + save_argc = --argc; } - new_environ[i] = NULL; - environ = new_environ; } /* @@ -258,7 +242,7 @@ save_ps_display_args(int argc, char **argv) } #endif /* PS_USE_CLOBBER_ARGV */ - return argv; + return argc; } /* diff --git a/src/include/utils/ps_status.h b/src/include/utils/ps_status.h index ff5a2b2b8a2..7cd2cce8f2c 100644 --- a/src/include/utils/ps_status.h +++ b/src/include/utils/ps_status.h @@ -21,7 +21,7 @@ extern PGDLLIMPORT bool update_process_title; -extern char **save_ps_display_args(int argc, char **argv); +extern int save_ps_display_args(int argc, char **argv); extern void init_ps_display(const char *fixed_part); -- 2.44.0
0004-Update-ps-status-on-all-systems-by-default.patch (text/x-patch, 1.9K) download From 78d0aebce3fa2722d1b6eef0c937251e8b5005ca Mon Sep 17 00:00:00 2001 From: Wolfgang Walther <walther@technowledgy.de> Date: Mon, 25 Mar 2024 22:18:11 +0100 Subject: [PATCH 4/5] Update ps status on all systems by default With the new approach, PS_USE_CLOBBER_ARGV does not overwrite any environment variables anymore and can be made the default. For the unlikely event that a system could have problems other than the ps status not working with this, PS_USE_NONE is kept for the moment. This can still be explicitly enabled via CPPFLAGS. --- src/backend/utils/misc/ps_status.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c index c1161e85507..d1df1b39ee0 100644 --- a/src/backend/utils/misc/ps_status.c +++ b/src/backend/utils/misc/ps_status.c @@ -35,14 +35,14 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; * PS_USE_SETPROCTITLE * use the function setproctitle(const char *, ...) * (other BSDs) - * PS_USE_CLOBBER_ARGV - * write over the argv area - * (Linux and most SysV-like systems) * PS_USE_WIN32 * push the string out as the name of a Windows event + * PS_USE_CLOBBER_ARGV + * write over the argv area + * (This is the default) * PS_USE_NONE * don't update ps display - * (This is the default, as it is safest.) + * (This can be enabled manually with CPPFLAGS=-DPS_USE_NONE.) */ #ifndef PS_USE_NONE @@ -50,12 +50,10 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; #define PS_USE_SETPROCTITLE_FAST #elif defined(HAVE_SETPROCTITLE) #define PS_USE_SETPROCTITLE -#elif defined(__linux__) || defined(__sun) || defined(__darwin__) -#define PS_USE_CLOBBER_ARGV #elif defined(WIN32) #define PS_USE_WIN32 #else -#define PS_USE_NONE +#define PS_USE_CLOBBER_ARGV #endif #endif /* not PS_USE_NONE */ -- 2.44.0
0005-Remove-obsolete-way-of-disabling-ps-status.patch (text/x-patch, 4.2K) download From 57be007a32e0963db003a5ac9ca3cfbc0deef974 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther <walther@technowledgy.de> Date: Mon, 25 Mar 2024 22:21:10 +0100 Subject: [PATCH 5/5] Remove obsolete way of disabling ps status This can be committed once it's clear that nobody actually needs it. --- src/backend/utils/misc/ps_status.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c index d1df1b39ee0..5d61259cc22 100644 --- a/src/backend/utils/misc/ps_status.c +++ b/src/backend/utils/misc/ps_status.c @@ -40,12 +40,7 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; * PS_USE_CLOBBER_ARGV * write over the argv area * (This is the default) - * PS_USE_NONE - * don't update ps display - * (This can be enabled manually with CPPFLAGS=-DPS_USE_NONE.) */ -#ifndef PS_USE_NONE - #if defined(HAVE_SETPROCTITLE_FAST) #define PS_USE_SETPROCTITLE_FAST #elif defined(HAVE_SETPROCTITLE) @@ -56,8 +51,6 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; #define PS_USE_CLOBBER_ARGV #endif -#endif /* not PS_USE_NONE */ - /* Different systems want the buffer padded differently */ #if defined(__linux__) || defined(__darwin__) #define PS_PADDING '\0' @@ -66,8 +59,6 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; #endif -#ifndef PS_USE_NONE - #ifndef PS_USE_CLOBBER_ARGV /* all but one option need a buffer to write their ps line in */ #define PS_BUFFER_SIZE 256 @@ -92,8 +83,6 @@ static size_t ps_buffer_nosuffix_len; static void flush_ps_display(void); -#endif /* not PS_USE_NONE */ - /* save the original argv[] location here */ static int save_argc; static char **save_argv; @@ -254,15 +243,12 @@ save_ps_display_args(int argc, char **argv) void init_ps_display(const char *fixed_part) { -#ifndef PS_USE_NONE bool save_update_process_title; -#endif Assert(fixed_part || MyBackendType); if (!fixed_part) fixed_part = GetBackendTypeDesc(MyBackendType); -#ifndef PS_USE_NONE /* no ps display for stand-alone backend */ if (!IsUnderPostmaster) return; @@ -318,10 +304,8 @@ init_ps_display(const char *fixed_part) update_process_title = true; set_ps_display(""); update_process_title = save_update_process_title; -#endif /* not PS_USE_NONE */ } -#ifndef PS_USE_NONE /* * update_ps_display_precheck * Helper function to determine if updating the process title is @@ -346,7 +330,6 @@ update_ps_display_precheck(void) return true; } -#endif /* not PS_USE_NONE */ /* * set_ps_display_suffix @@ -356,7 +339,6 @@ update_ps_display_precheck(void) void set_ps_display_suffix(const char *suffix) { -#ifndef PS_USE_NONE size_t len; /* first, check if we need to update the process title */ @@ -398,7 +380,6 @@ set_ps_display_suffix(const char *suffix) /* and set the new title */ flush_ps_display(); -#endif /* not PS_USE_NONE */ } /* @@ -408,7 +389,6 @@ set_ps_display_suffix(const char *suffix) void set_ps_display_remove_suffix(void) { -#ifndef PS_USE_NONE /* first, check if we need to update the process title */ if (!update_ps_display_precheck()) return; @@ -426,7 +406,6 @@ set_ps_display_remove_suffix(void) /* and set the new title */ flush_ps_display(); -#endif /* not PS_USE_NONE */ } /* @@ -440,7 +419,6 @@ set_ps_display_with_len(const char *activity, size_t len) { Assert(strlen(activity) == len); -#ifndef PS_USE_NONE /* first, check if we need to update the process title */ if (!update_ps_display_precheck()) return; @@ -466,10 +444,8 @@ set_ps_display_with_len(const char *activity, size_t len) /* Transmit new setting to kernel, if necessary */ flush_ps_display(); -#endif /* not PS_USE_NONE */ } -#ifndef PS_USE_NONE static void flush_ps_display(void) { @@ -506,7 +482,6 @@ flush_ps_display(void) } #endif /* PS_USE_WIN32 */ } -#endif /* not PS_USE_NONE */ /* * Returns what's currently in the ps display, in case someone needs @@ -526,12 +501,7 @@ get_ps_display(int *displen) } #endif -#ifndef PS_USE_NONE *displen = (int) (ps_buffer_cur_len - ps_buffer_fixed_size); return ps_buffer + ps_buffer_fixed_size; -#else - *displen = 0; - return ""; -#endif } -- 2.44.0

view thread (86+ messages)  latest in thread

Message-ID: <2293691d-2adb-4502-b956-73e79dc43c55@technowledgy.de>
Permalink:  ../2293691d-2adb-4502-b956-73e79dc43c55@technowledgy.de/
Also on:    postgresql.org/message-id/2293691d-2adb-4502-b956-73e79dc43c55@technowledgy.de

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: walther@technowledgy.de, bruce@momjian.us, thomas.munro@gmail.com, peter@eisentraut.org, xof@thebuild.com, andrew@dunslane.net, pgsql-bugs@lists.postgresql.org, tgl@sss.pgh.pa.us, robertmhaas@gmail.com
  Subject: Re: Regression tests fail with musl libc because libpq.so can't be loaded
  In-Reply-To: <2293691d-2adb-4502-b956-73e79dc43c55@technowledgy.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox