|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-09-26 14:01 UTC] nikolas dot hagelstein at gmail dot com
Description:
------------
Passing utf8 data to metaphone results in a segmentation fault.
Reproduce code:
---------------
<?PHP
//replace xxx with native utf8 chars e.g. copy and paste from
a russian website. The document itself needs to be of ut8 too
echo "crash:".metaphone('xxx');
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
./sapi/cli/php -r 'var_dump(metaphone("русский язык UTF8"));' string(3) "UTF"I can not try that since i am not able to submit real utf8 chars through my shell. test.php <?php echo "crash:".metaphone('?'); ?> php test.php results in a segmentation fault test.php needs to be an UTF8 file. file -i test.php test.php: text/plain; charset=utf-8sorry folks you have been right it seems as if the pkgsrc process somehow stripes debug informations :|. Anyway here is what i got using a native build process and the native sources (without the latest cvs patch provided by iliaa) Program received signal SIGSEGV, Segmentation fault. 0x00000000004a00ff in metaphone (word=0x8127c0 "ö", word_len=2, max_phonemes=0, phoned_word=0x7f7fffffcc70, traditional=1) at /usr/local/src/php-5.1.6/ext/standard/metaphone.c:195 195 for (; !isalpha(Curr_Letter); w_idx++) { (gdb) bt #0 0x00000000004a00ff in metaphone (word=0x8127c0 "ö", word_len=2, max_phonemes=0, phoned_word=0x7f7fffffcc70, traditional=1) at /usr/local/src/php-5.1.6/ext/standard/metaphone.c:195 #1 0x000000000049ff40 in zif_metaphone (ht=1, return_value=0x812840, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /usr/local/src/php-5.1.6/ext/standard/metaphone.c:46 #2 0x0000000000561366 in zend_do_fcall_common_helper_SPEC ( execute_data=0x7f7fffffce20) at zend_vm_execute.h:200 #3 0x000000000056493d in ZEND_DO_FCALL_SPEC_CONST_HANDLER ( execute_data=0x7f7fffffce20) at zend_vm_execute.h:1640 #4 0x0000000000560e6a in execute (op_array=0x783c40) at zend_vm_execute.h:92 #5 0x000000000053ddf6 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-5.1.6/Zend/zend.c:1109 #6 0x00000000004eed77 in php_execute_script (primary_file=0x7f7fffffe7c0) at /usr/local/src/php-5.1.6/main/main.c:1737 #7 0x00000000005b1cd7 in main (argc=2, argv=0x7f7fffffe8c0) at /usr/local/src/php-5.1.6/sapi/cgi/cgi_main.c:1612