Re: PHP 4.0.4 Lockup
| From: | Zak Greant | Date: | Fri, 22 Dec 2000 18:10:02 +0000 |
| Subject: | Re: PHP 4.0.4 Lockup | ||
| References: | 1 2 3 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-2031@lists.php.net to get a copy of this message | ||
Could someone complile the latest CVS version of PHP on Win32 and test to
see if the error has disappeared? I will build on Mandrake and test. Anyone
else who has a spare moment is welcome to build and test as well. :)
Also, any thoughts on what a good regression test for this problem would
be? Writing a test that checks the output of
var_dump (get_class_methods ('directory'));
is simple enough. I don't know if this test represents the problem that
well - perhaps someone who has a clearer understanding of what Zeev did
could make some suggestions!
It looks like the change that affects this bug is in Zend/zend_hash.c near
line 1032:
*str_index = (char *) estrndup(p->arKey, p->nKeyLength);
was changed to:
*str_index = estrndup(p->arKey, p->nKeyLength);
If I am right, does anyone know why not casting the result of estrndup to
a pointer to a character would fix the problem?
Zak "What to you mean I have to learn the *whole* alphabet, I can't even
make it past C..." Greant
Zeev Suraski wrote:
> I've solved this problem in the CVS.
> It appears as the whole get_current_key() implementation kinda sucks right
> now, and most of the code that uses it doesn't use it correctly anyway.
> I want to change get_current_key() so that it doesn't duplicate the key,
> but return a pointer to the bucket inside the hash (perhaps with an
> optional argument to duplicate it). In many cases, you don't need a
> replica of the key, and all you'd do is free it a couple of lines after
you
> obtained it. BTW, lots of code right now doesn't free it, and leaks.
>
> Zeev
>
> At 10:02 22/12/2000, Zak Greant wrote:
> >The error happens on my Win2k box running PHP 4.0.4, but not on my
Mandrake
> >7.1 box running the latest CVS version.
> >
> >I will build 4.0.4 on my mandrake box and test again.
> >
> >Perhaps it is Win32 specific? Is anyone out there running an older
version
> >of PHP under Windows - if so, could you try the following simple script:
> >
> ><?php get_class_methods ('directory'); ?>
> >
> >If it does not crash, we can probably point our fingers at the change
made
> >in revision 1.78 of zend_builtin_functions.c - was the windows binary
made
> >with the most recent version of the Zend files? Revision 1.80 of
> >zend_builtin_functions.c is tagged as php_4_0_4, but perhaps there was a
> >mistake?
> >
> >If it does crash on older versions of Win32, but not on my mandrake box,
> >then I am guessing that it is a Win32 problem.
> >
> >
> >Zak "Grasping @ Straws" Greant
> >
> >Zak Greant wrote:
> > > Hello Steven,
> > >
> > > Thanks for the error report.
> > >
> > > The error can be reproduced with just
> > > get_class_methods ('Directory');
> > >
> > > I would guess that the problem occurs because Directory is not quite a
> > > class - or at least, something is screwed up with it.
> > >
> > > Do you want to submit a full bug report (go to bugs.php.net and read
the
> > > instructions).
> > > I will take a look at the code that generates the class and see if I
can
> > > figure anything out.
> > >
> > > --zak
> > >
> > >
> > > ----- Original Message -----
> > > From: "Steven Roussey" <sroussey@network54.com>
> > > To: <php-general@lists.php.net>
> > > Cc: <php-dev@lists.php.net>
> > > Sent: Thursday, December 21, 2000 11:39 PM
> > > Subject: [PHP-DEV] PHP 4.0.4 Lockup
> > >
> > >
> > > > When I have php 4.0.4 compiled in --with-dom and run this:
> > > >
> > > > <PRE>
> > > > <?
> > > > phpinfo();
> > > > $them = get_declared_classes ();
> > > > foreach ($them as $one) {
> > > > echo("\n\n$one\n");
> > > > print_r (get_class_methods ($one));
> > > > }
> > > > ?>
> > > > </PRE>
> > > >
> > > > If will lock up. It even locks up my browser too!! Comment out the
> >print_r
> > > > and all is fine. Leave out --with-dom and all is fine as well.
> > > >
> > > >
> > > > Sincerely,
> > > >
> > > > Steven Roussey
> > > > Network54.com
> > > > http://network54.com/?pp=e
> > > >
> > > >
> > > > --
> > > > PHP Development Mailing List
> > > > <http://www.php.net/>
> > > > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> > > > For additional commands, e-mail: php-dev-help@lists.php.net
> > > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> > > >
> > >
> > >
> > > --
> > > PHP Development Mailing List
> > > <http://www.php.net/>
> > > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-dev-help@lists.php.net
> > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> > >
> >
> >
> >--
> >PHP Development Mailing List <http://www.php.net/>
> >To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> >For additional commands, e-mail: php-dev-help@lists.php.net
> >To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
> --
> Zeev Suraski <zeev@zend.com>
> CTO & co-founder, Zend Technologies Ltd.
> http://www.zend.com/
>
>
> --
> PHP Quality Assurance Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-qa-unsubscribe@lists.php.net
> For additional commands, e-mail: php-qa-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>