|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-09-08 17:00 UTC] sbrown at truckstuffusa dot com
Description:
------------
I'm using PHP 4.3.8 in CLI on a Redhat 9 server. Using the FTP functions to backup some files via FTP. The script connects to a server via FTP, downloads some files and tars them up. I'm getting an intermittent segfault during the download process. By "intermittent", I mean that the fault does not occur every time, nor does it occur after downloading the same file every time. I am connecting to a windows-based host if that matters. I have been able to reproduce this crash on two different systems:
================================
System 1:
Redhat 9
PHP 4.3.8 compiled as Apache2 module
SMP-based system
Config.nice: './configure' \
'--with-mysql' \
'--with-apxs2=/pub/apache/bin/apxs' \
'--with-mcrypt=/usr/local/lib' \
'--with-curl=/usr/local' \
'--enable-ftp' \
'--with-imap=/usr/local/imap' \
'--with-jpeg' \
'--with-jpeg-dir=/usr/local/lib' \
'--with-png' \
'--with-png-dir=/usr/local/lib' \
'--with-zlib-dir=/usr/local/lib' \
'--with-gd' \
'--with-freetype' \
'--with-freetype-dir=/usr/local/lib' \
'--with-ttf' \
'--enable-debug' \
"$@"
=====================================
System 2:
Redhat 9
PHP 4.3.8 compiled as Apache2 module
Single CPU
Config.nice: './configure' \
'--with-mysql' \
'--with-apxs2=/pub/apache/bin/apxs' \
'--enable-ftp' \
'--enable-debug' \
"$@"
==========================
When this fault occurs, both systems produce identical backtraces:
Program received signal SIGSEGV, Segmentation fault.
0x4207bb01 in memchr () from /lib/tls/libc.so.6
(gdb) bt
#0 0x4207bb01 in memchr () from /lib/tls/libc.so.6
#1 0x0807ebb0 in ftp_get (ftp=0x8366c4c, outstream=0x83a22f4, path=0x839bcb4 "/x-stuff/ssl/reconcilepo.php", type=FTPTYPE_ASCII, resumepos=0)
at /usr/local/src/php-4.3.8/ext/ftp/ftp.c:730
#2 0x0807bf69 in zif_ftp_get (ht=4, return_value=0x839da54, this_ptr=0x0, return_value_used=1) at /usr/local/src/php-4.3.8/ext/ftp/php_ftp.c:637
#3 0x081ecfb0 in execute (op_array=0x836c920) at /usr/local/src/php-4.3.8/Zend/zend_execute.c:1635
#4 0x081ed22b in execute (op_array=0x836d648) at /usr/local/src/php-4.3.8/Zend/zend_execute.c:1679
#5 0x081ed22b in execute (op_array=0x8366b74) at /usr/local/src/php-4.3.8/Zend/zend_execute.c:1679
#6 0x081d9783 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-4.3.8/Zend/zend.c:891
#7 0x0819e9b7 in php_execute_script (primary_file=0xbffffad0) at /usr/local/src/php-4.3.8/main/main.c:1734
#8 0x081f3e3d in main (argc=2, argv=0xbffffb64) at /usr/local/src/php-4.3.8/sapi/cli/php_cli.c:822
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
Program received signal SIGSEGV, Segmentation fault. 0x4207bae0 in memchr () from /lib/tls/libc.so.6 (gdb) up #1 0x0807ebb0 in ftp_get (ftp=0x8366c4c, outstream=0x83a0fdc, path=0x83991cc "/x-stuff/mir_libraries/lib-htmlMimeMail.php", type=FTPTYPE_ASCII, resumepos=0) at /usr/local/src/php-4.3.8/ext/ftp/ftp.c:730 730 while ((s = memchr(ptr, '\r', (e - ptr)))) { (gdb) p s $1 = 0x83a0ea9 "\r:\b?\016:\b\f" (gdb) p ptr $2 = 0x83a0eaa ":\b?\016:\b\f" (gdb) p e $3 = 0x838be9c "\n\t\t\t\t\t$content_type = $this->image_types[strtolower($ext)];\r\n\t\t\t\t\t$this->addHtmlImage($image, basename($html_images[$i]), $content_type);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n/**\r\n* Adds an image to the list of e"... (gdb)And just in case, here's the bt: (gdb) bt #0 0x4207bae0 in memchr () from /lib/tls/libc.so.6 #1 0x0807ebb0 in ftp_get (ftp=0x8366c4c, outstream=0x83a0fdc, path=0x83991cc "/x-stuff/mir_libraries/lib-htmlMimeMail.php", type=FTPTYPE_ASCII, resumepos=0) at /usr/local/src/php-4.3.8/ext/ftp/ftp.c:730 #2 0x0807bf69 in zif_ftp_get (ht=4, return_value=0x83a0f9c, this_ptr=0x0, return_value_used=1) at /usr/local/src/php-4.3.8/ext/ftp/php_ftp.c:637 #3 0x081ecfb0 in execute (op_array=0x836c920) at /usr/local/src/php-4.3.8/Zend/zend_execute.c:1635 #4 0x081ed22b in execute (op_array=0x836d648) at /usr/local/src/php-4.3.8/Zend/zend_execute.c:1679 #5 0x081ed22b in execute (op_array=0x8366b74) at /usr/local/src/php-4.3.8/Zend/zend_execute.c:1679 #6 0x081d9783 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-4.3.8/Zend/zend.c:891 #7 0x0819e9b7 in php_execute_script (primary_file=0xbffffad0) at /usr/local/src/php-4.3.8/main/main.c:1734 #8 0x081f3e3d in main (argc=2, argv=0xbffffb64) at /usr/local/src/php-4.3.8/sapi/cli/php_cli.c:822 (gdb)Downloaded CVS last night, still get the seg fault: # php --version PHP 4.3.9RC4-dev (cgi) (built: Sep 17 2004 09:19:39) (DEBUG) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies # gdb php (gdb) run script-backup Starting program: /usr/local/bin/php script-backup ... Program received signal SIGSEGV, Segmentation fault. 0x4207bb01 in memchr () from /lib/tls/libc.so.6 (gdb) bt #0 0x4207bb01 in memchr () from /lib/tls/libc.so.6 #1 0x0805eaa8 in ftp_get (ftp=0x81828ac, outstream=0x81a6afc, path=0x81a6604 "/x-stuff/php/dashboard_projectmgmt.php", type=FTPTYPE_ASCII, resumepos=0) at /usr/local/src/php-src/ext/ftp/ftp.c:730 #2 0x0805c141 in zif_ftp_get (ht=4, return_value=0x81a6184, this_ptr=0x0, return_value_used=1) at /usr/local/src/php-src/ext/ftp/php_ftp.c:637 #3 0x0811cb8f in execute (op_array=0x81885b8) at /usr/local/src/php-src/Zend/zend_execute.c:1640 #4 0x0811cdbb in execute (op_array=0x8189310) at /usr/local/src/php-src/Zend/zend_execute.c:1684 #5 0x0811cdbb in execute (op_array=0x81827d4) at /usr/local/src/php-src/Zend/zend_execute.c:1684 #6 0x0810ac19 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-src/Zend/zend.c:891 #7 0x080d6795 in php_execute_script (primary_file=0xbffff0e0) at /usr/local/src/php-src/main/main.c:1735 #8 0x081238cc in main (argc=2, argv=0xbffff184) at /usr/local/src/php-src/sapi/cgi/cgi_main.c:1592 (gdb) up #1 0x0805eaa8 in ftp_get (ftp=0x81828ac, outstream=0x81a6afc, path=0x81a6604 "/x-stuff/php/dashboard_projectmgmt.php", type=FTPTYPE_ASCII, resumepos=0) at /usr/local/src/php-src/ext/ftp/ftp.c:730 730 while ((s = memchr(ptr, '\r', (e - ptr)))) { (gdb) p s $1 = 0x81a6e57 "\n var contacts_win = " (gdb) p ptr $2 = 0x81a6e58 " var contacts_win = " (gdb) p e $3 = 0x81a6c4a "\n<tcus();\r\n}\r\n-->\r\n</script>\r\n<?\r\nif (isset($_GET['publisher']))\r\n echo '<form name=\"frm_deleteprj\" action=\"'.$_SERVER['PHP_SELF'].'?publisher='.$publisher.'\" method=POST>';\r\n elseif (isset($_GET['s"... (gdb)