Bug #75573 [Com]: Segmentation fault in 7.1.12 and 7.0.26

From: Date: Wed, 29 Nov 2017 18:32:21 +0000
Subject: Bug #75573 [Com]: Segmentation fault in 7.1.12 and 7.0.26
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212810@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75573&edit=1 ID: 75573 Comment by: post at minhost dot no Reported by: manuel-php at mausz dot at Summary: Segmentation fault in 7.1.12 and 7.0.26 Status: Closed Type: Bug Package: Reproducible crash Operating System: Linux PHP Version: 7.1.12 Block user comment: N Private report: N New Comment: I applied this patch http://git.php.net/?p=php-src.git;a=commit;h=3b9ba7b6bd9e24bdbeca8e8e3f24cee2fccc51d8 to PHP 7.1.12 and it seems to have fixed the crashes I reported in Bug #75579 Can I also use this same patch for PHP 7.0.26, or must I wait for a modified patch for that PHP version? Previous Comments: ------------------------------------------------------------------------ [2017-11-29 18:08:02] post at minhost dot no Related To: Bug #75579 ------------------------------------------------------------------------ [2017-11-29 18:08:02] post at minhost dot no Related To: Bug #75579 ------------------------------------------------------------------------ [2017-11-29 11:16:53] nikic@php.net Related To: Bug #75579 ------------------------------------------------------------------------ [2017-11-29 06:54:19] laruence@php.net Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=3b9ba7b6bd9e24bdbeca8e8e3f24cee2fccc51d8 Log: Fixed bug #75573 (Segmentation fault in 7.1.12 and 7.0.26) ------------------------------------------------------------------------ [2017-11-29 00:35:57] manuel-php at mausz dot at So I spend some time tracing the crash and trying to copy the minimal object model. The script I've come up with has different btacktrace and only crashes about 1 out of 5 runs, but it's related as PHP with both commits reverted doesn't crash anymore. Script: ------- <?php class A { var $_stdObject; function initialize($properties = FALSE) { $this->_stdObject = $properties ? (object) $properties : new stdClass(); parent::initialize(); } function &__get($property) { if (isset($this->_stdObject->{$property})) { $retval =& $this->_stdObject->{$property}; return $retval; } else { return NULL; } } function &__set($property, $value) { return $this->_stdObject->{$property} = $value; } function __isset($property_name) { return isset($this->_stdObject->{$property_name}); } } class B extends A { function initialize($properties = array()) { parent::initialize($properties); } function &__get($property) { if (isset($this->settings) && isset($this->settings[$property])) { $retval =& $this->settings[$property]; return $retval; } else { return parent::__get($property); } } } $b = new B(); $b->settings = [ "foo" => "bar", "name" => "abc" ]; var_dump($b->name); var_dump($b->settings); ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=75573 -- Edit this bug report at https://bugs.php.net/bug.php?id=75573&edit=1

« previous php.bugs (#212810) next »