Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0

Bug #948 pear freezes on install
Submitted: 2004-03-04 19:28 UTC
From: latchkey Assigned: vblavet
Status: Bogus Package: Archive_Tar
PHP Version: 4.3.7 and 5.0.0RC2 OS: Mac OS X 10.2.8 and 10.3.3
Roadmaps: (Not assigned)    
Subscription  


 [2004-03-04 19:28 UTC] latchkey
Description: ------------ I just did a fresh install of PHP 4.3.4 (up from 4.3.3) and now when I run the 'pear upgrade PACKAGE' command, it freezes up after downloading the package. pear upgrade Console_Getopt downloading Console_Getopt-1.2.tgz ... Starting to download Console_Getopt-1.2.tgz (3,370 bytes) ....done: 3,370 bytes [it just sits there forever without returning] I'm not sure at all how to debug this problem. Any help is appreciated. Note that the apache module which I also installed is running my website just fine, so I know that PHP is working. Here is my phpinfo: phpinfo() PHP Version => 4.3.4 System => Darwin 6.8 Darwin Kernel Version 6.8: Wed Sep 10 15:20:55 PDT 2003; root:xnu/xnu-344.49.obj~2/RELEASE_PPC Power Macintosh Build Date => Mar 4 2004 10:16:43 Configure Command => './configure' '--prefix=/usr/local/php' '--infodir=/usr/local/php/info' '--mandir=/usr/local/php/man' '--with-apxs' '--enable-track-vars' '--with-calendar' '--with-pear' '--with-mysql' '--with-xmlrpc' '--with-jpeg-dir' '--with-gd' '--with-png-dir=/sw' '--with-zlib' '--with-imap=/usr/local/imap-2004.RC6' '--with-gettext=/sw' '--with-xml' Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => /usr/lib/php.ini PHP API => 20020918 PHP Extension => 20020429 Zend Extension => 20021010 Debug Build => no Thread Safety => disabled Registered PHP Streams => php, http, ftp, compress.zlib _______________________________________________________________________ Configuration magic_quotes_gpc = Off include_path = ".:/usr/local/php/lib/php" session.save_path = /var/php session.use_cookies = On register_globals = On upload_tmp_dir = /var/tmp Expected result: ---------------- It should upgrade the package, right? =) Actual result: -------------- http://pear.php.net/bugs/bugs-generating-backtrace.php The requested document /bugs/bugs-generating-backtrace.php was not found on this server.

Comments

 [2004-03-04 20:32 UTC] latchkey
some tracing of the code reveals that this is a problem with the installation of Archive_Tar as the code is never making it past PEAR/Common.php at this line: $content = $tar->listContent(); That is the reason for the freeze. Now, I'm not sure why Archive_Tar is failing. It looks like I have version 1.1 installed.
 [2004-03-04 20:49 UTC] latchkey
ok, it seems that the problem is an endless loop in Archive_Tar/Tar.php::_extractList() The While loop that is in there is never ending for some reason. The loop is more complicated than I care to try to debug myself. Hopefully someone with experience with this code will try it out and figure it out. I'm changing the category to Archive_Tar to reflect this bug in that package instead.
 [2004-04-28 13:18 UTC] vblavet
Can you please give me the zlib version of the environment ? I suspect this is linked to gzip functions.
 [2004-04-28 18:18 UTC] latchkey
thank you so much for looking into this. fink info zlib Information about 2646 packages read in 6 seconds. zlib-1.1.4-1: Compression library . Maintainer: Max Horn <max@quendi.de>
 [2004-04-29 05:23 UTC] kueda at wso dot williams dot edu
I'm experiencing exactly the same problem (Mac OS 10.3.3, PHP 4.3.5, ZLib 1.1.4). I've tried running `pear upgrade-all` and `pear install Tree` and both give me the same hang.
 [2004-05-07 18:41 UTC] latchkey
I just upgraded to zlib 1.2.1 (and re-compiled PHP 4.3.6) and the problem still exists.
 [2004-05-07 19:06 UTC] latchkey
