Bug #73390 [Fbk->Opn]: Segmentation fault on clone sample code spread across multiple current versions

From: Date: Thu, 27 Oct 2016 02:03:49 +0000
Subject: Bug #73390 [Fbk->Opn]: Segmentation fault on clone sample code spread across multiple current versions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205035@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73390&edit=1 ID: 73390 Updated by: requinix@php.net Reported by: kenterfie at googlemail dot com Summary: Segmentation fault on clone sample code spread across multiple current versions -Status: Feedback +Status: Open Type: Bug Package: Reproducible crash Operating System: Linux PHP Version: 5.x 7.x Block user comment: N Private report: N New Comment: It's a user comment from 8 years ago on the oop5.cloning page. http://php.net/manual/en/language.oop5.cloning.php#79886 Obviously not a problem on our end. Do we add an editor's note? Remove the comment entirely? Previous Comments: ------------------------------------------------------------------------ [2016-10-27 01:08:50] stas@php.net Where on php.net do you have this sample? It's certainly not a correct code, it leads to stack exhaustion via infinite recursion. ------------------------------------------------------------------------ [2016-10-26 10:29:56] kenterfie at googlemail dot com Added more meaningful version information ------------------------------------------------------------------------ [2016-10-26 10:28:40] kenterfie at googlemail dot com Description: ------------ The following code sample is a 1:1 copy of one of your samples on php.net. It produce an segmentation fault. I was writing on a very similar subject, which also produce an segmentation fault, after some testing i found the page on php.net and also this sample fail. I set the bug type to security because it is spread accross the most current php versions. I have tested 5.6.27 locally, but all other version also affected. Simple test is to use http://phptester.net/ which end in an internal server error. Test script: --------------- <?php class Foo { var $that; function __clone() { $this->that = clone $this->that; } } $a = new Foo; $b = new Foo; $a->that = $b; $b->that = $a; $c = clone $a; echo 'What happened?'; var_dump($c); Expected result: ---------------- The normally expected result should be a successful created copy of an object. Actual result: -------------- Segmentation fault ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73390&edit=1

« previous php.bugs (#205035) next »