From:             youza at post dot cz
Operating system: Fedora Core 4
PHP version:      4.4.4
PHP Bug Type:     FTP related
Bug description:  ftp_get - coredump

Description:
------------
The ftp_get file transfer generate core dump -

[notice] child pid 5999 exit signal Segmentation fault (11), possible
coredump in /usr/tmp

after reloading WWW this file transfered, but next reload
generate new core dump etc....

php =  4.4.4
apache = httpd-2.0.54-10.4 (fedora RPM)



Reproduce code:
---------------
$ftp_server = 'my_server';
$ftp_user_name = 'my_name';
$ftp_user_pass = 'my_pass';

// define some variables
$local_file = 'test_l.dat';
$server_file = 'test.dat';

// set up basic connection
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// try to download $server_file and save to $local_file
$res = ftp_get($conn_id, $local_file, $server_file, FTP_BINARY);
if ($res) {
    echo "<br>Successfully written to $local_file\n";
} else {
    echo "<br>There was a problem\n";
}

// close the connection
ftp_close($conn_id);

Expected result:
----------------
Transfer the files.



Actual result:
--------------
gdb /usr/lib/debug/usr/sbin/httpd.debug /usr/tmp/core.5999 

..


#0  0x00ff32f4 in ?? () from /etc/httpd/modules/libphp4.so
(gdb) bt
#0  0x00ff32f4 in ?? () from /etc/httpd/modules/libphp4.so
#1  0x01028920 in zif_ftp_get (ht=4, return_value=0xad4d0cc, this_ptr=0x0,
return_value_used=1)
    at /usr/src/debug/php-4.4.4/ext/ftp/php_ftp.c:648
#2  0x010ffb85 in execute (op_array=0xad48c8c) at
/usr/src/debug/php-4.4.4/Zend/zend_execute.c:1675
#3  0x010e6139 in zend_execute_scripts (type=8, retval=Variable "retval"
is not available.
) at /usr/src/debug/php-4.4.4/Zend/zend.c:934
#4  0x010b72f5 in php_execute_script (primary_file=0xbfc36408) at
/usr/src/debug/php-4.4.4/main/main.c:1752
#5  0x0110576e in php_handler (r=0xad417f8) at
/usr/src/debug/php-4.4.4/sapi/apache2handler/sapi_apache2.c:596
#6  0x002fde8c in ap_run_handler (r=0xad417f8) at
/usr/src/debug/httpd-2.0.54/server/config.c:157
#7  0x002fe227 in ap_invoke_handler (r=0xad417f8) at
/usr/src/debug/httpd-2.0.54/server/config.c:369
#8  0x002fad6b in ap_process_request (r=0xad417f8) at
/usr/src/debug/httpd-2.0.54/modules/http/http_request.c:249
#9  0x002f5683 in ap_process_http_connection (c=0xad3b5b0) at
/usr/src/debug/httpd-2.0.54/modules/http/http_core.c:251
#10 0x00308a2b in ap_run_process_connection (c=0xad3b5b0) at
/usr/src/debug/httpd-2.0.54/server/connection.c:43
#11 0x00308d60 in ap_process_connection (c=0xad3b5b0, csd=0xad3b4d8) at
/usr/src/debug/httpd-2.0.54/server/connection.c:176
#12 0x002fbcfe in child_main (child_num_arg=Variable "child_num_arg" is
not available.
) at /usr/src/debug/httpd-2.0.54/server/mpm/prefork/prefork.c:610
#13 0x002fbfba in make_child (s=0x9cc9e88, slot=24) at
/usr/src/debug/httpd-2.0.54/server/mpm/prefork/prefork.c:704
#14 0x002fc090 in startup_children (number_to_start=6) at
/usr/src/debug/httpd-2.0.54/server/mpm/prefork/prefork.c:722
#15 0x002fca52 in ap_mpm_run (_pconf=0x9cc80a8, plog=0x9cf4158,
s=0x9cc9e88)
    at /usr/src/debug/httpd-2.0.54/server/mpm/prefork/prefork.c:941
#16 0x0030377e in main (argc=2, argv=0xbfc368b4) at
/usr/src/debug/httpd-2.0.54/server/main.c:619

frame 2
#2  0x010ffb85 in execute (op_array=0xad48c8c) at
/usr/src/debug/php-4.4.4/Zend/zend_execute.c:1675
1675                                                           
((zend_internal_function *)
EX(function_state).function)->handler(EX(opline)->extended_value,
EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr,
return_value_used TSRMLS_CC);

(gdb) print (char
*)(executor_globals.function_state_ptr->function)->common.function_name
$1 = 0x110efc5 "ftp_get"

(gdb) print (char *)executor_globals.active_op_array->function_name
$2 = 0x0



-- 
Edit bug report at http://bugs.php.net/?id=39883&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39883&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39883&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39883&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39883&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39883&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39883&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39883&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39883&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39883&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39883&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39883&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39883&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39883&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39883&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39883&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39883&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39883&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39883&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39883&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39883&r=mysqlcfg

Reply via email to