Edit report at https://bugs.php.net/bug.php?id=61482&edit=1

 ID:                 61482
 Updated by:         s...@php.net
 Reported by:        mattfic...@php.net
 Summary:            php-cli crashes during 'nmake snap'
 Status:             Open
 Type:               Bug
 Package:            PHAR related
 Operating System:   Windows
 PHP Version:        5.4.0
 Block user comment: N
 Private report:     N

 New Comment:

This commandline reliably reproduces it:


Release\php.exe -d date.timezone=UTC -n -dphar.readonly=0 
win32/build/mkdist.php 
Release C:\Projects\win32build php5.dll php-cgi.exe php.exe php_intl.dll 
php_pdo_mysql.dll    no


Previous Comments:
------------------------------------------------------------------------
[2012-03-23 00:47:31] s...@php.net

Happens to me with 5.4 branch too. If I remove make_phar_dot_phar(), it does 
not 
happen, so definitely has something to do with phar.

------------------------------------------------------------------------
[2012-03-22 23:03:38] mattfic...@php.net

looks like it fails on the first call to file_get_contents() in 
make_phar_dot_phar().

the first and only arg to file_get_contents() is 
"c:\php-sdk\git\php-src\ext\phar\phar\clicommand.inc".

------------------------------------------------------------------------
[2012-03-22 22:56:48] mattfic...@php.net

Test Script (stripped down win32/build/mkdist.php):
<?php 

// FYI: nmake snap runs mkdist.php with these args
//
// c:\php-sdk\git\php-src>C:\php-sdk\git\obj\Release\php.exe -d 
date.timezone=UTC -n -dphar.readonly=0 win32/build/mkdist.php 
"C:\php-sdk\git\obj\Release" "C:\php-sdk\git\php-src\no" "php5.dll" 
"php-cgi.exe php.exe php-win.exe php5embed.lib" "php_mbstring.dll php_shmop.dll 
php_sockets.dll php_sqlite3.dll php_exif.dll php_pdo_mysql.dll php_pdo_odbc.dll 
php_pdo_sqlite.dll " " " "no"

// php build directory
$build_dir = "C:\php-sdk\git\obj\Release";

$dist_dir = $build_dir . "/php-" . phpversion();
$test_dir = $build_dir . "/php-test-pack-" . phpversion();
$pecl_dir = $build_dir . "/pecl-" . phpversion();

@mkdir($dist_dir);
@mkdir("$dist_dir/ext");
@mkdir("$dist_dir/dev");
@mkdir("$dist_dir/extras");
@mkdir($pecl_dir);


function make_phar_dot_phar($dist_dir)
{
        if (!extension_loaded('phar')) {
                return;
        }

        $path_to_phar = realpath(__DIR__ . '/../../ext/phar');

        echo "Generating pharcommand.phar\n";
        $phar = new Phar($dist_dir . '/pharcommand.phar', 0, 'pharcommand');

        foreach (new DirectoryIterator($path_to_phar . '/phar') as $file) {
                if ($file->isDir() || $file == 'phar.php') {
                        continue;
                }

                echo 'adding ', $file, "\n";
                $phar[(string) $file] = file_get_contents($path_to_phar.  
'/phar/' . $file);
        }

        $phar->setSignatureAlgorithm(Phar::SHA1);
        $stub = file($path_to_phar . '/phar/phar.php');

        unset($stub[0]); // remove hashbang
        $phar->setStub(implode('', $stub));

        echo "Creating phar.phar.bat\n";
        file_put_contents($dist_dir . '/phar.phar.bat', "%~dp0php.exe 
%~dp0pharcommand.phar %*\r\n");
}


make_phar_dot_phar($dist_dir);
?>

------------------------------------------------------------------------
[2012-03-22 22:33:59] mattfic...@php.net

Description:
------------
Compiling latest revision from git repo...

Using Windows 7sp1x64, VC9 compiler x86 xp release

Ran nmake snap...

When it gets to 'creating phar.phar.bat' stage php cli crashes.

Here is the backtrace:

php5.dll!zval_mark_grey(_zval_struct * pz=0x010f0060)  Line 425 C
php5.dll!gc_mark_roots()  Line 501 + 0x6 bytes  C
php5.dll!gc_collect_cycles()  Line 794  C
php5.dll!zend_deactivate()  Line 962    C
php5.dll!php_request_shutdown(void * dummy=0x00000000)  Line 1784       C
php.exe!do_cli(int argc=13, char * * argv=0x00151b10)  Line 1169 + 0x8 bytes    
C
php.exe!main(int argc=13, char * * argv=0x00151b10)  Line 1358  C
php.exe!__tmainCRTStartup()  Line 586 + 0x17 bytes      C
kernel32.dll!7616339a() 



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



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61482&edit=1

Reply via email to