phptrace icon indicating copy to clipboard operation
phptrace copied to clipboard

No such file or directory(2)

Open Gasol opened this issue 8 years ago • 1 comments
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

Gasol avatar Feb 03 '17 02:02 Gasol

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 screenshot

So, could you re-produce it? using these snippets below.

  1. extend whole cost time
php -r 'for ($i = 0; $i < 20; $i++) usleep(50000);' &
phptrace -p $!
  1. 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

monque avatar Mar 04 '17 16:03 monque