adsr / phpspy

low-overhead sampling profiler for PHP 7+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some errors occurred when generate frame

lvshuang opened this issue · comments

commented

PHP

PHP 7.1.26-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jan 11 2019 14:13:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.26-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
Linux admin 4.4.0-1072-aws #82-Ubuntu SMP Fri Nov 2 15:00:21 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Command:

./phpspy -l 10000 -p 23465 | ./stackcollapse-phpspy.pl | ./vendor/flamegraph.pl > frame.svg

output:

copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00000003 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x100000000 size=132
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0xffffffff00001c07 size=25
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00000004 size=132
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0x6 size=25
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x800001c07 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00001406 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00000002 size=132
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0x6 size=25
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00000004 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00000c08 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00000003 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00001406 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00000c08 size=132
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0x4effe0000000007f size=25
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x563b00000003 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x4245445f444e455a size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00000c08 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0xa00000001 size=132
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0x7f4f002000 size=25
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0xffffffff00000006 size=25
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0xb42b97e08712010 size=25
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x73 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x563b00000000 size=132
copy_proc_mem: Not copying zfunc; raddr is NULL
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x61775f6c7173796d size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00000001 size=132
copy_proc_mem: Not copying zfunc; raddr is NULL
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0xffe0000000007f4f size=25
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0xe0000000007f4f00 size=25
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0xb42b977c3312010 size=25
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00001c07 size=132
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0xffe0000000007f4f size=25
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x3939646200000c08 size=132
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0xffffffff00000001 size=25
copy_proc_mem: Not copying zfunc; raddr is NULL
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x7f4e00001406 size=132
copy_proc_mem: Failed to copy zfunc; err=Bad address raddr=0x200000c08 size=132
copy_proc_mem: Failed to copy function_name; err=Bad address raddr=0x7f4effe000000000 size=25

Can you try with pause-process (-S) option ?

This is an unavoidable kind of error while the process is not paused, I'm not sure why ATTACH/DETACH is marked unsafe for production, because it would appear to be the only safe way to read process memory.

@adsr can you do input about this ?

commented

@lvshuang Some amount of copy errors is unavoidable as @krakjoe mentioned. Pausing the process should help although I consider it an experimental feature as I haven't tested it much. It is documented as unsafe for production because it will probably slow down the target process.

commented

@adsr Thanks. I found it success even with this errors.