this problem exists on OSX 10.3.3, 5.0.0RC2, zlib 1.2.1 how is it that anyone has pear working for them?
 [2004-06-10 19:09 UTC] latchkey
I tried manually upgrading to Archive 1.2 (by copying the Tar.php file over the existing Tar.php file) and this problem still exists. A fix for this issue would be great!
 [2004-07-09 07:39 UTC] pnijsters at cistron dot nl
I have a workaround for Mac OS X, this works fine for me: pear download <package> gzip -d <package filename> pear install <package> So the problem is related to zlib/Archive_tar but if you manually decompress you can at least install the packages you need. Upgrading Archive_Tar to 1.2 didn't solve the problem....
 [2004-07-11 20:26 UTC] gurugeek
Dear Maintainer, Your package Archive_Tar has currently 2 open bugs. We urge you to take the necessary steps to solve the reported issues at your soonest convenience. If the bug issue hasn’t been addressed yet you are kindly asked to take the necessary steps to ensure a prompt resolution of the problem. If you already addressed the reported problem feel free to change the bug status as soon as possible. Regards David Costa PEAR Quality Assurance pear-qa@lists.php.net
 [2005-02-22 11:07 UTC] ralph at cs dot cf dot ac dot uk
This bug is a show-stopper on MacOS X, yet is still here nearly a year later. It seems no-one is maintaining this package. Can it be reassigned to someone else?
 [2005-02-22 13:29 UTC] latchkey
this bug no longer seems to exist on OSX 10.3.8 with php 5.0.3
 [2005-02-23 12:39 UTC] ralph at cs dot cf dot ac dot uk
It exists for me with PHP 5.0.3 and 10.3.8. Maybe you changed something else?
 [2005-03-04 22:34 UTC] vblavet
I really don't know where the pb is ... May be in the _jumpBlock function, where I do a gzseek() ... I add some code to improve the _jumpBlock(). It can be found in last CVS release Tar.php v.1.26. (http://cvs.php.net/co.php/pear/Archive_Tar/Archive/Tar.php?r=1.26&p=1) Can you please replace your current Tar.php file in $PHP_ROOT/PEAR/Archive with the CVS one, and retry a upgrade command ? I also see problem with the zlib, but it was on the gzwrite() function on Debian. To be sure of the zlib, can you test the following PHP script, and send me the result (loop or "OK Done !") : <?php $fd = gzopen('temp.gz', 'wb9'); for ($i=0; $i<5000; $i++) gzwrite($fd, "hello world !"); gzclose($fd); $fd = gzopen('temp.gz', 'rb'); while (strlen($v_binary_data = gzread($fd, 512)) != 0) { } gzclose($fd); echo "OK Done !"; ?> Thanks
 [2005-03-04 23:01 UTC] latchkey
Ok, I think I have a MUCH more clear idea of what the problem might be. I have two machines. Both running OSX 10.3.8. Both with zlib 1.2.2 compiled into /usr/local/lib. On one machine, it was compiled as a shared library. On the other machine it was not. On the machine that was compiled NOT as a shared library (only a static .a file in /usr/local/lib), your little script would not complete. On the machine that it was compiled as a shared library, I get 'OK Done!' I then recompiled zlib as a shared library on the machine with the problem. (./configure --shared) When I recompiled an already compiled PHP 5.0.3 on the same machine by only doing: cd phpsrc/ext/zlib rm *.o *.lo cd ../.. make I re-run your script on the problem machine and now your script works. I guess the problem has to do entirely with how the library is compiled. Thanks for your time and patience with this confusing issue.
 [2005-03-05 09:07 UTC] vblavet
Sorry, but your problem does not imply a bug in PEAR itself. For a list of more appropriate places to ask for help using PEAR, please visit http://pear.php.net/support/ as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PEAR. Thanks for the clue. I close this bug. I will also remove the debugging code I had in the last CVS version.
 [2005-03-11 14:05 UTC] ralph at cs dot cf dot ac dot uk
