From: [EMAIL PROTECTED] Operating system: linux PHP version: 4.1.1 PHP Bug Type: Reproducible crash Bug description: the metaphone() function causes php to segfault under rare circumstances.
I've isolated a case where metaphone() causes a memory-management-related segfault in php versions 4.0.5-dev and 4.1.1 on Linux. uname -srvmp says: Linux 2.4.19-pre2 #1 SMP Sun Mar 10 15:02:27 CST 2002 i686 unknown and Linux 2.4.17 #1 SMP Sun Dec 23 03:18:05 CST 2001 i686 unknown Here's a short script that causes the segfault for me: #!/usr/local/bin/php -q <script language=php> $word_one = "ln"; $word_two = "xvxvccv"; $foo = metaphone($word_one); $bar = metaphone($word_two); echo "$foo\n"; echo "$bar\n"; </script> Here's a gdb backtrace: #0 0x40149cce in chunk_free (ar_ptr=0x401fc4c0, p=0x81b2d90) at malloc.c:3228 3228 malloc.c: No such file or directory. (gdb) bt #0 0x40149cce in chunk_free (ar_ptr=0x401fc4c0, p=0x81b2d90) at malloc.c:3228 #1 0x40149a50 in __libc_free (mem=0x81b36a0) at malloc.c:3154 #2 0x80dd485 in shutdown_memory_manager (silent=0, clean_cache=0) at zend_alloc.c:485 #3 0x8062ca3 in php_request_shutdown (dummy=0x0) at main.c:742 #4 0x8061d0f in main (argc=3, argv=0xbffffb34) at cgi_main.c:776 #5 0x400e9386 in __libc_start_main (main=0x8061468 <main>, argc=3, ubp_av=0xbffffb34, init=0x805ff6c <_init>, fini=0x8115f40 <_fini>, rtld_fini=0x4000d318 <_dl_fini>, stack_end=0xbffffb2c) at ../sysdeps/generic/libc-start.c:129 email me if you need a binary and core, or anything else. -- Edit bug report at http://bugs.php.net/?id=16176&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16176&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16176&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16176&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16176&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16176&r=support Expected behavior: http://bugs.php.net/fix.php?id=16176&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16176&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16176&r=submittedtwice