[PHP-GTK-DEV] #41875 [NEW]: io_add_watch can't detect HUPs
by Sebastianmarconi At Gmail Dot Com other posts by this author
Jul 2 2007 12:04PM messages near this date
Re: [PHP-GTK-DEV] Bug and fix for GtkScintilla on Linux
|
[PHP-GTK-DEV] #41875 [Bgs]: io_add_watch can't detect HUPs
From: sebastianmarconi at gmail dot com
Operating system: Windows XP
PHP version: 5.2.3
PHP Bug Type: PHP-GTK related
Bug description: io_add_watch can't detect HUPs
Description:
------------
It seems that Gtk::io_add_watch
can't detect HUP conditions using
beta Windows binary with Gtk+ 2.10.
In some cases the only workaround that I've found is to look the process
status info [1] in the STDOUT callback (sometimes it sends IO_IN signals
constantly), but randomly losses some information.
[1]
<?php
$status = proc_get_status($proc_id);
if (! $status['running']) {
$this-> io_hup($pipe);
}
?>
Reproduce code:
---------------
<?php
function out($pipe) {
echo "STDOUT\n";
echo stream_get_contents($pipe);
}
function hup($pipe){
echo "HUP\n";
Gtk::main_quit();
return false;
}
$pipes = null;
$descriptor = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout is a pipe that the child will
write to
2 => array("pipe", "w") // stderr
);
$cmd = 'dir';
$p = proc_open($cmd, $descriptor, $pipes);
Gtk::io_add_watch($pipes[1],Gtk::IO_IN, 'out');
Gtk::io_add_watch($pipes[1],Gtk::IO_HUP, 'hup');
Gtk::main();
echo "EXIT\n";
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
?>
Expected result:
----------------
STDOUT
[Dir contents]
HUP
EXIT
Actual result:
--------------
STDOUT
[The script hangs]
--
Edit bug report at http://bugs.php.net/?id=41875&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41875&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41875&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41875&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41875&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41875&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41875&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41875&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41875&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41875&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41875&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41875&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41875&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41875&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41875&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41875&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41875&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41875&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41875&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41875&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41875&r=mysqlcfg
--
PHP-GTK Development Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Sebastianmarconi At Gmail Dot Com
Sebastianmarconi At Gmail Dot Com
auroraeosrose
Bob At Kateos Dot Org
|