From:             admin at phpcode dot us
Operating system: OpenBSD 5.2 amd64
PHP version:      5.3.18
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:Segmentation fault in recursive function

Description:
------------
I user OpenBSD 5.2 amd64. with php 5.3.17 port from current port tree with
small 
fix to success build it on 5.2 and fix to use latest version. 
Run test script from CLI and get segfault.


Test script:
---------------
#!/usr/local/bin/php -n
<?php
function test() {
    static $i = 0;
    if ($i === PHP_INT_MAX) {
        echo $i . PHP_EOL;
        return ;
    }
    if (!($i % 256)) {
        echo $i . PHP_EOL;
    }
    $i++;
    test();
}
test();

Expected result:
----------------
$ ./test.php
a lot of input ($i % 256)
9223372036854775807

Actual result:
--------------
$ ./test.php
0
...
11776
Segmentation fault (core dumped)

$ gdb -c php-5.3.core /usr/local/bin/php-5.3

#0  0x00000000006b9dac in vspprintf ()
#1  0x0000000000723cfa in zend_exception_error ()
#2  0x0000000000703630 in _convert_to_string ()
#3  0x000000000070c9d4 in zend_make_printable_zval ()
#4  0x000000000070317b in concat_function ()
#5  0x0000000000733876 in zend_get_user_opcode_handler ()
#6  0x0000000000735260 in execute ()
#7  0x0000000000683d4c in php_url_encode_hash_ex ()
#8  0x0000000000735c7c in execute ()
#9  0x0000000000735260 in execute ()
......................................
#58400 0x00000000008ef760 in execute ()
#58401 0x00000000008f53cf in execute ()
#58402 0x00000000008ee560 in execute ()
#58403 0x00000000007bd39a in php_url_encode_hash_ex ()
#58404 0x00000000007bd3e1 in php_url_encode_hash_ex ()
#58405 0x00000000008b4c76 in zend_execute_scripts ()
#58406 0x0000000000835571 in php_execute_script ()
#58407 0x00000000009ae07c in _full_mem_check ()
#58408 0x0000000000428b71 in ___start ()
#58409 0x0000000000000000 in ?? ()

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63548&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63548&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63548&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63548&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63548&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63548&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63548&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63548&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63548&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63548&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63548&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63548&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63548&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63548&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63548&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63548&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63548&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63548&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63548&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63548&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63548&r=mysqlcfg

Reply via email to