How did you configure zlib as a shared library? There is no "configure" file in phpsrc/ext/zlib.
 [2005-03-11 17:14 UTC] latchkey
You are thinking of the PHP wrapper around zlib. I'm talking about the actual zlib project source code. Go to: http://www.zlib.net/ You probably need to be root on your system to be able to follow these instructions. You will also need Apple's developer tools installed. I'm assuming you have both these requirements. Download the latest version of the tar.gz file to /usr/local/src/zlib. Right now, that is 1.2.2. http://www.zlib.net/zlib-1.2.2.tar.gz Then on the command line type: cd /usr/local/src/zlib tar -xzf zlib-1.2.2.tar.gz cd zlib-1.2.2 ./configure --prefix=/usr/local --shared make make install By default, for some reason, the --shared flag is not set on the zlib installation. Then, when you build PHP, add the following flag to configure: --with-zlib=/usr/local Apple still distributes 1.1.3 of zlib in /usr/lib which is bad because there is potential security holes in that version according to the zlib website. You don't want to use that version. Hope that helps. jon
 [2005-06-11 07:31 UTC] timmerk at comcast dot net
Same problem with php 5.1 b1 and os x 10,4,1. in 10.4.1, zlib 1.2.2 is included, but not compiled as a shared library. once you do that and point php to the new library, everything works, including pear! so, this might be a bug for php (not working with static zlib), and/or zlib, and/or apple (compile as a shared library?)
 [2005-07-08 21:29 UTC] matt at kanchi dot org
I experienced this as well, as has every other OS X user who's tried to install or upgrade a package, I'm sure. It's a showstopping bug (you can't do ANYTHING with Pear until it's fixed), so at the very least there should be a check. If your zlib version is compiled statically, Pear should notify you that you must recompile it as shared. And for people trying to Google this: pear install upgrade stalls hangs freezes
 [2005-12-20 23:08 UTC] richard at d2p dot us
I'm having this problem and can't get past it. OS X: 10.4.3 PHP: 4.4.1 gcc: 4.0 Build info: Darwin ti.local 8.3.0 Darwin Kernel Version 8.3.0: Mon Oct 3 20:04:04 PDT 2005; root:xnu-792.6.22.obj~2/RELEASE_PPC Power Macintosh './configure' '--shared' '--enable-debug' '--enable-fastcgi' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--infodir=/usr/share/info' '--enable-gd-native-ttf' '--with-ttf' '--with-openssl' '--with-regex=system' '--enable-sockets' '--with-pear=/usr/bin/pear' '--with-mysql=shared,/usr' '--with-unixODBC=shared' '--with-xml' '--with-zlib=/usr/local' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-mysql=/usr/local/mysql' '--with-config-file-path=/etc/php.ini' '--with-apxs=/usr/sbin/apxs' I ran vincent's script (2005-03-04 22:34) and it came back "OK Done !" So, I decided to download the latest zlib (1.2.3) and configure it as latchkey (jon) noted (with the prefix and --shared). make sudo make install Still can't pear install. Ugh. Any ideas? Can I provide any other information about my builds? I deperately need to install some Pear stuff, if anyone has any ideas - would be greatly appreciated. Thanks. Richard.
 [2005-12-20 23:16 UTC] richard at d2p dot us
I can, of course add packages by doing them one-by-one, which makes my 'desperate'status not so desperate, but I still have no idea what's going on with this issue an would greatly appreciate the help. thanks, R
 [2007-06-20 19:18 UTC] asherwolf (Asher Wolfstein)
Below is a link to a manual fix to this problem that's pure PHP in case you are not savvy enough to adjust your compilation configurations, compile zlib, don't have access, etc. It replaces _jumpBlock gzseek with a gzread loop that appears to work in most cases. It also goes over what files you may need to install and adjust if your initial installation also hung. If one can't use go-pear.phar for any reason I have provided an alternative manual fix for this problem http://www.asherwolf.com/projects/php/pear/index.html. You can direct questions about this possible fix to me at asher AT asherwolf DOT com.