#45761 [Opn->Fbk]: make test & make install failure

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               45761
 Updated by:       [email protected]
 Reported By:      a dot sanders at manchester dot ac dot uk
-Status:           Open
+Status:           Feedback
 Bug Type:         Compile Failure
 Operating System: Solaris 9
 PHP Version:      5.2CVS-2008-08-11
 Assigned To:      fb-req-jani
 New Comment:

Add the output of '(gdb) bt' here of the crash. Compile using this
configure line:

# ./configure --disable-all --enable-debug

Also, when you generate the backtrace, make sure you're not loading any
php.ini file using the '-n' parameter. f.e.

# USE_ZEND_ALLOC=0 gdb sapi/cli/php -n run-tests.php


Previous Comments:
------------------------------------------------------------------------

[2008-08-11 09:45:59] a dot sanders at manchester dot ac dot uk

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]

------------------------------------------------------------------------

[2008-08-08 18:12:01] [email protected]

s/options/patches/ :)

------------------------------------------------------------------------

[2008-08-08 18:11:35] [email protected]

Get this:
http://snaps.php.net/php5.2-latest.tar.gz

And do not apply any 3rd party options. And do (exactly) this:

# ./configure --disable-all && make test


------------------------------------------------------------------------

[2008-08-08 11:59:04] 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'.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45761&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.