#36187 [Bgs]: PHP-CLI does not return int exit status set by exit()
ID: 36187 User updated by: volker at puttrich dot net Reported By: volker at puttrich dot net Status: Bogus Bug Type: CGI related Operating System: Debian Sarge PHP Version: 5.1.2 New Comment: Thank you for your reply ... I must admit that your example does work. And I'm sorry, because even my own example works as one would expect. I didn't try it myself, because I assumed that it would NOT work. I'm using pretty much the same code in a larger application where it definately does NOT work. In that application I'm working a lot with 'exec()' and 'system()' and also using IO redirections. It might have to do with that, but I have not yet been able to isolate the real cause from within a smaller context. So for now I'd say that you can close the issue. As soon as I know where the problem comes from, and it has to do with PHP, I'd happily re-open this issue if you don't mind. Again, I'm really sorry that I wasted your time just because I made big mistake. PHP-CLI is somewhat cool and I hope it will replace Perl some day, on Unix-like OS. Thanks for making it... - Volker Previous Comments: [2006-01-29 16:12:55] [EMAIL PROTECTED] Works fine for me: # php t.php ; echo $? 222 t.php: ?php exit(222); ? [2006-01-28 05:24:46] volker at puttrich dot net Description: The CLI version of PHP does not return the integer exit status to the shell when using 'exit(integer);' from within the script. PHP will always return 0 (or 255 probably). The manual says that it would do. Calling 'exit(string);' (with a string as parameter) it works as expected and as mentioned in the manual. Reproduce code: --- This is what I'm trying to do: file1.php - ? system(php ./file2.php, $rv); fwrite(STDOUT, $rv.\n); system(php ./file2.php -- -param, $rv); fwrite(STDOUT, $rv.\n); ? file2.php - ? if($argc 2) exit(1); else exit(0); ? Expected result: Execute: # php ./file1.php Output should be: 1 0 Actual result: -- Buggy result is: 0 0 -- Edit this bug report at http://bugs.php.net/?id=36187edit=1
#36187 [NEW]: PHP-CLI does not return int exit status set by exit()
From: volker at puttrich dot net Operating system: Debian Sarge PHP version: 5.1.2 PHP Bug Type: CGI related Bug description: PHP-CLI does not return int exit status set by exit() Description: The CLI version of PHP does not return the integer exit status to the shell when using 'exit(integer);' from within the script. PHP will always return 0 (or 255 probably). The manual says that it would do. Calling 'exit(string);' (with a string as parameter) it works as expected and as mentioned in the manual. Reproduce code: --- This is what I'm trying to do: file1.php - ? system(php ./file2.php, $rv); fwrite(STDOUT, $rv.\n); system(php ./file2.php -- -param, $rv); fwrite(STDOUT, $rv.\n); ? file2.php - ? if($argc 2) exit(1); else exit(0); ? Expected result: Execute: # php ./file1.php Output should be: 1 0 Actual result: -- Buggy result is: 0 0 -- Edit bug report at http://bugs.php.net/?id=36187edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36187r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36187r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36187r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36187r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36187r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36187r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=36187r=needscript Try newer version:http://bugs.php.net/fix.php?id=36187r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36187r=support Expected behavior:http://bugs.php.net/fix.php?id=36187r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36187r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36187r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36187r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36187r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36187r=dst IIS Stability:http://bugs.php.net/fix.php?id=36187r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36187r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36187r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36187r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=36187r=mysqlcfg
#31468 [NEW]: Calling sequence getMyUid() - get_current_user() crashes PHP
From: volker at puttrich dot net Operating system: Win2k SP4 PHP version: 5.0.2 PHP Bug Type: Reproducible crash Bug description: Calling sequence getMyUid() - get_current_user() crashes PHP Description: Calling functions getMyUid() followed by get_current_user(), or vice versa, crashes the following environment... Server software as reported by PHP: Apache/2.0.52 (Win32) mod_perl/1.99_16 Perl/v5.8.4 PHP/5.0.2 mod_ssl/2.0.52 OpenSSL/0.9.7d mod_python/3.1.3 Python/2.3.3 The OS used is Win2k SP4 including all available patches. NOTE: The crash also occurs when get_current_user() is used in combination with getMyGid(), getMyPid() and probably other related functions. Reproduce code: --- ?php echo(Crash testbr /\n); $sUser = get_current_user(); $nUID = getmyuid(); echo(Result, get_current_user(): . $sUser . / . $nUID); ? Expected result: Crash test Result, get_current_user(): SYSTEM / 0 -- Edit bug report at http://bugs.php.net/?id=31468edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31468r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31468r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31468r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=31468r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=31468r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31468r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31468r=needscript Try newer version: http://bugs.php.net/fix.php?id=31468r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31468r=support Expected behavior: http://bugs.php.net/fix.php?id=31468r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31468r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31468r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=31468r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31468r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=31468r=dst IIS Stability: http://bugs.php.net/fix.php?id=31468r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31468r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31468r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31468r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31468r=mysqlcfg
#31468 [Opn]: Calling sequence getMyUid() - get_current_user() crashes PHP
ID: 31468 User updated by: volker at puttrich dot net Reported By: volker at puttrich dot net Status: Open Bug Type: Reproducible crash Operating System: Win2k SP4 PHP Version: 5.0.2 New Comment: Sorry, but I made a mistake when I was analyzing this bug. The crash will always happen as soon as the function get_current_user() is called. It doesn't have to do anything with the other functions I mentioned above. The problem I've had seemed to be Apache, which takes forever to restart on my machine. Therefore I got a little bit confused when commenting out certain lines of code. You may close this report if you wish to. I think there is another report regarding the crash with get_current_user() - maybe you should reopen it, if closed, since the bug is still there. Sorry again... Previous Comments: [2005-01-10 12:10:02] volker at puttrich dot net Description: Calling functions getMyUid() followed by get_current_user(), or vice versa, crashes the following environment... Server software as reported by PHP: Apache/2.0.52 (Win32) mod_perl/1.99_16 Perl/v5.8.4 PHP/5.0.2 mod_ssl/2.0.52 OpenSSL/0.9.7d mod_python/3.1.3 Python/2.3.3 The OS used is Win2k SP4 including all available patches. NOTE: The crash also occurs when get_current_user() is used in combination with getMyGid(), getMyPid() and probably other related functions. Reproduce code: --- ?php echo(Crash testbr /\n); $sUser = get_current_user(); $nUID = getmyuid(); echo(Result, get_current_user(): . $sUser . / . $nUID); ? Expected result: Crash test Result, get_current_user(): SYSTEM / 0 -- Edit this bug report at http://bugs.php.net/?id=31468edit=1