Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vPWDp-005Jak-2Y for pgpool-general@arkaria.postgresql.org; Sun, 30 Nov 2025 01:27:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vPWDm-00Fn96-2z for pgpool-general@arkaria.postgresql.org; Sun, 30 Nov 2025 01:27:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vPWDm-00Fn8z-2B for pgpool-general@lists.postgresql.org; Sun, 30 Nov 2025 01:27:27 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vPWDk-002GSK-1q for pgpool-general@lists.postgresql.org; Sun, 30 Nov 2025 01:27:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=Fc23WfkoaST2e+0DHHySlIu77Uutm18FsrxA8TRMHeg=; b=3jkinIER3w2vf12RbmrKnItxeC rhnw5EGpepa/nuXo5RdyO/H7uN6qvTp56O9cn9rFOLNAbCKpacdnT30FLu5k+4wNtOG9kUQ8Brh/m CRZbP4lN0OXOzDpEzf95IBwaHwEKZDXb2BWtUvf2gt/4RJyUG7oTUCXptaZ1WdEHZyPELpuQftzJ3 X2WEXvXH7teopq0/NhrwVgKOCx1ItaYQAVmIVbLoJ/08+sI3R0rkobJTFv4VI4Y1uma5mITzrYz9U cigwgC0sLU9LMDqUHTydwzP5TmpKo4qEWFWpESSJHUvbSSHO+6vxQDFPvja8m8LAz3FPY8hZ7KVFU qZYyw93w==; Received: from [2409:11:4120:300:62c6:8cfc:c228:d228] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vPWDh-005Sw6-1j; Sun, 30 Nov 2025 01:27:24 +0000 Date: Sun, 30 Nov 2025 10:27:12 +0900 (JST) Message-Id: <20251130.102712.131456481338876013.ishii@postgresql.org> To: zam6ak@gmail.com Cc: pgpool-general@lists.postgresql.org Subject: Re: "buffer overflow detected" when running SHOW POOL_STATUS From: Tatsuo Ishii In-Reply-To: References: X-Mailer: Mew version 6.8 on Emacs 29.3 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Sun_Nov_30_10_27_12_2025_594)--" Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:62c6:8cfc:c228:d228 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Sun_Nov_30_10_27_12_2025_594)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, Thank you for the report! Unfortunately, I was not able to reproduce the issue on my Ubuntu 24 and Rocky Linux 10.1 box (pgpool is compiled from source code). So there are some questions: - Is the issue occurred even when you execute other pgpool command? (for example "show pool_processes") - I found a problem with the output of "show pool_status". The value of "memqcache_stats_start_time" is shown with newline and an empty item followed. I am not sure if this is related to your issue. If possible, can you please try the attached patch? Best regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp > Hello > > I am using the latest pgpool-II v4.6.4 on Rocky Linux v10.1 > (installation via RPMs) with PostgreSQL 18 (one primary, one replica, > streaming replication) > When attempting to run POOL_STATUS command, either as SQL or via pcp, > I am getting "buffer overflow detected" in the log. > Here are the contents of the log from both SQL and pcp commands: > > 1) > sudo -u postgres pcp_pool_status -w -v -h localhost -p 9898 -U postgres > > 2025-11-27 13:30:19.298 [4486]: [3-1] user=[No Connection],db=[No > Connection],app=pcp_main LOG: forked new pcp worker, pid=4495 > socket=7 > 2025-11-27 13:30:19.298 [4486]: [4-1] user=[No Connection],db=[No > Connection],app=pcp_main LOCATION: pcp_child.c:327 > *** buffer overflow detected ***: terminated > 2025-11-27 13:30:20.315 [4486]: [5-1] user=[No Connection],db=[No > Connection],app=pcp_main LOG: PCP process with pid: 4495 exits with > status 134 by signal 6 > 2025-11-27 13:30:20.315 [4486]: [6-1] user=[No Connection],db=[No > Connection],app=pcp_main LOCATION: pcp_child.c:394 > > 2) > sudo -u postgres psql -w -h localhost -p 9999 -U postgres -c "SHOW POOL_STATUS" > > 2025-11-27 13:31:34.385 [4390]: [1-1] > user=postgres,db=postgres,app=psql LOG: DB node id: 0 backend pid: > 10166 statement: SELECT pg_catalog.version() > 2025-11-27 13:31:34.385 [4390]: [2-1] > user=postgres,db=postgres,app=psql LOCATION: > pool_proto_modules.c:3803 > *** buffer overflow detected ***: terminated > > > > And here is my pgpool.conf file (only changed lines - diff compared to > pgpool.conf.sample) > diff --unchanged-line-format= --old-line-format= > --new-line-format='%L' pgpool.conf.sample pgpool.conf > > listen_addresses = '*' > unix_socket_directories = '/var/run/pgpool' > pcp_socket_dir = '/var/run/pgpool' > serialize_accept = on > backend_hostname0 = '192.168.68.104' > backend_port0 = 5432 > backend_weight0 = 1 > backend_data_directory0 = '/data/pgdata/18' > backend_flag0 = 'ALWAYS_PRIMARY' > backend_application_name0 = 'primary' > backend_hostname1 = '192.168.68.105' > backend_port1 = 5432 > backend_weight1 = 1 > backend_data_directory1 = '/data/pgdata/18' > backend_flag1 = 'DISALLOW_TO_FAILOVER' > backend_application_name1 = 'replica_1' > num_init_children = 96 > max_pool = 2 > child_life_time = 0 > log_line_prefix = '%m [%p]: [%l-1] user=%u,db=%d,app=%a ' # > printf-style string to output at beginning of each log line. > log_connections = off > log_disconnections = off > log_per_node_statement = on > log_standby_delay = 'always' > log_error_verbosity = verbose # terse, default, or verbose messages > log_filename = 'pgpool-01-%a.log' > write_function_list = > 'currval,lastval,nextval,setval,public.upgrade_.*,upgrade_.*,public.update_.*,update_.*,public.selsert_.*,selsert_.*,public.purge_.*,purge_.*,public.process_.*,process_.*,public.move_.*,move_.*,public.merge_.*,merge_.*,public.mark_.*,mark_.*,billing.can_ahs_claim_charge,billing.can_ahs_apply_.*' > statement_level_load_balance = on > sr_check_period = 5s > sr_check_user = 'pgpool_monitor' > delay_threshold_by_time = 500ms > health_check_period = 10 > health_check_timeout = 30 > health_check_user = 'pgpool_monitor' > health_check_max_retries = 10 > failover_on_backend_error = off > check_temp_table = trace > > ----Next_Part(Sun_Nov_30_10_27_12_2025_594)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pool_status.patch" diff --git a/src/utils/pool_process_reporting.c b/src/utils/pool_process_reporting.c index e4fcf4457..9e677d95e 100644 --- a/src/utils/pool_process_reporting.c +++ b/src/utils/pool_process_reporting.c @@ -1117,6 +1117,8 @@ get_config(int *nrows) StrNCpy(status[i].name, "memqcache_stats_start_time", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", ctime(&pool_get_memqcache_stats()->start_time)); + /* remove a newline added by ctime() */ + *(strchrnul(status[i].value, '\n')) = '\0'; StrNCpy(status[i].desc, "Start time of query cache stats", POOLCONFIG_MAXDESCLEN); i++; ----Next_Part(Sun_Nov_30_10_27_12_2025_594)----