|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-03-02 08:00 UTC] judas dot iscariote at gmail dot com
[2006-03-02 08:45 UTC] tony2001@php.net
[2006-03-10 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
Description: ------------ I'm trying to do stuff recursively on a filesystem. To simplify, call do_path($path) { $dh = opendir($path) ... if (is_dir($file)) { do_path($path . $file); } else { process_file($path . $file); } Of course I'm checking for "." and ".." to prevent infinate loops. proccess_file() loads the file contents and does regex stuff on it. After 4 subdirectories in, and processing about 1000 files, it crashes with a segment fault. I've even tryed manually unsetting all vars after being used, but to no avail. It crashes at the same place in the file system each time. Reproduce code: --------------- Email me. I can't post the code and it's way to large. Expected result: ---------------- All files and directories (within reason) would be processed properly, similar to the way `du' works. Actual result: -------------- Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 9057)] 0x08231e81 in virtual_file_ex (state=0xbfe024a8, path=0x85e1284 "/home/legacy/public_html/gd_temp/Customer Testimonials.psd", verify_path=0, use_realpath=1) at /usr/local/src/php-5.1.2/TSRM/tsrm_virtual_cwd.c:374 374 int path_length = strlen(path); (gdb) bt #0 0x08231e81 in virtual_file_ex (state=0xbfe024a8, path=0x85e1284 "/home/legacy/public_html/gd_temp/Customer Testimonials.psd", verify_path=0, use_realpath=1) at /usr/local/src/php-5.1.2/TSRM/tsrm_virtual_cwd.c:374 #1 0x082396dd in expand_filepath (filepath=0x85e1284 "/home/legacy/public_html/gd_temp/Customer Testimonials.psd", real_path=0x0) at /usr/local/src/php-5.1.2/main/fopen_wrappers.c:529 #2 0x082495f3 in _php_stream_fopen (filename=0x85e1284 "/home/legacy/public_html/gd_temp/Customer Testimonials.psd", mode=0x850efec "rb", opened_path=0x0, options=4) at /usr/local/src/php-5.1.2/main/streams/plain_wrapper.c:855 #3 0x082464a7 in _php_stream_open_wrapper_ex (path=0x85e1284 "/home/legacy/public_html/gd_temp/Customer Testimonials.psd", mode=0x850efec "rb", options=12, opened_path=0x0, context=0x80808000) at /usr/local/src/php-5.1.2/main/streams/streams.c:1771 #4 0x081dd7c3 in php_if_fopen (ht=140382852, return_value=0x88d5da4, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /usr/local/src/php-5.1.2/ext/standard/file.c:840 #5 0x08286d46 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfe03810) at zend_vm_execute.h:192 #6 0x08286658 in execute (op_array=0x84cdf18) at zend_vm_execute.h:92 #7 0x08286b21 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfe041d0) at zend_vm_execute.h:226 #8 0x08286658 in execute (op_array=0x84dcb10) at zend_vm_execute.h:92 #9 0x08286b21 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfe04510) at zend_vm_execute.h:226 #10 0x08286658 in execute (op_array=0x84dd160) at zend_vm_execute.h:92 #11 0x08286b21 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfe04ed0) at zend_vm_execute.h:226 ... zend_do_fcall_common_helper_SPEC()/execute() repeats like this until ... #2497 0x0826e410 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-5.1.2/Zend/zend.c:1101 #2498 0x0823594d in php_execute_script (primary_file=0xbffff9f0) at /usr/local/src/php-5.1.2/main/main.c:1720 #2499 0x082d28bf in main (argc=12, argv=0xbffffa94) at /usr/local/src/php-5.1.2/sapi/cli/php_cli.c:1077