phptrace
phptrace copied to clipboard
No such file or directory(2)
trafficstars
Hi, I'm ports maintainer of pecl-trace 1, I has been updated phptrace to 1.0.0 and encounter this problem.
Run commands described in README as following show error message like ERROR: Invalid process id "54000" "No such file or directory(2)"
But it's ok with phptrace -p all
php -r 'for ($i = 0; $i < 10; $i++) usleep(10000);' &
phptrace -p $!
OS
$ uname -a
FreeBSD beastie 10.3-RELEASE-p11 FreeBSD 10.3-RELEASE-p11 #0: Mon Oct 24 18:49:24 UTC 2016 [email protected]:/usr/obj/usr/src/sys/GENERIC amd64
PHP
$ php -v
PHP 5.6.30 (cli) (built: Jan 21 2017 01:16:05)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans
$ php -m
[PHP Modules]
Core
ctype
curl
date
dom
ereg
filter
hash
imagick
intl
jq
json
JsonNet
libxml
mbstring
mecab
mhash
mysql
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
sockets
SPL
standard
tokenizer
trace
uuid
vld
xdebug
xml
zlib
[Zend Modules]
Xdebug
Try it on the lastest FreeBSD, works as expected.
Uname
$uname -a
FreeBSD freebsd.shiva.arena.mo47.com 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 01:43:23 UTC 2016 [email protected]:/usr/obj/usr/src/sys/GENERIC amd64
Screenshot

So, could you re-produce it? using these snippets below.
- extend whole cost time
php -r 'for ($i = 0; $i < 20; $i++) usleep(50000);' &
phptrace -p $!
- Specified pid
php -r 'for ($i = 0; $i < 100000; $i++) { usleep(50000); echo getmypid()."\n"; }'
# PID will be displayed by PHP, and phptrace -p $pid