php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80992 fork() don't close fpm_globals.listening_socket
Submitted: 2021-04-27 08:02 UTC Modified: 2023-08-26 14:32 UTC
From: vladimir at helesic dot cz Assigned: bukka (profile)
Status: Closed Package: FPM related
PHP Version: Irrelevant OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vladimir at helesic dot cz
New email:
PHP Version: OS:

 

 [2021-04-27 08:02 UTC] 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.






Patches

php-patch.patch (last revision 2021-04-27 08:05 UTC by vladimir at helesic dot cz)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-27 08:05 UTC] 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
 [2023-08-26 14:32 UTC] bukka@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: bukka
 [2023-08-26 14:32 UTC] bukka@php.net
This has been addressed by https://github.com/php/php-src/commit/418cdc0bea3d7787587964f42c309602d70232c6 and will be available in PHP 8.3.0.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC