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

Reply via email to