Bug #15654 Updated: PHP crashes using the zip functions
| From: | derick@php.net | Date: | Mon, 08 Apr 2002 05:27:36 +0000 |
| Subject: | Bug #15654 Updated: PHP crashes using the zip functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-4304@lists.php.net to get a copy of this message | ||
ID: 15654
Updated by: derick@php.net
Reported By: leigh@cfgn.net
-Status: No Feedback
+Status: Closed
Bug Type: ZZiplib Related
Operating System: Mandrake Linux 8.1
PHP Version: 4.1.1
New Comment:
This should be fixed too, I commited a fix the 6th.
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-04-08 00:00:06] php-bugs@lists.php.net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2002-03-07 02:51:42] lobbin@php.net
I can't reproduce this with current CVS, and latest zziplib (0.10.27).
I tried your zipfile aswell.
Can you try a snapshop from http://snaps.php.net and see if you
still
have this crash?
-- robin
------------------------------------------------------------------------
[2002-02-21 00:58:44] leigh@cfgn.net
The zip functions in PHP4.1.1 appears to be causing PHP to crash with a
segmentation fault. When using it in my project I get a "document
contains no data".
I borrowed the script used in a previous bug report.
<?php
$zip = zip_open("test_zip.zip");
if ($zip) {
echo "Ok, entering while..\n";
while ($zip_entry = zip_read($zip)) {
echo "In while..\n";
echo "Name: " .
zip_entry_name($zip_entry) . "\n";
echo "Actual Filesize: " .
zip_entry_filesize($zip_entry) . "\n";
echo "Compressed Size: " .
zip_entry_compressedsize($zip_entry) . "\n";
echo "Compression Method: " .
zip_entry_compressionmethod($zip_entry) . "\n";
if (zip_entry_open($zip, $zip_entry, "r")) {
echo "File Contents:\n";
$buf = zip_entry_read($zip_entry,
zip_entry_filesize($zip_entry));
echo "$buf\n";
zip_entry_close($zip_entry);
}
echo "\n";
}
zip_close($zip);
}
?>
[leigh@eden debug]$ php-debug ./test.php
X-Powered-By: PHP/4.1.1
Content-type: text/html
Ok, entering while..
Segmentation fault (core dumped)
The Backtrace:
(gdb) bt
#0 0x08115b82 in zend_fetch_resource (passed_id=0x81af524,
default_id=-1, resource_type_name=0x8155d4c "Zip Directory",
found_resource_type=0x0,
num_resource_types=1) at zend_list.c:123
#1 0x080f86a3 in zif_zip_read (ht=1, return_value=0x81af4e4,
this_ptr=0x0, return_value_used=1) at zip.c:154
#2 0x0812e14a in execute (op_array=0x81ab324) at
./zend_execute.c:1590
#3 0x0810fe90 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at zend.c:814
#4 0x08065355 in php_execute_script (primary_file=0xbffff790) at
main.c:1307
#5 0x08062e4c in main (argc=2, argv=0xbffff834) at cgi_main.c:738
#6 0x4033f5b0 in __libc_start_main () from /lib/libc.so.6
(gdb)
The zip was created using the zip.lib.php library used in phpMyAdmin
but the zip does work and the error still occurs when a zip is created
using the zip command on linux.
[leigh@eden debug]$ unzip test_zip.zip
Archive: test_zip.zip
inflating: install/module_info.php
inflating: modules/test.php
The zip file I used can be downloaded from:
http://www.sitebox.org/test_zip.zip
I used zziplib-0.10.27 to compile PHP with zip support.
My configure script:'./configure' \
'--disable-static' \
'--enable-debug' \
'--disable-rpath' \
'--enable-pic' \
'--enable-inline-optimization' \
'--prefix=/usr' \
'--with-zlib' \
'--with-config-file-path=/etc' \
'--enable-magic-quotes' \
'--enable-debugger' \
'--enable-track-vars' \
'--enable-safe-mode' \
'--with-regex=system' \
'--with-versioning' \
'--enable-sysvsem' \
'--enable-sysvshm' \
'--with-mod_charset' \
'--enable-force-cgi-redirect' \
'--enable-trans-sid' \
'--with-dbase' \
'--with-filepro' \
'--enable-yp' \
'--enable-ftp' \
'--with-xml' \
'--with-gettext' \
'--with-mysql=/usr' \
'--with-pgsql' \
'--with-ldap' \
'--with-interbase=/opt/interbase' \
'--with-zip=/usr/local' \
"$@"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15654&edit=1