#22182 [Com]: apd segfaults with auto_prepend_file
| From: | dholmes at jccc dot net | Date: | Tue, 13 May 2003 20:02:52 +0000 |
| Subject: | #22182 [Com]: apd segfaults with auto_prepend_file | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16221@lists.php.net to get a copy of this message | ||
ID: 22182
Comment by: dholmes at jccc dot net
Reported By: chregu@php.net
Status: Assigned
Bug Type: PEAR related
Operating System: Linux
PHP Version: 4.3.0
Assigned To: gschlossnagle
New Comment:
Don't know why, but adding an exit(0); anywhere AFTER the main loop
gets rid of the segfault. In other words if the file just runs out of
script it segfaults. If it dies with "reason" it's OK. ;-)
I've tried:
Moving all functions to the top.
Adding whitespace AFTER the last ?>
Using adb (in socket mode) to break...step...segfault
changing /usr/bin/env php to /usr/local/bin/php
The only thing I found to work was adding exit(0); to the script. Any
idea why? I can run other things (like that hello world) from cli and
segfault. Hmmm...
P.S. Now that I have played with the breakpoint/echo/continue/
stuff...I LOVE IT!!!
Previous Comments:
------------------------------------------------------------------------
[2003-05-13 10:33:01] dholmes at jccc dot net
I'm getting this as well, but I don't have any auto_prepend_file set.
For example, my hello.php looks like this:
<?php
apd_set_pprof_trace();
print "auto_prepend_file = ";
var_dump(ini_get('auto_prepend_file'));
print "hello world\n";
?>
runnning it gives me:
auto_prepend_file = bool(false)
hello world
Yet, here is my gdb session (as apache module)
(gdb) file /usr/local/bin/php
Reading symbols from /usr/local/bin/php...done.
(gdb) set args ./pprofp -u /tmp/dump_dir/dholmes/pprof.22140
(gdb) run
Starting program: /vol1/local/bin/php ./pprofp -u
/tmp/dump_dir/dholmes/pprof.22140
[New Thread 16384 (LWP 22752)]
Trace for
/vol1/home/dholmes/site_html/www.remote-clean/htdocs/hello.php
Total Elapsed Time = 0.01
Total System Time = 0.00
Total User Time = 0.00
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.0000 0.0000
88 var_dump
100.0 0.01 0.01 0.00 0.00 0.00 0.00 1 0.0000 0.0000
160 ini_get
100.0 0.00 0.00 0.00 0.00 0.00 0.00 1 0.0000 0.0000
0 main
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 22752)]
0x0811a65e in zend_get_executed_lineno () at
/vol1/home/dholmes/build/php-4.3.1/Zend/zend_execute_API.c:269
269 return active_opline->lineno;
(gdb) bt
#0 0x0811a65e in zend_get_executed_lineno () at
/vol1/home/dholmes/build/php-4.3.1/Zend/zend_execute_API.c:269
#1 0x40017dec in apd_execute () from
/usr/local/lib/php/extensions/no-debug-non-zts-20020429/apd.so
#2 0x0811af0f in call_user_function_ex (function_table=0x81788c0,
object_pp=0x0, function_name=0x81fe5dc, retval_ptr_ptr=0xbfffe838,
param_count=0, params=0x81be39c, no_separation=1, symbol_table=0x0)
at /vol1/home/dholmes/build/php-4.3.1/Zend/zend_execute_API.c:557
#3 0x0811aa1f in call_user_function (function_table=0x8178d08,
object_pp=0x0, function_name=0x81fe5dc, retval_ptr=0xbfffe870,
param_count=0,
params=0x81c3090) at
/vol1/home/dholmes/build/php-4.3.1/Zend/zend_execute_API.c:399
#4 0x080a09f8 in user_shutdown_function_call
(shutdown_function_entry=0x81fe764)
at
/vol1/home/dholmes/build/php-4.3.1/ext/standard/basic_functions.c:2013
#5 0x08125e39 in zend_hash_apply (ht=0x81fecbc, apply_func=0x80a09bc
<user_shutdown_function_call>)
at /vol1/home/dholmes/build/php-4.3.1/Zend/zend_hash.c:688
#6 0x080a0c8d in php_call_shutdown_functions () at
/vol1/home/dholmes/build/php-4.3.1/ext/standard/basic_functions.c:2094
#7 0x080fc3bf in php_request_shutdown (dummy=0x0) at
/vol1/home/dholmes/build/php-4.3.1/main/main.c:924
#8 0x08132df5 in main (argc=4, argv=0xbffff054) at
/vol1/home/dholmes/build/php-4.3.1/sapi/cli/php_cli.c:803
#9 0x420158f7 in __libc_start_main () from /lib/i686/libc.so.6
I'm using RH 8.0 and PHP 4.3.1 (custom build, obviously).
I get the same thing when I call it with my cli version of php. (
/usr/local/bin/php -e -f ./hello.php ) I even commented out every line
of my php.in and it still segfaults.
Here is my trace file as well....maybe there is something special about
it?
$ cat pprof.22927
#Pprof [APD] v0.9
hz=100
caller=/vol1/home/dholmes/site_html/www.remote-clean/htdocs/hello.php
END_HEADER
! 1 /vol1/home/dholmes/site_html/www.remote-clean/htdocs/hello.php
& 1 main 2
+ 1 1 2
- 2 20008
& 3 ini_get 1
+ 3 1 4
- 3 20152
& 4 var_dump 1
+ 4 1 4
@ 1 0 0
- 4 20264
- 5 20320
END_TRACE
total_user=1
total_sys=0
total_wall=9
END_FOOTER
All that said...it's still giving me a TON of great info that I didn't
have before. THANKS!!!
------------------------------------------------------------------------
[2003-04-28 03:59:15] arnaud@php.net
changing status (alan got me again ;)
------------------------------------------------------------------------
[2003-04-28 03:41:39] arnaud@php.net
As pointed out by alan, assign to username and not email.
------------------------------------------------------------------------
[2003-04-28 03:22:53] arnaud@php.net
Assigning to georges whois already monitoring it.
------------------------------------------------------------------------
[2003-02-16 10:00:45] chregu@php.net
here we go:
the 2 php files just have
print "hello world";
.htaccess:
php_value auto_prepend_file "config.inc.php"
backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x402a009e in zend_get_executed_lineno ()
at /opt/cvs/php4.3/Zend/zend_execute_API.c:269
269 return active_opline->lineno;
(gdb) bt
#0 0x402a009e in zend_get_executed_lineno ()
at /opt/cvs/php4.3/Zend/zend_execute_API.c:269
#1 0x40315a15 in apd_execute (op_array=0x81851a4)
at /root/tmp/apd-0.4p2/php_apd.c:738
#2 0x402a7a43 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at /opt/cvs/php4.3/Zend/zend.c:925
#3 0x40282588 in php_execute_script (primary_file=0xbffff840)
at /opt/cvs/php4.3/main/main.c:1582
#4 0x402b80be in apache_php_module_main (r=0x817f11c,
display_source_mode=0)
at /opt/cvs/php4.3/sapi/apache/sapi_apache.c:55
#5 0x402b8b03 in send_php (r=0x817f11c, display_source_mode=0,
filename=0x0)
at /opt/cvs/php4.3/sapi/apache/mod_php4.c:610
#6 0x402b8ca2 in send_parsed_php (r=0x817f11c)
at /opt/cvs/php4.3/sapi/apache/mod_php4.c:625
#7 0x08073e79 in ap_invoke_handler ()
#8 0x0808964f in process_request_internal ()
#9 0x080896b6 in ap_process_request ()
#10 0x080800c6 in child_main ()
#11 0x08080281 in make_child ()
#12 0x080803fc in startup_children ()
#13 0x08080a8d in standalone_main ()
#14 0x080812fc in main ()
#15 0x400b29f1 in __libc_start_main () from /lib/libc.so.6
if I do an include in the first php, it works fine.
chregu
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/22182
--
Edit this bug report at http://bugs.php.net/?id=22182&edit=1