php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75762 Segfault: 11 on recursive clone call
Submitted: 2018-01-04 22:54 UTC Modified: 2018-01-04 23:16 UTC
From: emilio dot pinn at gmail dot com Assigned:
Status: Duplicate Package: Unknown/Other Function
PHP Version: 7.2.1 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: emilio dot pinn at gmail dot com
New email:
PHP Version: OS:

 

 [2018-01-04 22:54 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-01-04 23:16 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2018-01-04 23:16 UTC] requinix@php.net
Duplicate of bug #64196
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC