ID: 21847 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Reproducible crash Operating System: linux-2.4.20 PHP Version: 4.3.0 New Comment:
Still crashes with optmiser disabled but no core dump now, last string printed is corrupt. Previous Comments: ------------------------------------------------------------------------ [2003-01-24 02:28:50] [EMAIL PROTECTED] This is the URL for the file, I will try switching off the optimiser and run again. http://www.draper.co.uk/files/United%20Kingdom2002.txt ------------------------------------------------------------------------ [2003-01-23 19:18:36] [EMAIL PROTECTED] Could you please provide the draper.txt so that the bug can be replicated. As is I cannot replicate the crash, merely get an error opening the specified image URL. Also, does the crash occur if you disable ZendOptimizer? ------------------------------------------------------------------------ [2003-01-23 13:02:30] [EMAIL PROTECTED] When running the following code php core dumps. <? // Read the draper txt file $fp=fopen("draper.txt","r"); $good=fopen("draper_good.txt","w"); $bad=fopen("draper_bad.txt","w"); while(!feof($fp)) { $fields=split(",",fgets($fp)); $url="http://www.drapertools.com/draper/images/details/".trim($fields[1])."_".trim($fields[2]).".jpg"; $outfile="draper_images/draper_".trim($fields[1])."_".trim($fields[2]).".jpg"; print("opening $url\n"); ob_flush(); if($urlfp=fopen($url,"rb")) { print("Outputing to $outfile\n"); if($imagefp=fopen($outfile,"wb")) { print($url." -> ".$outfile."\n"); ob_flush(); fputs($good,$url." -> ".$outfile."\n"); $size=0; while(!feof($urlfp)) { $block=fread($urlfp,4096); fputs($imagefp,$block); $size+=4096; print($url." -> ".$outfile." : $size\n"); }; fclose($imagefp); }; fclose($urlfp); } else { fputs($bad,$url."\n"); }; }; fclose($fp); fclose($good); fclose($bad); ?> The input file is a comma delimited list, we are interested in the filename which we then retrieve from the site (you can find the names by going to the site or by downloading the text file from the site). Just recompiled with debug, here is the backtrace: #0 0x08153650 in php_hostconnect (host=0x82ef62c "www.drapertools.com", port=80, socktype=1, timeout=0x0) at /usr/src/php-4.3.0/main/network.c:435 #1 0x08153900 in _php_stream_sock_open_host (host=0x82ef62c "www.drapertools.com", port=80, socktype=1, timeout=0x0, persistent_id=0x0) at /usr/src/php-4.3.0/main/network.c:619 #2 0x0811a497 in php_stream_url_wrap_http (wrapper=0x82491f0, path=0x82ed5c4 "http://www.drapertools.com/draper/images/details/002_770-SA.jpg", mode=0x82e97cc "rb", options=4, opened_path=0x0, context=0x0) at /usr/src/php-4.3.0/ext/standard/http_fopen_wrapper.c:121 #3 0x08152d2c in _php_stream_open_wrapper_ex (path=0x82ed5c4 "http://www.drapertools.com/draper/images/details/002_770-SA.jpg", mode=0x82e97cc "rb", options=12, opened_path=0x0, context=0x0) at /usr/src/php-4.3.0/main/streams.c:2378 #4 0x080e915a in php_if_fopen (ht=2, return_value=0x82ee5ac, this_ptr=0x0, return_value_used=1) at /usr/src/php-4.3.0/ext/standard/file.c:1094 #5 0x404f78f0 in zend_oe () from /usr/local/Zend/lib/ZendOptimizer.so #6 0x404f43a0 in zend_oe () from /usr/local/Zend/lib/ZendOptimizer.so #7 0x0816f14c in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/php-4.3.0/Zend/zend.c:864 #8 0x08148909 in php_execute_script (primary_file=0xbffffb40) at /usr/src/php-4.3.0/main/main.c:1573 #9 0x08190f48 in main (argc=2, argv=0xbffffbe4) at /usr/src/php-4.3.0/sapi/cli/php_cli.c:746 #10 0x40342657 in __libc_start_main (main=0x81905c8 <main>, argc=2, ubp_av=0xbffffbe4, init=0x806fe60 <_init>, fini=0x8196790 <_fini>, rtld_fini=0x4000dcd4 <_dl_fini>, stack_end=0xbffffbdc) at ../sysdeps/generic/libc-start.c:129 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21847&edit=1
