Edit report at https://bugs.php.net/bug.php?id=62071&edit=1
ID: 62071
User updated by: ewilde at bsmdevelopment dot com
Reported by: ewilde at bsmdevelopment dot com
Summary: CLI Programs Hang Forever
Status: Open
Type: Bug
Package: Reproducible crash
Operating System: CentOS 5.8
PHP Version: 5.4.3
Block user comment: N
Private report: N
New Comment:
I tried both exit and die.
When I added "exit(1)" to the test program, it still hung.
When I added "die("The end")" to the test program, I saw the string "The end"
but then the program hung after that.
It seems that the hang is in the program exit/cleanup code of PHP, not the
logic of the program itself.
Any other ideas about what you'd like to test?
Previous Comments:
------------------------------------------------------------------------
[2012-05-31 20:19:21] riptide dot tempora at opinehub dot com
Would I wrong in assuming that exit; or die(); would properly kill the program
in your situation?
------------------------------------------------------------------------
[2012-05-21 18:57:43] ewilde at bsmdevelopment dot com
Well, that figures. Its way too simple a test to have slipped through your
regression testing.
I have other programs that are more complicated which fail in exactly the same
way. In all cases, absolutely all of the work, whatever it is, gets done to
completion. All that happens is they hang on exit or when the code falls
through the end of the script.
It sounds like one of those exec/wait problems whereby the wait in a mother
task fails to complete when the daughter task, that's doing all of the work,
ends. This could easily be OS-dependent or build-dependent and, hence, hard for
you to reproduce.
If you want to contact me offline about where to look, I'll try to debug the
problem on the test system where its failing.
------------------------------------------------------------------------
[2012-05-20 21:55:00] [email protected]
I can't reproduce it.
------------------------------------------------------------------------
[2012-05-19 14:44:36] ewilde at bsmdevelopment dot com
Description:
------------
Scripts executed under the CLI never end. For example, the following test
script will run as long as you let it, until it is killed. It doesn't appear
to be looping, as it consumes no resources. Rather, it appears to be blocked
waiting for some signal that never happens.
Note that this may explain why the 5.4.3 build cannot be built with
"--enable-phar" and why "make install" hangs forever at the end.
Build parms: ./configure --with-apxs2=/usr/share/httpd-2.4/bin/apxs --with-curl
--with-gd --with-ldap --with-libxml-dir=/usr/local --with-mcrypt
--with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config
--with-openssl --with-pspell --with-unixODBC=/usr/local/unixODBC
--enable-bcmath --disable-phar --enable-sockets
Test script:
---------------
#!/usr/bin/php
<script language="php">
fwrite(STDOUT, "This is a test\n");
</script>
Expected result:
----------------
The CLI program exits.
Actual result:
--------------
The CLI program never exits.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62071&edit=1