ID: 23196
User updated by: dave at socrates dot thinkhost dot com
Reported By: dave at socrates dot thinkhost dot com
Status: Open
Bug Type: CGI related
Operating System: FreeBSD 4.8-STABLE
PHP Version: 4.3.2RC2
New Comment:
> Also:
> /path/to/cgibinary/php -f /path/to/phpinfo.php
As I already mentioned, it works fine from the shell, this problem only
occurs when the execution is called by suexec.
I can call the script directly (since it has executable perms) like
so:
./info.php
and like so:
/usr/local/bin/php -f ./info.php
both work fine, but not when called by suexec (Apache).
> Can you type the following in gdb:
> frame 2
> followed by:
> info local
(gdb) bt
#0 0x81901de in _estrdup (s=0x0) at
/usr/local/src/php-4.3.2RC2/Zend/zend_alloc.c:363
#1 0x81b24e5 in init_request_info () at
/usr/local/src/php-4.3.2RC2/sapi/cgi/cgi_main.c:709
#2 0x81b2b57 in main (argc=30, argv=0xbfbff4e8) at
/usr/local/src/php-4.3.2RC2/sapi/cgi/cgi_main.c:1238
#3 0x808cb56 in _start ()
(gdb) frame 2
#2 0x81b2b57 in main (argc=30, argv=0xbfbff4e8) at
/usr/local/src/php-4.3.2RC2/sapi/cgi/cgi_main.c:1238
1238 init_request_info(TSRMLS_C);
(gdb) info local
orig_bailout = {{_jb = {0 <repeats 12 times>}}}
exit_status = 0
cgi = 1
c = 0
i = 30
len = 137233484
file_handle = {type = 100 'd',
filename = 0xbfbff4e8
"Dö¿¿Iö¿¿Rö¿¿eö¿¿\210ö¿¿\032÷¿¿=÷¿¿X÷¿¿s÷¿¿\220÷¿¿æ÷¿¿7ø¿¿Kø¿¿rø¿¿\221ø¿¿©ø¿¿ºø¿¿ëø¿¿\005ù¿¿*ù¿¿Mù¿¿\\ù¿¿¸ù¿¿0ú¿¿Nú¿¿hú¿¿\201ú¿¿\224ú¿¿¢ú¿¿Àú¿¿",
opened_path = 0x0, handle = {fd = 674015744, fp = 0x282caa00},
free_filename = 224 'à'}
retval = -1
s = 0x82e044c "÷\a"
behavior = 1
no_headers = 0
orig_optind = 1
orig_optarg = 0x0
script_file = 0x0
global_vars = {head = 0x282b0aab, tail = 0x282c9240, size = 0, count =
3217028236, dtor = 0x282b0a47 <_rtld_bind+59>, persistent = 30 '\036',
traverse_ptr = 0xbfbff4e8}
(gdb)
This is strange, it doesn't occur on any of the other production
machines at work (which are all 4.8-STABLE as well). It also works fine
on my personal server (4.8-RC). However, I can get it to work on the
"problem" machine when I compile from the 4.3.1 or earlier source tree.
Previous Comments:
------------------------------------------------------------------------
[2003-05-06 13:35:51] msopacua at idg dot nl
Can't reproduce this with 4.8-STABLE and how did you ever get an argc
of 30?
Can you type the following in gdb:
frame 2
followed by:
info local
Also:
/path/to/cgibinary/php -f /path/to/phpinfo.php
should give you an argc of three, where argv[2] should be the filename
and argv[3] should be NULL (check by print argv[2] and print argv[3]
respectively).
------------------------------------------------------------------------
[2003-05-06 11:27:07] dave at socrates dot thinkhost dot com
I have tried the new PHP-4.3.2RC2 source, and the problem still
persists, here is the back trace from the PHP CGI binary built from the
PHP-4.3.2RC2 source tree:
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libcrypt.so.2...done.
Reading symbols from /usr/local/lib/libmcal.so...done.
Reading symbols from /usr/local/lib/libc-client4.so.8...done.
Reading symbols from /usr/local/lib/libexpat.so.4...done.
Reading symbols from /usr/local/lib/libpq.so.2...done.
Reading symbols from /usr/local/lib/libpdf.so.4...done.
Reading symbols from /usr/lib/libz.so.2...done.
Reading symbols from /usr/local/lib/libtiff.so.4...done.
Reading symbols from /usr/local/lib/libpng.so.5...done.
Reading symbols from /usr/local/lib/libjpeg.so.9...done.
Reading symbols from /usr/local/lib/mysql/libmysqlclient.so.10...done.
Reading symbols from /usr/local/lib/libming.so.3...done.
Reading symbols from /usr/lib/libm.so.2...done.
Reading symbols from /usr/local/lib/libmhash.so.2...done.
Reading symbols from /usr/local/lib/libmcrypt.so.8...done.
Reading symbols from /usr/local/lib/libltdl.so.1...done.
Reading symbols from /usr/local/lib/libldap.so.2...done.
Reading symbols from /usr/local/lib/liblber.so.2...done.
Reading symbols from /usr/lib/libpam.so.1...done.
Reading symbols from /usr/local/lib/libintl.so.4...done.
Reading symbols from /usr/local/lib/libgd.so.2...done.
Reading symbols from /usr/local/lib/libfreetype.so.9...done.
Reading symbols from /usr/local/lib/libcurl.so.2...done.
Reading symbols from /usr/local/lib/libxml2.so.5...done.
Reading symbols from /usr/local/lib/libiconv.so.3...done.
Reading symbols from /usr/lib/libc.so.4...done.
Reading symbols from /usr/lib/libssl.so.3...done.
Reading symbols from /usr/lib/libcrypto.so.3...done.
Reading symbols from /usr/local/lib/libssl.so.3...done.
Reading symbols from /usr/local/lib/libcrypto.so.3...done.
Reading symbols from /usr/local/lib/libssl.so.4...done.
Reading symbols from /usr/local/lib/libcrypto.so.4...done.
Reading symbols from /usr/local/Zend/lib/ZendOptimizer.so...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0 0x81901de in _estrdup (s=0x0) at
/usr/local/src/php-4.3.2RC2/Zend/zend_alloc.c:363
363 length = strlen(s)+1;
(gdb) bt
#0 0x81901de in _estrdup (s=0x0) at
/usr/local/src/php-4.3.2RC2/Zend/zend_alloc.c:363
#1 0x81b24e5 in init_request_info () at
/usr/local/src/php-4.3.2RC2/sapi/cgi/cgi_main.c:709
#2 0x81b2b57 in main (argc=30, argv=0xbfbff5ec) at
/usr/local/src/php-4.3.2RC2/sapi/cgi/cgi_main.c:1238
#3 0x808cb56 in _start ()
(gdb) quit
------------------------------------------------------------------------
[2003-04-30 07:19:25] dave at socrates dot thinkhost dot com
Relevant lines from httpd.conf:
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
mod_gzip_item_include file \.php$
mod_gzip_item_include mime ^application/x-httpd-php
------------------------------------------------------------------------
[2003-04-30 07:17:12] dave at socrates dot thinkhost dot com
This is the CGI, so there is no httpd.conf config that affects it.
The crash below was produced from a very simple script:
<?php
phpinfo();
?>
------------------------------------------------------------------------
[2003-04-30 06:21:27] sniper@php.net
how did you configure it in httpd.conf?
what query crashes it?
------------------------------------------------------------------------
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/23196
--
Edit this bug report at http://bugs.php.net/?id=23196&edit=1