|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-08-08 11:59 UTC] a dot sanders at manchester dot ac dot uk
Description:
------------
'make test' fails immediately with a segmentation fault. Re-compiling
with compiler flag DEBUG_ZEND=2 allows 'make test' to get to test
4399 before spawning several thousand php-cgi children and consuming all
the system memory.
Actual result:
--------------
Initial configure command was:
env LDFLAGS="-R/copac/gcc-4/lib" ./configure --prefix=~/apache-
2_2/ --with-mysql=/home/copacw/mysql5/mysql --with-libxml-
dir=/home/copacw/apache-2_2
A 'make test' from the above results in this:
huntly copacw/php-5.2.6 $ make test
Build complete.
Don't forget to run 'make test'.
Segmentation Fault - core dumped
make: [test] Error 139 (ignored)
A backtrace of the core file from the above:
#0 0x00220130 in _zval_ptr_dtor (zval_ptr=0x39d8a8)
at /home/copacw/php-5.2.6/Zend?/zend_execute_API.c:412
412 (*zval_ptr)->refcount--;
(gdb) list
407 ZEND_API void _zval_ptr_dtor(zval **zval_ptr
ZEND_FILE_LINE_DC)
408 {
409 #if DEBUG_ZEND>=2
410 printf("Reducing refcount for %x (%x): %d->%d\n",
*zval_ptr, zval_ptr, (*zval_ptr)->refcount, (*zval_ptr)-
>refcount-1);
411 #endif
412 (*zval_ptr)->refcount--;
413 if ((*zval_ptr)->refcount==0) {
414 zval_dtor(*zval_ptr);
415 safe_free_zval_ptr_rel(*zval_ptr
ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC);
416 } else if ((*zval_ptr)->refcount == 1) {
(gdb) print *zval_ptr
$1 = (zval *) 0x1
I reconfigured by adding CFLAGS="-DDEBUG_ZEND=2" to the start of the
configure command, did a 'make clean', then 'make', then
'make test'.
This time the 'make test' gets to test 4399 and then fails as below:
....
PASS XMLWriter: libxml2 XML Writer DTD Element & Attlist
[ext/xmlwriter/tests/OO_008.phpt]
PASS XMLWriter: PI, Comment, CDATA [ext/xmlwriter/tests/OO_009.phpt]
PASS Bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag,
not enity) [ext/xmlwriter/tests/bug39504.phpt]
PASS Bug #41287 (Namespace functions don't allow xmlns defintion to
be optional) [ext/xmlwriter/tests/bug41287.phpt]
PASS Bug #41287 (Writing empty tags with Xmlwriter::WriteElement?
[ns]) [ext/xmlwriter/tests/bug41326.phpt]
TEST 4399/4426 [sapi/cgi/tests/001.phpt]
Test 4399 spawned over 4400 php-cgi child processes (on a previous run
when I left it
to its own devices it kept going until it had consumed all the system
memory and swap.)
A ps of the process it created is as follows:
$ ps -ef | grep php-cgi
copacw 40 37 0 12:22:05 pts/3 0:00 sh -c
/home/copacw/php-5.2.6/sapi/cgi/php-cgi -n -v
copacw 29989 29988 0 12:22:03 pts/3 0:00 /home/copacw/php-
5.2.6/sapi/cgi/php-cgi -n -v
copacw 1721 1720 0 12:23:07 pts/3 0:00 /home/copacw/php-
5.2.6/sapi/cgi/php-cgi -n -v
...
I also tried 'make install'. The first compile WITHOUT the DEBUG_ZEND
flag failed
on a 'make install' with a segmentation fault. The compile WITH the
flag successfully
performed the 'make install'.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 07:00:01 2025 UTC |
I downloaded the latest this morning and did ./configure --disable-all make test I compiles okay and then still seg faults when it gets to the test part of make test: ... Build complete. Don't forget to run 'make test'. Segmentation Fault - core dumped make: [test] Error 139 (ignored) Same stuff as before from gdb: #0 0x0010003c in _zval_ptr_dtor (zval_ptr=0x23f1e0) at /home/copacw/php5.2-200808110830/Zend/zend_execute_API.c:412 412 (*zval_ptr)->refcount--; (gdb) print *zval_ptr $1 = (zval *) 0x1 (gdb) I recompiled again with the DEBUG_ZEND=2 flag and got the following result: Build complete. Don't forget to run 'make test'. +-----------------------------------------------------------+ | ! ERROR ! | | The test-suite requires that you have pcre extension | | enabled. To enable this extension either compile your PHP | | with --with-pcre-regex or if you've compiled pcre as a | | shared module load it via php.ini. | +-----------------------------------------------------------+ So reconfigured and recompiled again with --disbale-all --with-pcre_regex. This time it compiled and got to test 3519 when it again tried to spawn thousands of child processes. It was in danger of consuming all available memory, so I killed it at that point. TEST 3519/3546 [sapi/cgi/tests/001.phpt]