RE: [PHP-CVS] com php-src: Fixed Bug #69823 (PHP 7.0.0alpha1 segmentation fault when exactly 33 extensions are loaded): NEWS ext/hash/hash.c
| From: | Anatol Belski | Date: | Sun, 14 Jun 2015 10:22:09 +0000 |
| Subject: | RE: [PHP-CVS] com php-src: Fixed Bug #69823 (PHP 7.0.0alpha1 segmentation fault when exactly 33 extensions are loaded): NEWS ext/hash/hash.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-87255@lists.php.net to get a copy of this message | ||
Yeah, same here https://bugs.php.net/bug.php?id=69820 . Thanks for
the fix, Hui. My exact insight is, that when some module is loaded "inbetween", it
corrupts the complete module_registry. If we still need to emulate mhash, maybe we should go through
the php_register_extensions_bc() routines, so adding it in SAPIs.
Thanks
Anatol
> -----Original Message-----
> From: Xinchen Hui [mailto:laruence@php.net]
> Sent: Sunday, June 14, 2015 6:34 AM
> To: Sara Golemon; php-cvs@lists.php.net
> Subject: Re: [PHP-CVS] com php-src: Fixed Bug #69823 (PHP 7.0.0alpha1
> segmentation fault when exactly 33 extensions are loaded): NEWS
> ext/hash/hash.c
>
> Hey Sara:
>
> Since you are the author of hash. could you please look into this ?
>
> I am not sure why you register a empty(no functions, no startup, only minfo)
> module while doing hash startup...
>
> I remove it for fixing a segfault.. is there anything I missed.?
>
> thanks
>
> On Sun, Jun 14, 2015 at 12:28 PM, Xinchen Hui <laruence@php.net> wrote:
> > Commit: dc37d3e8c2248f4f4437547bc7225276e22ea41d
> > Author: Xinchen Hui <laruence@php.net> Sun, 14 Jun 2015 12:28:40
> +0800
> > Parents: 3cfa58367b1b85d346d9be6cf9ae116c63571247
> > Branches: master
> >
> > Link: http://git.php.net/?p=php-
> src.git;a=commitdiff;h=dc37d3e8c2248f4f4437547bc7225276e22ea41d
> >
> > Log:
> > Fixed Bug #69823 (PHP 7.0.0alpha1 segmentation fault when exactly 33
> > extensions are loaded)
> >
> > Bugs:
> > https://bugs.php.net/69823
> >
> > Changed paths:
> > M NEWS
> > M ext/hash/hash.c
> >
> >
> > Diff:
> > diff --git a/NEWS b/NEWS
> > index d09da24..f630dad 100644
> > --- a/NEWS
> > +++ b/NEWS
> > @@ -3,6 +3,8 @@ PHP
> > NEWS
> > 25 Jun 2015, PHP 7.0.0 Alpha 2
> >
> > - Core:
> > + . Fixed bug #69823 (PHP 7.0.0alpha1 segmentation fault when exactly 33
> > + extensions are loaded). (Laruence)
> > . Fixed bug #69805 (null ptr deref and seg fault in zend_resolve_class_name).
> > (Laruence)
> > . Fixed bug #69761 (Serialization of anonymous classes should be prevented).
> > diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 0510d37..d72b88c
> > 100644
> > --- a/ext/hash/hash.c
> > +++ b/ext/hash/hash.c
> > @@ -794,6 +794,9 @@ static void php_hash_dtor(zend_resource *rsrc) /*
> > {{{ */
> >
> > #ifdef PHP_MHASH_BC
> >
> > +#if 0
> > +/* See #69823, we should not insert module into module_registry while
> > +doing startup */
> > +
> > PHP_MINFO_FUNCTION(mhash)
> > {
> > php_info_print_table_start();
> > @@ -814,6 +817,7 @@ zend_module_entry mhash_module_entry = {
> > PHP_MHASH_VERSION,
> > STANDARD_MODULE_PROPERTIES,
> > };
> > +#endif
> >
> > static void mhash_init(INIT_FUNC_ARGS) { @@ -830,7 +834,8 @@ static
> > void mhash_init(INIT_FUNC_ARGS)
> > len = slprintf(buf, 127, "MHASH_%s", algorithm.mhash_name,
> strlen(algorithm.mhash_name));
> > zend_register_long_constant(buf, len, algorithm.value, CONST_CS |
> CONST_PERSISTENT, module_number);
> > }
> > - zend_register_internal_module(&mhash_module_entry);
> > +
> > + /* TODO: this cause #69823
> > + zend_register_internal_module(&mhash_module_entry); */
> > }
> >
> > /* {{{ proto string mhash(int hash, string data [, string key]) @@
> > -1090,6 +1095,14 @@ PHP_MINFO_FUNCTION(hash)
> > php_info_print_table_row(2, "hash support", "enabled");
> > php_info_print_table_row(2, "Hashing Engines", buffer);
> > php_info_print_table_end();
> > +
> > +#ifdef PHP_MHASH_BC
> > + php_info_print_table_start();
> > + php_info_print_table_row(2, "MHASH support", "Enabled");
> > + php_info_print_table_row(2, "MHASH API Version", "Emulated
> > Support");
> > + php_info_print_table_end();
> > +#endif
> > +
> > }
> > /* }}} */
> >
> >
> > --
> > PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit:
> > http://www.php.net/unsub.php
>
>
>
> --
> Xinchen Hui
> @Laruence
> http://www.laruence.com/
>
> --
> PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php