#44683 [Opn->Fbk]: popen with modes such as "e" or "er" cause php.exe to crash

From: Date: Sat, 12 Apr 2008 01:19:33 +0000
Subject: #44683 [Opn->Fbk]: popen with modes such as "e" or "er" cause php.exe to crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-124169@lists.php.net to get a copy of this message
 ID:               44683
 Updated by:       jani@php.net
 Reported By:      d_kelsey at uk dot ibm dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: Windows XP
 PHP Version:      5.2.5
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

And if it stil crashes, provide a backtrace. 


Previous Comments:
------------------------------------------------------------------------

[2008-04-10 11:58:45] d_kelsey at uk dot ibm dot com

opps, looks like modes supplemented with b should also work on linux.

------------------------------------------------------------------------

[2008-04-10 11:51:18] d_kelsey at uk dot ibm dot com

One thing I missed, on windows you should be able to specify b or t as
a supplement to r and w, ie rb, rt, wb, wt, so modes of 2 characters
should be allowed on windows.

------------------------------------------------------------------------

[2008-04-10 11:43:38] d_kelsey at uk dot ibm dot com

Description:
------------
trying different modes on php.exe on windows. I tried "e" and "er".
Both cause php to crash. a mode of "re" works.
This is also different from linux where it seems that only "r" or "w"
are valid modes. Anything else or more than 1 character result in a php
warning of invalid argument.

Reproduce code:
---------------
<?php
$t1 = popen("echo hello", "e");
pclose($t1);
$t2 = popen("echo hello", "re");
pclose($t2);
$t3 = popen("echo hello", "er");
pclose($t3);
?>

Expected result:
----------------
Expected output would be the same as linux.
Warning: popen(echo hello,e): Invalid argument in
/data/workspace/phpcode/popen/badpopen.php on line 2

Warning: popen(echo hello,re): Invalid argument in
/data/workspace/phpcode/popen/badpopen.php on line 4

Warning: popen(echo hello,er): Invalid argument in
/data/workspace/phpcode/popen/badpopen.php on line 6


Actual result:
--------------
Windows crashes on "e" and "er" but allows "re"


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44683&edit=1



Thread (14 messages)

« previous php.bugs (#124169) next »