php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68343 CLI shutdown process exits mid-shutdown
Submitted: 2014-11-04 15:28 UTC Modified: -
From: Danack at basereality dot com Assigned:
Status: Open Package: CGI/CLI related
PHP Version: 5.6.2 OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Danack at basereality dot com
New email:
PHP Version: OS:

 

 [2014-11-04 15:28 UTC] Danack at basereality dot com
Description:
------------
The PHP shutdown process does not seem to complete when PHP is passed a filename. Instead the function clean_non_persistent_constants appears to abort the process on this line: http://lxr.php.net/xref/PHP_5_6/Zend/zend_constants.c#142

I found this by trying to enable the Garbage Collector benchmark as described on:
http://php.net/manual/en/features.gc.performance-considerations.php


After recompiling PHP with `export CFLAGS=-DGC_BENCH=1` I expect to see GC benchmarks after every php script is run. Instead only scripts that are piped in to PHP give benchmarks.

i.e. 

Running `php < memTest.php` - this appears to exit properly and shows the GC benchmarks


Running `php memTest.php` - this appears to exit prematurely in the clean_non_persistent_constants function.

To be honest, it may have been like this for such a long time that fixing this is a bad idea...and that just moving the GC benchmark output to above where it exits early would be more appropriate.


Test script:
---------------
<?php

echo "Hello world!";

Expected result:
----------------
GC Benchmark output after every script is run.

Actual result:
--------------
GC Benchmark output only after scripts are piped into PHP, rather than php running file names.

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 13:01:24 2019 UTC