Bug #49664 [Com]: Clone causes Segmentation fault

From: Date: Thu, 19 Mar 2015 19:52:27 +0000
Subject: Bug #49664 [Com]: Clone causes Segmentation fault
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191470@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=49664&edit=1

 ID:                 49664
 Comment by:         omars@php.net
 Reported by:        patrik dot lermon at gmail dot com
 Summary:            Clone causes Segmentation fault
 Status:             Not a bug
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   Linux
 PHP Version:        5.*, 6 (2009-09-20)
 Block user comment: N
 Private report:     N

 New Comment:

I'd say the best way to handle this, could be using an ini directive.


Previous Comments:
------------------------------------------------------------------------
[2014-04-03 12:15:14] mike@php.net

@cataphract, why was this re-opened?
AFAICT there won't be a recursion counter.

------------------------------------------------------------------------
[2013-08-07 20:19:34] initrd dot gz at gmail dot com

C lets you do a lot of stuff you aren't supposed to do. Just because C allows it 
doesn't mean higher level languages like PHP should. An out of memory error is 
much more helpful than a segfault, which could come from anything. Also, segfaults 
have historically lead to exploits.

------------------------------------------------------------------------
[2013-04-06 17:45:36] dinesh dot joshi at yahoo dot com

This segmentation fault / coredump behavior is consistent with what lower level 
languages like C. So IMHO this should not be considered a PHP bug. Just don't get 
into infinite recursions. The language can't stop you from doing something stupid.

Here's a C program that demos the same behavior:

------------------------------
#include<stdio.h>

void fn() {
    char buff[16*1024]; 
    fn();
}

int main(void) {
    fn();
}
------------------------------

------------------------------------------------------------------------
[2013-02-23 22:58:49] cataphract@php.net

Still present in trunk; reopening.

------------------------------------------------------------------------
[2013-01-28 13:43:17] cf0hay at gmail dot com

Same az OP (with PHP 5.4.8):

$ php a.php
a before cloning:
a: [- >]
Segmentation fault

------------------------------------------------------------------------


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=49664


--
Edit this bug report at https://bugs.php.net/bug.php?id=49664&edit=1


Thread (22 messages)

« previous php.bugs (#191470) next »