From:             alexmontoanelli at gmail dot com
Operating system: Linux
PHP version:      5.2.10
PHP Bug Type:     PCNTL related
Bug description:  Signals not catcable when certain functions are in execution

Description:
------------
After executions of certain functions,
the handler configured by
posix_singal, are not called where the 
funcion are in execution - like freads.

Reproduce code:
---------------
#!/usr/bin/php
<?php

declare(ticks = 1);

function handler($a){
    echo "Calling handler on signal :  $a\n";
}

//define handlers for signals
pcntl_signal(SIGTERM, 'handler');
pcntl_signal(SIGINT, 'handler');

//if you send a signal, the function fgets are waiting for a user input,
he is not called, until you enter something
$foo = fgets(STDIN);

echo $foo;


Expected result:
----------------
alexmm tmp # php a.php 
^C
Calling handler on signal :  2


Actual result:
--------------
alexmm tmp # php a.php 
^C MY_INPUT_AFTER_SEND_CTRL_C
Calling handler on signal :  2
 MY_INPUT_AFTER_SEND_CTRL_C

-- 
Edit bug report at http://bugs.php.net/?id=49340&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=49340&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=49340&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=49340&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=49340&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=49340&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=49340&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=49340&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=49340&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=49340&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=49340&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=49340&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=49340&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=49340&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=49340&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49340&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49340&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=49340&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=49340&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=49340&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=49340&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=49340&r=mysqlcfg

Reply via email to