Bug 880752
| Summary: | [abrt] php-cli-5.4.9-1.fc17: _zend_mm_free_int: Process /usr/bin/php was killed by signal 11 (SIGSEGV) | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Andrey V. Henneberg <andrey.henneberg> | ||||||||||||||||||||||||||||||
| Component: | php | Assignee: | Joe Orton <jorton> | ||||||||||||||||||||||||||||||
| Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||||||||||||||||||||||
| Severity: | unspecified | Docs Contact: | |||||||||||||||||||||||||||||||
| Priority: | unspecified | ||||||||||||||||||||||||||||||||
| Version: | 17 | CC: | fedora, jorton, rpm | ||||||||||||||||||||||||||||||
| Target Milestone: | --- | ||||||||||||||||||||||||||||||||
| Target Release: | --- | ||||||||||||||||||||||||||||||||
| Hardware: | i686 | ||||||||||||||||||||||||||||||||
| OS: | Unspecified | ||||||||||||||||||||||||||||||||
| Whiteboard: | abrt_hash:28ff68b7eb4f2d63c3e62f25478fdf91a3720711 | ||||||||||||||||||||||||||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||||||||||||||||||||||||||
| Doc Text: | Story Points: | --- | |||||||||||||||||||||||||||||||
| Clone Of: | Environment: | ||||||||||||||||||||||||||||||||
| Last Closed: | 2012-11-28 11:21:15 UTC | Type: | --- | ||||||||||||||||||||||||||||||
| Regression: | --- | Mount Type: | --- | ||||||||||||||||||||||||||||||
| Documentation: | --- | CRM: | |||||||||||||||||||||||||||||||
| Verified Versions: | Category: | --- | |||||||||||||||||||||||||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||||||||||||||||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||||||||||||||||||||||||
| Embargoed: | |||||||||||||||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||||||||||||||
|
Description
Andrey V. Henneberg
2012-11-27 18:12:41 UTC
Created attachment 652987 [details]
File: backtrace
Created attachment 652988 [details]
File: build_ids
Created attachment 652989 [details]
File: cgroup
Created attachment 652990 [details]
File: core_backtrace
Created attachment 652991 [details]
File: dso_list
Created attachment 652992 [details]
File: environ
Created attachment 652993 [details]
File: limits
Created attachment 652994 [details]
File: maps
Created attachment 652995 [details]
File: open_fds
Created attachment 652996 [details]
File: proc_pid_status
Created attachment 652997 [details]
File: var_log_messages
Created attachment 652998 [details]
File: smolt_data
*** Bug 880516 has been marked as a duplicate of this bug. *** *** Bug 880718 has been marked as a duplicate of this bug. *** Thanks, for the various, tests. It seems it crash in the garbage collector. Could you try with -d zend.enable_gc=0 ? Are you able to provide a reproducer ? (as small as possible) ? PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36 bytes) in /home/andrey/development/catalog-parser/simple_html_dom.php on line 1333
PHP Stack trace:
PHP 1. {main}() /home/andrey/development/catalog-parser/catalog-parser.php:0
PHP 2. processCity() /home/andrey/development/catalog-parser/catalog-parser.php:62
PHP 3. processCategory() /home/andrey/development/catalog-parser/catalog-parser.php:18
PHP 4. parseCompany() /home/andrey/development/catalog-parser/catalog-parser.php:28
PHP 5. file_get_html() /home/andrey/development/catalog-parser/catalog-parser.php:37
PHP 6. simple_html_dom->load() /home/andrey/development/catalog-parser/simple_html_dom.php:84
PHP 7. simple_html_dom->parse() /home/andrey/development/catalog-parser/simple_html_dom.php:1068
PHP 8. simple_html_dom->read_tag() /home/andrey/development/catalog-parser/simple_html_dom.php:1174
Created attachment 653056 [details]
the bug reproducer
catalog-parser.php is the bug reproducer. simple_html_dom.php is the required library. Note: works slowly because uses slow sites. I have to wait several minutes before php crashes.
So, no more crash.
> PHP Fatal error: Allowed memory size of 134217728 bytes exhausted...
You just need to increase the limit.
I have increase the limit up to 512M but the result is the same except the php crashes earlie than it was with garbadge collector. Without the Garbage Collector, there is a huge memory leak (because of massive use of circular references).
$this->nodes[] = $this;
running with -d zend.enable_gc=0 -d memory_limit=-1 will probably consume most of the memory (quickly use GB)
The gc should clean this, but sometime raised a segfault or a "zend_mm_heap corrupted".
Analysis is quite impossible without a minimal reproducer script...
Can you please try to create one, and report this bug upstream (php)
A workaround is to split this "huge" process in small ones (probably 1 per category).
Created attachment 653376 [details]
catalog-parser.php
Here is a (quick) possible implementation which seems to run without problem.
Note: use pcntl_fork and include a simple "cache" to avoid multiple internet access during the tests.
Bug reported upstream with a "minimal" reproducer. https://bugs.php.net/63635 So, closing this one as UPSTREAM. |