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

 ID:                 39349
 Comment by:         tsteiner at nerdclub dot net
 Reported by:        nikolas dot hagelstein at gmail dot com
 Summary:            Core dump on preg_replace
 Status:             Not a bug
 Type:               Bug
 Package:            PCRE related
 Operating System:   Netbsd 3.0.1
 PHP Version:        5.2.0
 Assigned To:        andrei
 Block user comment: N
 Private report:     N

 New Comment:

I've uploaded a patch that will disable using the stack for recursion when 
building PCRE with the included library source.  I've found that this 
completely 
eliminates segfaults when using PCRE functions on long strings.


Previous Comments:
------------------------------------------------------------------------
[2006-12-01 21:37:36] nikolas dot hagelstein at gmail dot com

A stack overflow shouldnt cause a segfault.

------------------------------------------------------------------------
[2006-12-01 20:25:11] nlop...@php.net

no bug here. just a stack overflow, which is avoidable by tweaking the new ini 
options and/or increasing the stack size.

------------------------------------------------------------------------
[2006-11-12 19:03:04] tony2...@php.net

Yes, endless recursion most likely results in a segfault and this is expected.

------------------------------------------------------------------------
[2006-11-12 15:15:26] nikolas dot hagelstein at gmail dot com

This seems to be stack overflow related in general:
<?php

class Foo {
        function do_something() {
                global $x,$i;           
                $i++;
                echo $i."\n";
                $x->do_something();             
        }
}
$i=0;
$x = new Foo();
$x ->do_something();
?>

Endless recursion results in stack overflow which throws a segmentation fault. 
Probably libc os related.

------------------------------------------------------------------------
[2006-11-08 20:44:14] nikolas dot hagelstein at gmail dot com

seems to work with ulimit is there any other solution beside recompiling it 
using the named flag? i mean running out of stack may happen on any system 
regardless of its default ulimits.

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


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


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

Reply via email to