#47192 [NEW]: gethostbyname is not interruptible by signals
| From: | fmassei at gmail dot com | Date: | Thu, 22 Jan 2009 18:13:38 +0000 |
| Subject: | #47192 [NEW]: gethostbyname is not interruptible by signals | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-133163@lists.php.net to get a copy of this message | ||
From: fmassei at gmail dot com
Operating system: linux
PHP version: 5.2.8
PHP Bug Type: *Network Functions
Bug description: gethostbyname is not interruptible by signals
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 bug report at http://bugs.php.net/?id=47192&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47192&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47192&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47192&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47192&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47192&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47192&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47192&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47192&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47192&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47192&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47192&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47192&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47192&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47192&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47192&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47192&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47192&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47192&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47192&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47192&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47192&r=mysqlcfg