About phar::compressFiles() and phar::decompressFiles()

From: Date: Mon, 07 Jun 2010 18:44:17 +0000
Subject: About phar::compressFiles() and phar::decompressFiles()
Groups: php.internals 
Request: Send a blank email to internals+get-48674@lists.php.net to get a copy of this message
Hello ! I have a problem with phar in PHP 5.3.2. This is the script : <?php mkdir(__DIR__ . '/files'); file_put_contents(__DIR__ . '/files/file.php', '<?php echo \'' . str_repeat('.', 100) . '\'; ?>'); $phar = new \Phar(__DIR__ . '/compressed.phar'); $phar->buildFromDirectory(__DIR__ . '/files', '/\.php$/'); $phar->setSignatureAlgorithm(\Phar::SHA1); $phar->compressFiles(\Phar::GZ); unlink(__DIR__ . '/files/file.php'); unlink(__DIR__ . '/compressed.phar'); rmdir(__DIR__ . '/files'); ?> When i used it, the result is : fch@witchblade:/usr/home/fch/tmp/phar
php -d phar.readonly=0 generator.php Segmentation fault: 11
The output of gdb is : #0 0x289ba74e in memcpy () from /lib/libc.so.7 [New Thread 28b01140 (LWP 100178)] (gdb) backtrace #0 0x289ba74e in memcpy () from /lib/libc.so.7 Cannot access memory at address 0xbfbfac4c My OS is FreeBSD 8 : FreeBSD witchblade 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5
16:02:27 UTC 2010     root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386
PHP was compiled with configure command './configure' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--enable-libxml' '--with-libxml-dir=/usr/local' '--with-pcre-regex=/usr/local' '--program-prefix=' '--disable-cgi' '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL' '--disable-ipv6' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=i386-portbld-freebsd8.0' Information about phar is : Phar EXT version 2.0.1 Phar API version 1.1.1 SVN revision $Revision: 290435 $ Phar-based phar archives enabled Tar-based phar archives enabled ZIP-based phar archives enabled gzip compression enabled bzip2 compression enabled OpenSSL support enabled I have already done a bug report about phar::decompressFiles() (http://bugs.php.net/bug.php?id=52013) but i want to know if someone has the same problem before doing an another bug report. Best regards, Fred PS : Moreover, phar with files compressed with phar::compressFiles() seems to be not supported by phar.cache_list. -- ======================================================================== Frédéric Hardy : Architecte d'application/Admin. système/Ergonome ========================================================================

« previous php.internals (#48674) next »