Edit report at https://bugs.php.net/bug.php?id=63548&edit=1
ID: 63548 Updated by: larue...@php.net Reported by: admin at phpcode dot us Summary: Segmentation fault in recursive function -Status: Open +Status: Not a bug Type: Bug Package: Scripting Engine problem Operating System: OpenBSD 5.2 amd64 PHP Version: 5.3.18 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php actually, your bt seems not generated accurately by the test script, right? thanks for mail+php at requinix dot net 's explanation Previous Comments: ------------------------------------------------------------------------ [2012-11-19 22:48:07] mail+php at requinix dot net You overflowed the stack. Of course it'll segfault. ------------------------------------------------------------------------ [2012-11-17 14:18:34] admin at phpcode dot us 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 this bug report at https://bugs.php.net/bug.php?id=63548&edit=1