Bug #13652 Updated: ZIP is broken

From: Date: Sat, 13 Oct 2001 15:05:57 +0000
Subject: Bug #13652 Updated: ZIP is broken
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-67887@lists.php.net to get a copy of this message
ID: 13652 Updated by: sniper Reported By: sagi@boom.org.il Old Status: Open Status: Closed Bug Type: ZZiplib Related Operating System: Linux PHP Version: 4.0.6 New Comment: There was a typo..fixed now in CVS. --Jani Previous Comments: ------------------------------------------------------------------------ [2001-10-13 10:37:56] sagi@boom.org.il Latest CVS: gcc -I. -I/usr/local/src/php4/ext/zip -I/usr/local/src/php4/main -I/usr/local/src/php4 -I/usr/local/src/php4/Zend -I/include -I/usr/local/src/php4/ext/mysql/libmysql -I/usr/include/pspell -I/usr/local/src/php4/ext/xml/expat -I/usr/local/src/php4/TSRM -g -O2 -c zip.c && touch zip.lo zip.c: In function `zif_zip_close': zip.c:179: invalid type argument of `unary *' zip.c: In function `zif_zip_entry_open': zip.c:262: warning: assignment makes integer from pointer without a cast make[3]: *** [zip.lo] Error 1 ------------------------------------------------------------------------ [2001-10-13 10:24:02] sniper@php.net This is fixed in CVS. ------------------------------------------------------------------------ [2001-10-12 09:57:17] derick@php.net Let's open this one, and let the other one by the bogus one ------------------------------------------------------------------------ [2001-10-12 09:55:10] sagi@boom.org.il ------------------------------------------------------------------------ [2001-10-12 09:53:25] sagi@boom.org.il Hi, Seems like the ZIP extension is broken in php4.0.6 and php4.0.7-rc3. I just compiled the lastest CVS version and it seems to have the same problem: (example code, taken from the manual): [sagi@domino designs]$ uname -a Linux domino.lan.boom.org.il 2.4.10 #1 Wed Oct 3 10:57:39 IST 2001 i686 unknown [sagi@domino designs]$ php -v 4.0.8-dev [sagi@domino designs]$ cat zip.php <?php $zip = zip_open("/tmp/temp.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); } ?> [sagi@domino designs]$ php zip.php X-Powered-By: PHP/4.0.8-dev Content-type: text/html Ok, entering while.. Segmentation fault [sagi@domino designs]$ The zip file is ok: [sagi@domino dododo]$ unzip /tmp/temp.zip Archive: /tmp/temp.zip creating: yellowbluesagi/ inflating: yellowbluesagi/header.php inflating: yellowbluesagi/footer.php inflating: yellowbluesagi/index.html -- Backtrace: (gdb) run zip.php Starting program: /usr/local/bin/php zip.php X-Powered-By: PHP/4.0.8-dev Content-type: text/html Ok, entering while.. Program received signal SIGSEGV, Segmentation fault. 0x0812b19a in zend_fetch_resource (passed_id=0x81d432c, default_id=-1, resource_type_name=0x816db5e "Zip Directory", found_resource_type=0x0, num_resource_types=1) at zend_list.c:123 123 } else if ((*passed_id)->type != IS_RESOURCE) { (gdb) backtrace #0 0x0812b19a in zend_fetch_resource (passed_id=0x81d432c, default_id=-1, resource_type_name=0x816db5e "Zip Directory", found_resource_type=0x0, num_resource_types=1) at zend_list.c:123 #1 0x0810fb17 in zif_zip_read (ht=1, return_value=0x81d42ec, this_ptr=0x0, return_value_used=1) at zip.c:154 #2 0x081431d7 in execute (op_array=0x81d013c) at ./zend_execute.c:1598 #3 0x081259cc in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:814 #4 0x0806a4a5 in php_execute_script (primary_file=0xbffffa50) at main.c:1310 #5 0x0806809c in main (argc=2, argv=0xbffffaf4) at cgi_main.c:737 #6 0x400f87c7 in __libc_start_main (main=0x80678b8 <main>, argc=2, ubp_av=0xbffffaf4, init=0x8065348 <_init>, fini=0x814b220 <_fini>, rtld_fini=0x4000db74 <_dl_fini>, stack_end=0xbffffaec) at ../sysdeps/generic/libc-start.c:129 (gdb) Sagi ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13652&edit=1

« previous php.dev (#67887) next »