Description
ext/pgsql sets a notice processor callback on connection in ext/pgsql/pgsql.c on or around line 820.
When using persistent connections with pg_pconnect, if a notice is received while a connection isn't in use (ie. in the pool), the callback libpg was provided with (_php_pgsql_notice_handler) will attempt to access its parameter link even through it is not valid anymore as it was scoped to the request.
Upon clearing (likely in _rollback_transactions) the notice processor should be set to a no-op handler.
(note: passing NULL to PQsetNoticeProcessor will not do anything except return the previous callback).
PHP Version
PHP 8.4.11 (cli) (built: Aug 12 2025 02:25:03) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.11, Copyright (c) Zend Technologies
with Zend OPcache v8.4.11, Copyright (c), by Zend Technologies
Operating System
Linux
Description
ext/pgsqlsets a notice processor callback on connection inext/pgsql/pgsql.con or around line 820.When using persistent connections with
pg_pconnect, if a notice is received while a connection isn't in use (ie. in the pool), the callback libpg was provided with (_php_pgsql_notice_handler) will attempt to access its parameterlinkeven through it is not valid anymore as it was scoped to the request.Upon clearing (likely in
_rollback_transactions) the notice processor should be set to a no-op handler.(note: passing NULL to
PQsetNoticeProcessorwill not do anything except return the previous callback).PHP Version
Operating System
Linux