#47192 [Com]: gethostbyname is not interruptible by signals
| From: | fmassei at gmail dot com | Date: | Sun, 25 Jan 2009 16:00:14 +0000 |
| Subject: | #47192 [Com]: gethostbyname is not interruptible by signals | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-133204@lists.php.net to get a copy of this message | ||
ID: 47192
Comment by: fmassei at gmail dot com
Reported By: fmassei at gmail dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: linux
PHP Version: 5.2.8
New Comment:
well, it actually IS a bug, as long as the "pcntl_" functions are not
working as described for this function only.
Previous Comments:
------------------------------------------------------------------------
[2009-01-24 23:55:06] jani@php.net
No, it's a change request since this function is not designed to do
what you ask. Not everything is a bug..
------------------------------------------------------------------------
[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