Edit report at https://bugs.php.net/bug.php?id=63950&edit=1
ID: 63950 Updated by: larue...@php.net Reported by: hufeng1987 at gmail dot com Summary: Lot's of memory leaks detected Status: Feedback Type: Bug Package: FPM related Operating System: CentOS 5.8 PHP Version: 5.4.10 Block user comment: N Private report: N New Comment: could you please give us the backtrace of the segfault you mentioned? Previous Comments: ------------------------------------------------------------------------ [2013-01-09 23:52:53] hufeng1987 at gmail dot com it's this APC bug? some times it cause PHP segmentation fault ------------------------------------------------------------------------ [2013-01-09 15:44:21] ras...@php.net The Valgrind output looks normal. There are a couple of intentional at-exit leaks in APC. These are not relevant since they aren't per-request. It is simply memory only allocated at process startup and not freed, relying instead on process exit to clear it. ------------------------------------------------------------------------ [2013-01-09 09:10:52] hufeng1987 at gmail dot com i found following log ------------------------------------------------------------------------------ ==3523== ==3523== HEAP SUMMARY: ==3523== in use at exit: 1,712 bytes in 15 blocks ==3523== total heap usage: 997,631 allocs, 997,616 frees, 333,021,308 bytes allocated ==3523== ==3523== Searching for pointers to 15 not-freed blocks ==3523== Checked 966,304 bytes ==3523== ==3523== 96 (16 direct, 80 indirect) bytes in 1 blocks are definitely lost in loss record 10 of 15 ==3523== at 0x4A0610C: malloc (vg_replace_malloc.c:195) ==3523== by 0x8CDA128: ??? ==3523== by 0x8CF21A9: ??? ==3523== by 0x8CDD617: ??? ==3523== by 0x8CDE041: ??? ==3523== by 0x99D775: zend_startup_module_ex (zend_API.c:1661) ==3523== by 0x9A96D2: zend_hash_apply (zend_hash.c:716) ==3523== by 0x99DCBB: zend_startup_modules (zend_API.c:1788) ==3523== by 0x8FDEC1: php_module_startup (main.c:2200) ==3523== by 0xAFAA5B: php_cli_startup (php_cli.c:414) ==3523== by 0xAFD368: main (php_cli.c:1344) ==3523== ==3523== LEAK SUMMARY: ==3523== definitely lost: 16 bytes in 1 blocks ==3523== indirectly lost: 80 bytes in 1 blocks ==3523== possibly lost: 0 bytes in 0 blocks ==3523== still reachable: 1,616 bytes in 13 blocks ==3523== suppressed: 0 bytes in 0 blocks ==3523== Reachable blocks (those to which a pointer was found) are not shown. ==3523== To see them, rerun with: --leak-check=full --show-reachable=yes ==3523== ==3523== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 33 from 6) --3523-- --3523-- used_suppression: 29 zlib-1.2.x trickyness (1a): See http://www.zlib.net/zlib_faq.html#faq36 --3523-- used_suppression: 4 dl-hack3 ==3523== ==3523== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 33 from 6) ------------------------------------------------------------------------ [2013-01-09 08:57:51] paj...@php.net An easy way to provide more info is to run php under valgrind. It could help to locate the issue (for obvious ones). But at the end we may need something to reproduce it. ------------------------------------------------------------------------ [2013-01-09 08:52:53] hufeng1987 at gmail dot com i hope i could locate which code occurred these leak. but i failed because it run's too much more code. million lines of code running. any suggestion help me find out the bad code? i tried my hard to find it out ,but still got nothing. -------------------------------------------------------------------------------- ------------------------------------------------------ [09-Jan-2013 16:49:52.459798] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "/root/soft/phpall/php- 5.4.10/Zend/zend_hash.c(339) : Actual location (location was relayed)" [09-Jan-2013 16:49:52.459810] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "Last leak repeated 849 times" [09-Jan-2013 16:49:52.459822] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "[Wed Jan 9 16:49:52 2013] Script: '-'" [09-Jan-2013 16:49:52.459835] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "/root/soft/phpall/cache/APC- 3.1.13/apc_compile.c(219) : Freeing 0x100EF5C0 (32 bytes), script=-" [09-Jan-2013 16:49:52.459848] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "Last leak repeated 53 times" [09-Jan-2013 16:49:52.459860] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "[Wed Jan 9 16:49:52 2013] Script: '-'" [09-Jan-2013 16:49:52.459872] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "/root/soft/phpall/php- 5.4.10/Zend/zend_compile.c(114) : Freeing 0x100F0648 (54 bytes), script=-" [09-Jan-2013 16:49:52.459885] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "Last leak repeated 182 times" [09-Jan-2013 16:49:52.459897] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "[Wed Jan 9 16:49:52 2013] Script: '-'" [09-Jan-2013 16:49:52.459909] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "/root/soft/phpall/php- 5.4.10/Zend/zend_compile.c(2867) : Freeing 0x100F17C8 (240 bytes), script=-" [09-Jan-2013 16:49:52.459924] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "/root/soft/phpall/php- 5.4.10/Zend/zend_hash.c(236) : Actual location (location was relayed)" [09-Jan-2013 16:49:52.459935] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "Last leak repeated 9 times" [09-Jan-2013 16:49:52.459947] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "[Wed Jan 9 16:49:52 2013] Script: '-'" [09-Jan-2013 16:49:52.459958] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "/root/soft/phpall/php- 5.4.10/Zend/zend_hash.c(450) : Freeing 0x100F29B0 (128 bytes), script=-" [09-Jan-2013 16:49:52.459969] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "Last leak repeated 29 times" [09-Jan-2013 16:49:52.459980] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "[Wed Jan 9 16:49:52 2013] Script: '-'" [09-Jan-2013 16:49:52.459991] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "/root/soft/phpall/php- 5.4.10/Zend/zend_vm_execute.h(380) : Freeing 0x100F4198 (56 bytes), script=-" [09-Jan-2013 16:49:52.460002] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "/root/soft/phpall/php- 5.4.10/Zend/zend_alloc.c(2529) : Actual location (location was relayed)" [09-Jan-2013 16:49:52.460013] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "Last leak repeated 471 times" [09-Jan-2013 16:49:52.460024] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "[Wed Jan 9 16:49:52 2013] Script: '-'" [09-Jan-2013 16:49:52.460035] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "/root/soft/phpall/php- 5.4.10/Zend/zend_compile.c(3309) : Freeing 0x10493948 (64 bytes), script=-" [09-Jan-2013 16:49:52.460056] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "/root/soft/phpall/php- 5.4.10/Zend/zend_hash.c(339) : Actual location (location was relayed)" [09-Jan-2013 16:49:52.460069] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "Last leak repeated 21 times" [09-Jan-2013 16:49:52.460080] WARNING: pid 2813, fpm_stdio_child_said(), line 166: [pool www] child 2815 said into stderr: "=== Total 7991 memory leaks detected ===" [09-Jan-2013 16:49:52.460091] DEBUG: pid 2813, fpm_event_loop(), line 411: event module triggered 1 events ------------------------------------------------------------------------ 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=63950 -- Edit this bug report at https://bugs.php.net/bug.php?id=63950&edit=1