|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-03-21 16:32 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 14:00:01 2025 UTC |
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