ID: 36815 Comment by: judas dot iscariote at gmail dot com Reported By: rd at mesos dot de Status: Open Bug Type: Directory function related Operating System: Linux 2.6.14.5 PHP Version: 5.1.2 New Comment:
cannot be reproduced here (linux/amd64) works perfectly fine with current CVS version. Previous Comments: ------------------------------------------------------------------------ [2006-03-21 17:14:12] rd at mesos dot de what information can I give you else? does this help? server:~ # php4 -i | grep configure <tr><td class="e">Configure Command </td><td class="v"> './configure' '--prefix=/usr/share' '--datadir=/usr/share/php' '--bindir=/usr/bin' '--libdir=/usr/share' '--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' '--with-mysql' '--enable-gd-native-ttf' '--enable-gd-native-tt' '--enable-gd-imgstrttf' '--with-tiff-dir=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr/local' '--with-xpm-dir=/usr/X11R6' '--with-zlib=yes' '--with-bz2' '--with-gmp' '--with-xml' '--with-dom' '--with-ttf' '--with-t1lib' '--with-mcal=/usr' '--with-imap=yes' '--with-sablot' '--with-ftp' '--with-ndbm' '--with-gdbm' '--with-gettext' '--enable-versioning' '--enable-bcmath' '--enable-trans-sid' '--enable-inline-optimization' '--enable-track-vars' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-shmop' '--enable-calendar' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-exif' '--enable-ftp' '--enable-memory-limit' '--enable-wddx' '--enable-filepro' '--enable-dbase' '--enable-ctype' '--disable-debug' '--enable-force-cgi-redirect' '--enable-discard-path' '--enable-sigchild' '--with-gd=yes' '--with-pgsql=/usr' 'i386-suse-linux' '--with-dbm' '--with-freetype-dir' '--with-db' '--with-pdflib=/usr/local' '--with-curl=/usr/local/curl' '--prefix=/usr/local/php' '--enable-xslt' '--with-xslt-sablot' '--with-curl' '--with-iconv' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pspell' '--with-mime-magic' </td></tr> server:~ # php5 -i | grep configure <tr><td class="e">Configure Command </td><td class="v"> './configure' '--prefix=/usr/share' '--datadir=/usr/share/php' '--bindir=/usr/bin' '--libdir=/usr/share' '--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' '--with-mysql=/usr' '--with-gd=yes' '--enable-gd-native-ttf' '--enable-gd-imgstrttf' '--with-tiff-dir=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-ldap=yes' '--with-zlib=yes' '--with-bz2' '--with-gmp' '--with-xml=/usr/local/lib' '--with-dom' '--with-ttf' '--with-mcal=/usr' '--with-imap-ssl=yes' '--with-sablot' '--with-ftp' '--with-ndbm' '--with-gdbm' '--with-mcrypt' '--with-gettext' '--with-gd=yes' '--enable-versioning' '--enable-yp' '--enable-bcmath' '--enable-trans-sid' '--enable-inline-optimization' '--enable-track-vars' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-shmop' '--enable-calendar' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-exif' '--enable-ftp' '--enable-memory-limit' '--enable-wddx' '--enable-filepro' '--enable-dbase' '--enable-ctype' '--enable-debug' '--enable-force-cgi-redirect' '--enable-discard-path' '--enable-sigchild' '--with-db' '--with-dbm' '--with-pdflib' '--with-freetype-dir' '--with-imap' '--with-pspell' '--enable-xslt' '--with-xslt-sablot' '--with-curl' '--with-iconv' '--with-openssl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--with-mime-magic' </td></tr> server:~ # strace -f -s 300 php5 glob.php 2>&1 | tail -n 30 rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0 ioctl(3, TCGETS, 0xbfedebf0) = -1 ENOTTY (Inappropriate ioctl for device) brk(0x87ac000) = 0x87ac000 brk(0x87ae000) = 0x87ae000 read(3, "<?php\r\necho \"Test1\\n\";\r\n$x=glob(\'./img/managed/*\');\r\necho \"Test2\\n\";\r\n?>\r\n", 8192) = 74 read(3, "", 4096) = 0 read(3, "", 8192) = 0 close(3) = 0 munmap(0x40014000, 4096) = 0 write(1, "X-Powered-By: PHP/5.1.2", 23X-Powered-By: PHP/5.1.2) = 23 write(1, "\r\n", 2 ) = 2 write(1, "Content-type: text/html", 23Content-type: text/html) = 23 write(1, "\r\n", 2 ) = 2 write(1, "\r\n", 2 ) = 2 write(1, "Test1\n", 6Test1 ) = 6 open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1 ENOTDIR (Not a directory) open("./img/managed/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3 fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 fcntl64(3, F_SETFD, FD_CLOEXEC) = 0 getdents64(0x3, 0x87ab2c0, 0x1000, 0) = 96 lstat64("./img/managed/1", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 lstat64("./img/managed/2", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 getdents64(0x3, 0x87ab2c0, 0x1000, 0) = 0 close(3) = 0 --- SIGSEGV (Segmentation fault) --- +++ killed by SIGSEGV +++ And here is the part from php4: write(1, "Content-type: text/html", 23Content-type: text/html) = 23 write(1, "\r\n", 2 ) = 2 write(1, "\r\n", 2 ) = 2 write(1, "Test1\n", 6Test1 ) = 6 open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1 ENOTDIR (Not a directory) open("./img/managed", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3 fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 fcntl64(3, F_SETFD, FD_CLOEXEC) = 0 getdents64(0x3, 0x8493bf8, 0x1000, 0x2) = 96 getdents64(0x3, 0x8493bf8, 0x1000, 0x2) = 0 close(3) = 0 write(1, "Test2\n", 6Test2 ) = 6 ------------------------------------------------------------------------ [2006-03-21 16:59:55] [EMAIL PROTECTED] Works pretty fine here. And btw there are 0 differencies between PHP4 glob() and PHP5 glob(). ------------------------------------------------------------------------ [2006-03-21 16:53:40] rd at mesos dot de (gdb) bt #0 0x0826c042 in zif_glob (ht=1, return_value=0x87a6f54, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /usr/src/mesos/php-5.1.2/ext/standard/dir.c:424 #1 0x08322674 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfd84220) at /usr/src/mesos/php-5.1.2/Zend/zend_vm_execute.h:192 #2 0x08321ee9 in execute (op_array=0x87a70a4) at /usr/src/mesos/php-5.1.2/Zend/zend_vm_execute.h:92 #3 0x08308c7a in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/mesos/php-5.1.2/Zend/zend.c:1101 #4 0x082cf698 in php_execute_script (primary_file=0xbfd865c0) at /usr/src/mesos/php-5.1.2/main/main.c:1720 #5 0x083725cb in main (argc=2, argv=0xbfd86664) at /usr/src/mesos/php-5.1.2/sapi/cgi/cgi_main.c:1568 #6 0x407e2522 in __libc_start_main () from /lib/libc.so.6 (gdb) ------------------------------------------------------------------------ [2006-03-21 16:33:25] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. ------------------------------------------------------------------------ [2006-03-21 16:32:04] rd at mesos dot de Description: ------------ glob returns segmentation fault, even with the example from php.net. PHP4 on the same server is working without problem. Reproduce code: --------------- <?php echo "Test1\n"; $x=glob('./img/managed/*'); echo "Test2\n"; ?> Expected result: ---------------- something like: server:~ # php4 glob.php X-Powered-By: PHP/4.4.2 Content-type: text/html Test1 Test2 Actual result: -------------- server:~ # php5 glob.php X-Powered-By: PHP/5.1.2 Content-type: text/html Test1 Segmentation fault ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36815&edit=1