php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56180 Segmentation fault with "pear config-" commands
Submitted: 2004-08-26 20:48 UTC Modified: 2004-08-27 03:13 UTC
From: waltzer at autumnweave dot com Assigned: derick (profile)
Status: Closed Package: Xdebug
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2004-08-26 20:48 UTC] waltzer at autumnweave dot com
Description:
------------
PHP Version is actually 5.0.1 (not listed in the drop down)
PEAR Version is 1.3.2 (Installed by PHP 5.0.1)

Description:
NOTE: This was originally being entered as a PEAR bug, when I discovered that the fault goes away if the Xdebug package is uninstalled and returns when re-installed. This is not currently entered as a PEAR bug (in case you come to the determination that it belongs there).

The PEAR comands "config-get", "config-set" and "config-show" all produce segmentation faults when ran. All other pear commands seem to work fine (including "config-help").

After setting '$_debug = TRUE' in PEAR.php the last report before the fault is "PEAR constructor called, class=PEAR_Command_Config".

With echo commands I traced it to the method 'doConfigGet' within class 'PEAR_Command_Config'. The exact line is:

'if ($error = $this->_checkLayer(@$params[1])) {'

An echo statement as the first line within the method "_checkLayer" does not output, nor do echo statements from any of the possible branches from the 'if' statement.

PHP configure-line:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-force-cgi-redirect --enable-discard-path --disable-short-tags --with-config-file-path=/usr/local/apache2/conf --with-zlib --with-bz2 --with-openssl=/usr/local/ssl --with-curl=/usr/local/curl --with-curlwrappers --with-xsl --enable-sockets --enable-ftp --with-gmp --with-mcrypt --with-mhash --without-sqlite --with-mysql=/usr/local/mysql --with-mysql-sock=/var/mysql/mysql.sock --with-db4 --enable-exif --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-ttf --with-freetype-dir --enable-gd-native-ttf --with-gettext --with-pspell

PEAR Packages Installed:
Package        Version State
Archive_Tar    1.2     stable
Benchmark      1.2.1   stable
Console_Getopt 1.2     stable
PEAR           1.3.2   stable
PHPUnit2       2.0.1   stable
XML_RPC        1.1.0   stable
xdebug         1.3.2   stable

gdb Backtrace:
Starting program: /usr/local/bin/php /usr/local/lib/php/pearcmd.php config-get data_dir
PEAR constructor called, class=PEAR_Frontend_CLI
PEAR constructor called, class=PEAR_Command_Build
BEGIN function PEAR_Command_Config("", "")
PEAR constructor called, class=PEAR_Command_Config
END function PEAR_Command_Config("", "")
PEAR constructor called, class=PEAR_Command_Install
PEAR constructor called, class=PEAR_Command_Package
PEAR constructor called, class=PEAR_Command_Registry
PEAR constructor called, class=PEAR_Command_Remote
PEAR constructor called, class=PEAR_Command_Mirror
PEAR constructor called, class=PEAR_Command_Auth
PEAR constructor called, class=PEAR_Config
BEGIN function PEAR_Command_Config("Object id #1", "Object id #10")
PEAR constructor called, class=PEAR_Command_Config
END function PEAR_Command_Config("Object id #1", "Object id #10")
BEGIN function doConfigGet("config-get", "Array", "Array")
Test 1 /usr/local/lib/php/PEAR/Command/Config.php:142

Program received signal SIGSEGV, Segmentation fault.
0x40a01d22 in xdebug_build_fname (tmp=0x89e65a8, edata=0xbfff7c80) at /tmp/tmpBetqXp/xdebug-1.3.2/xdebug.c:539
539     /tmp/tmpBetqXp/xdebug-1.3.2/xdebug.c: No such file or directory.
        in /tmp/tmpBetqXp/xdebug-1.3.2/xdebug.c
(gdb) bt
#0  0x40a01d22 in xdebug_build_fname (tmp=0x89e65a8, edata=0xbfff7c80) at /tmp/tmpBetqXp/xdebug-1.3.2/xdebug.c:539
#1  0x40a01f4f in add_stack_frame (zdata=0xbfff7c80, op_array=0x833e830, type=0)
    at /tmp/tmpBetqXp/xdebug-1.3.2/xdebug.c:625
#2  0x40a024e0 in xdebug_execute (op_array=0x833e830) at /tmp/tmpBetqXp/xdebug-1.3.2/xdebug.c:786
#3  0x0819376e in zend_call_function (fci=0xbfff7cf0, fci_cache=0x0)
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute_API.c:835
#4  0x081930dd in call_user_function_ex (function_table=0x0, object_pp=0x0, function_name=0x0, retval_ptr_ptr=0x0, 
    param_count=0, params=0x0, no_separation=0, symbol_table=0x0)
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute_API.c:550
#5  0x0819c772 in zend_error (type=8, format=0x81e03be "Undefined offset:  %ld")
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend.c:975
#6  0x081bf62e in zend_fetch_dimension_address_inner (ht=0x89a9f94, op2=0x8641128, Ts=0xbfff7eb0, type=0)
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute.c:824
#7  0x081b639a in zend_fetch_dimension_address (result=0x8641100, op1=0x89a300c, op2=0x8641128, Ts=0xbfff7eb0, type=0)
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute.c:946
#8  0x081b8966 in zend_fetch_dim_r_handler (execute_data=0xbfff86a0, opline=0x86410fc, op_array=0x863ba34)
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute.c:2064
#9  0x081b749b in execute (op_array=0x863ba34) at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute.c:1400
#10 0x40a02582 in xdebug_execute (op_array=0x863ba34) at /tmp/tmpBetqXp/xdebug-1.3.2/xdebug.c:825
#11 0x081ba54d in zend_do_fcall_common_helper (execute_data=0xbfff9010, opline=0x84d0908, op_array=0x864a20c)
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute.c:2737
#12 0x081ba81c in zend_do_fcall_by_name_handler (execute_data=0x0, opline=0x84d0908, op_array=0x864a20c)
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute.c:2822
#13 0x081b749b in execute (op_array=0x864a20c) at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute.c:1400
#14 0x40a02582 in xdebug_execute (op_array=0x864a20c) at /tmp/tmpBetqXp/xdebug-1.3.2/xdebug.c:825
#15 0x081ba54d in zend_do_fcall_common_helper (execute_data=0xbfffbae0, opline=0x8330190, op_array=0x831b2ac)
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute.c:2737
#16 0x081ba81c in zend_do_fcall_by_name_handler (execute_data=0x0, opline=0x8330190, op_array=0x831b2ac)
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute.c:2822
#17 0x081b749b in execute (op_array=0x831b2ac) at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend_execute.c:1400
#18 0x40a02582 in xdebug_execute (op_array=0x831b2ac) at /tmp/tmpBetqXp/xdebug-1.3.2/xdebug.c:825
#19 0x0819ca89 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /usr/local/src/webnew/apache2/php-5.0.1/Zend/zend.c:1061
#20 0x0816ba4b in php_execute_script (primary_file=0xbfffe2f0)
    at /usr/local/src/webnew/apache2/php-5.0.1/main/main.c:1627
#21 0x081c1c06 in main (argc=4, argv=0xbfffe374) at /usr/local/src/webnew/apache2/php-5.0.1/sapi/cli/php_cli.c:943
#22 0x42015967 in __libc_start_main () from /lib/i686/libc.so.6



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-27 03:13 UTC] derick@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

This is already fixed in the latest Xdebug CVS.
And please file Xdebug related bugreports at http://bugs.xdebug.org.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Dec 05 02:03:34 2021 UTC