ID: 47192
Updated by: [email protected]
Reported By: fmassei at gmail dot com
Status: Open
-Bug Type: Network related
+Bug Type: Feature/Change Request
Operating System: linux
PHP Version: 5.2.8
New Comment:
No, it's a change request since this function is not designed to do
what you ask. Not everything is a bug..
Previous Comments:
------------------------------------------------------------------------
[2009-01-23 13:52:04] fmassei at gmail dot com
Somehow I posted this bug in the wrong category. It's not a
"Feature/Change Request" but more a "Network related" bug.
------------------------------------------------------------------------
[2009-01-22 18:13:35] fmassei at gmail dot com
Description:
------------
gethostbyname() is not interruptible by signals. If it cannot resolve
an hostname there is no way it can be interrupted except for a SIGKILL.
Reproduce code:
---------------
declare(ticks=1);
function al($sig)
{
echo $sig;
exit(0);
}
pcntl_signal(SIGINT, "al");
pcntl_signal(SIGTERM, "al");
pcntl_signal(SIGALRM, "al");
pcntl_alarm(3);
echo gethostbyname("google.com");
Expected result:
----------------
I was expected to interrupt gethostbyname() with any signal.
Actual result:
--------------
When running the above code, if the system cannot resolve google's
hostname, the function blocks and doesn't respond to any signal.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47192&edit=1