Bug #75762 [Opn->Dup]: Segfault: 11 on recursive clone call

From: Date: Thu, 04 Jan 2018 23:16:11 +0000
Subject: Bug #75762 [Opn->Dup]: Segfault: 11 on recursive clone call
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213378@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75762&edit=1 ID: 75762 Updated by: requinix@php.net Reported by: emilio dot pinn at gmail dot com Summary: Segfault: 11 on recursive clone call -Status: Open +Status: Duplicate Type: Bug Package: Unknown/Other Function PHP Version: 7.2.1 Block user comment: N Private report: N New Comment: Duplicate of bug #64196 Previous Comments: ------------------------------------------------------------------------ [2018-01-04 22:54:51] emilio dot pinn at gmail dot com Description: ------------ Hello, The PHP interpreter crashes with "Segmentation fault: 11" if the __clone() function is overriden to clone the object iself creating an infinite recursive call. Test script: --------------- <?php class Crash { public function __clone() { return clone $this; } } $crash_obj = new Crash(); clone $crash_obj; Expected result: ---------------- The interpreter should suicide gracefully when hits the stack size limit. Actual result: -------------- Segmentation fault: 11 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75762&edit=1

« previous php.bugs (#213378) next »