|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-06-29 09:09 UTC] wim dot heirman at elis dot ugent dot be
Description: ------------ When executing a simple script containing just "<?php apd_set_pprof_trace(); ?>", PHP/APD segfaults. GDB output: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1209042048 (LWP 1308)] 0x08168f15 in zend_get_executed_lineno () (gdb) bt #0 0x08168f15 in zend_get_executed_lineno () #1 0x001139ad in log_time () at /tmp/tmp2zspMp/apd-1.0.1/php_apd.c:424 #2 0x00113a38 in trace_function_exit (fname=0x8ba4f5c "main") at /tmp/tmp2zspMp/apd-1.0.1/php_apd.c:399 #3 0x00113c37 in apd_execute (op_array=0x8ba8cec) at /tmp/tmp2zspMp/apd-1.0.1/php_apd.c:519 #4 0x08173aba in zend_execute_scripts () #5 0x0813e7e0 in php_execute_script () #6 0x081a859e in main () In contrast to bug #3383, `PHP -v` works OK here and gives: PHP 5.0.4 (cli) (built: May 9 2005 11:21:11) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies with Advanced PHP Debugger (APD) v0.9, , by George Schlossnagle I'm using APD-1.0.1 and PHP-5.0.4. Reproduce code: --------------- echo "<?php apd_set_pprof_trace(); ?>"|php Expected result: ---------------- Segmentation fault PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 13:00:01 2025 UTC |
This still seems to be a problem. Can't get it to work on a standard Ubuntu 7.10 installation. $ php -r "apd_set_pprof_trace();" Segmentation fault (core dumped) $ php --version PHP 5.2.3-1ubuntu6.3 (cli) (built: Jan 10 2008 09:38:37) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies with Advanced PHP Debugger (APD) v0.9, , by George SchlossnagleSame here, with or without PHP's DEBUG mode: zend_extension_debug=/usr/lib/php5/20060613-debug/apd.so apd.dumpdir=. PHP 5.2.5-3caraldi2 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 10 2008 10:31:46) (DEBUG) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies with Advanced PHP Debugger (APD) v0.9, , by George Schlossnagle with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans Program terminated with signal 11, Segmentation fault. [New process 11112] #0 0x0000000000740572 in zend_get_executed_lineno () at /home/jbq/packages/php5-debug/Zend/zend_execute_API.c:394 394 return active_opline->lineno; (gdb) bt #0 0x0000000000740572 in zend_get_executed_lineno () at /home/jbq/packages/php5-debug/Zend/zend_execute_API.c:394 #1 0x00007f11b9fd50bc in log_time () at /tmp/pear/cache/apd-1.0.1/php_apd.c:424 #2 0x00007f11b9fd5675 in trace_function_exit (fname=0x1193710 "require_once") at /tmp/pear/cache/apd-1.0.1/php_apd.c:399 #3 0x00007f11b9fd648f in apd_execute (op_array=0x1a0f468) at /tmp/pear/cache/apd-1.0.1/php_apd.c:519 #4 0x00007f11b9da503c in xdebug_execute (op_array=0x1a0f468) at /tmp/pear/cache/xdebug-2.0.3/xdebug.c:1541 #5 0x0000000000784660 in ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER (execute_data=Cannot access memory at address 0x8000c5820f98 ) at /home/jbq/packages/php5-debug/Zend/zend_vm_execute.h:2039 #6 0x000000000077c972 in execute (op_array=Cannot access memory at address 0x8000c5821128 ) at /home/jbq/packages/php5-debug/Zend/zend_vm_execute.h:92 #7 0x00007f11b9fd6487 in apd_execute (op_array=0xf89598) at /tmp/pear/cache/apd-1.0.1/php_apd.c:518 #8 0x00007f11b9da503c in xdebug_execute (op_array=0xf89598) at /tmp/pear/cache/xdebug-2.0.3/xdebug.c:1541 #9 0x0000000000784660 in ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER (execute_data=Cannot access memory at address 0x8000c58212d8 ) at /home/jbq/packages/php5-debug/Zend/zend_vm_execute.h:2039 #10 0x000000000077c972 in execute (op_array=Cannot access memory at address 0x8000c5821a58 ) at /home/jbq/packages/php5-debug/Zend/zend_vm_execute.h:92 #11 0x00007f11b9fd6487 in apd_execute (op_array=0x1a0e2e8) at /tmp/pear/cache/apd-1.0.1/php_apd.c:518 #12 0x00007f11b9da503c in xdebug_execute (op_array=0x1a0e2e8) at /tmp/pear/cache/xdebug-2.0.3/xdebug.c:1541 #13 0x000000000077d10b in zend_do_fcall_common_helper_SPEC (execute_data=Cannot access memory at address 0x8000c5821c20 ) at /home/jbq/packages/php5-debug/Zend/zend_vm_execute.h:234 #14 0x000000000077ddfc in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=Cannot access memory at address 0x8000c5821c98 ) at /home/jbq/packages/php5-debug/Zend/zend_vm_execute.h:322 #15 0x000000000077c972 in execute (op_array=Cannot access memory at address 0x8000c5821e88 ) at /home/jbq/packages/php5-debug/Zend/zend_vm_execute.h:92 #16 0x00007f11b9fd6487 in apd_execute (op_array=0xf87c98) at /tmp/pear/cache/apd-1.0.1/php_apd.c:518 #17 0x00007f11b9da503c in xdebug_execute (op_array=0xf87c98) at /tmp/pear/cache/xdebug-2.0.3/xdebug.c:1541 #18 0x0000000000752e02 in zend_execute_scripts (type=Cannot access memory at address 0x8000c582205c ) at /home/jbq/packages/php5-debug/Zend/zend.c:1215 #19 0x00000000006f1f00 in php_execute_script (primary_file=Cannot access memory at address 0x8000c58231c8 ) at /home/jbq/packages/php5-debug/main/main.c:2025 #20 0x00000000007e4339 in main (argc=Cannot access memory at address 0x8000c58243fc ) at /home/jbq/packages/php5-debug/sapi/cli/php_cli.c:1146Just add exit(0); in the end of the code and it should work. The result of the profiler is stored under /tmp/ pprofp -R /tmp/pprof.XXX.0 //Where XXX is job id 1. Code: <?php apd_set_pprof_trace(); print "hello world\n"; exit(0); ?> 2. Than did: ll /tmp/ And found the last pprof.XXX.0 file Mine was: pprof.32764.0 3. pprofp -R /tmp/pprof.32764.0 Result: Real User System secs/ cumm %Time (excl/cumm) (excl/cumm) (excl/cumm) Calls call s/call Memory Usage Name ------------------------------------------------------------ -------------------------- 100.0 0.00 0.00 0.00 0.00 0.00 0.00 1 0.0004 0.0004 1572864000 apd_set_pprof_trace 100.0 0.00 0.00 0.00 0.00 0.00 0.00 1 0.0000 0.0004 0 main