php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65394 Extra anon_inode:[eventfd] in forked processes
Submitted: 2013-08-05 14:50 UTC Modified: 2013-08-05 14:58 UTC
From: bugs dot php dot net at ss dot chernousov dot net Assigned:
Status: Not a bug Package: eio (PECL)
PHP Version: 5.5.1 OS: Gentoo Linux
Private report: No CVE-ID: None
 [2013-08-05 14:50 UTC] bugs dot php dot net at ss dot chernousov dot net
Description:
------------
If pecl-eio extension is loaded, each forked child process has one more 
anon_inode:[eventfd] than parent process, even if eio_* functions were never used 
in the script.


Test script:
---------------
<?php

passthru('ls -1l /proc/' . posix_getpid() . '/fd/');

$pid = pcntl_fork();
if ( $pid == 0 ) {
	passthru('ls -1l /proc/' . posix_getpid() . '/fd/');

	$pid = pcntl_fork();
	if ( $pid == 0 ) {
		passthru('ls -1l /proc/' . posix_getpid() . '/fd/');

		$pid = pcntl_fork();
		if ( $pid == 0 ) {
			passthru('ls -1l /proc/' . posix_getpid() . '/fd/');
		}
	}
}


Expected result:
----------------
total 0
lrwx------ 1 root root 64 Aug  5 10:49 0 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 1 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 2 -> /dev/pts/4
lr-x------ 1 root root 64 Aug  5 10:49 3 -> pipe:[87952]
total 0
lrwx------ 1 root root 64 Aug  5 10:49 0 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 1 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 2 -> /dev/pts/4
lr-x------ 1 root root 64 Aug  5 10:49 4 -> pipe:[84897]
total 0
lrwx------ 1 root root 64 Aug  5 10:49 0 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 1 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 2 -> /dev/pts/4
lr-x------ 1 root root 64 Aug  5 10:49 5 -> pipe:[84898]
total 0
lrwx------ 1 root root 64 Aug  5 10:49 0 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 1 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 2 -> /dev/pts/4
lr-x------ 1 root root 64 Aug  5 10:49 6 -> pipe:[84899]


Actual result:
--------------
total 0
lrwx------ 1 root root 64 Aug  5 10:49 0 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 1 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 2 -> /dev/pts/4
lr-x------ 1 root root 64 Aug  5 10:49 3 -> pipe:[87952]
total 0
lrwx------ 1 root root 64 Aug  5 10:49 0 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 1 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 2 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 3 -> anon_inode:[eventfd]
lr-x------ 1 root root 64 Aug  5 10:49 4 -> pipe:[84897]
total 0
lrwx------ 1 root root 64 Aug  5 10:49 0 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 1 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 2 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 3 -> anon_inode:[eventfd]
lrwx------ 1 root root 64 Aug  5 10:49 4 -> anon_inode:[eventfd]
lr-x------ 1 root root 64 Aug  5 10:49 5 -> pipe:[84898]
total 0
lrwx------ 1 root root 64 Aug  5 10:49 0 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 1 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 2 -> /dev/pts/4
lrwx------ 1 root root 64 Aug  5 10:49 3 -> anon_inode:[eventfd]
lrwx------ 1 root root 64 Aug  5 10:49 4 -> anon_inode:[eventfd]
lrwx------ 1 root root 64 Aug  5 10:49 5 -> anon_inode:[eventfd]
lr-x------ 1 root root 64 Aug  5 10:49 6 -> pipe:[84899]


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-05 14:58 UTC] osmanov@php.net
-Status: Open +Status: Not a bug
 [2013-08-05 14:58 UTC] osmanov@php.net
It's not a bug. Eio is designed to be re-initialized for each forked process.
Eio uses "eventfd" for internal IPC with libeio.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC