Bug #80992 [Opn->Csd]: fork() don't close fpm_globals.listening_socket

From: Date: Sat, 26 Aug 2023 14:32:01 +0000
Subject: Bug #80992 [Opn->Csd]: fork() don't close fpm_globals.listening_socket
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245252@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80992&edit=1 ID: 80992 Updated by: bukka@php.net Reported by: vladimir at helesic dot cz Summary: fork() don't close fpm_globals.listening_socket -Status: Open +Status: Closed Type: Bug Package: FPM related Operating System: linux PHP Version: Irrelevant -Assigned To: +Assigned To: bukka Block user comment: N Private report: N New Comment: This has been addressed by https://github.com/php/php-src/commit/418cdc0bea3d7787587964f42c309602d70232c6 and will be available in PHP 8.3.0. Previous Comments: ------------------------------------------------------------------------ [2021-04-27 08:05:01] vladimir at helesic dot cz The following patch has been added/updated: Patch Name: php-patch.patch Revision: 1619510701 URL: https://bugs.php.net/patch-display.php?bug=80992&patch=php-patch.patch&revision=1619510701 ------------------------------------------------------------------------ [2021-04-27 08:02:10] vladimir at helesic dot cz Description: ------------ When we use php fpm with listening on tcp port, and run other long running subprocess by proc_open, this process have also open socket for listening, after restart fpm, this socket stay listening by this process and can't start with classic "ERROR: unable to bind listening socket for address 'port number': Address already in use" We found that problem is in missing FD_CLOEXEC flag for this socket(after dup()). after setting this flag, all is ok. patch is below and simple and applicable for all version php. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80992&edit=1

« previous php.bugs (#245252) next »