Bug #75864 [NEW]: "stream_isatty" returns wrong value on s390x
| From: | samding at ca dot ibm dot com | Date: | Tue, 23 Jan 2018 18:38:12 +0000 |
| Subject: | Bug #75864 [NEW]: "stream_isatty" returns wrong value on s390x | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-213679@lists.php.net to get a copy of this message | ||
From: samding at ca dot ibm dot com
Operating system: RHEL 7.2
PHP version: 7.2.1
Package: Streams related
Bug Type: Bug
Bug description:"stream_isatty" returns wrong value on s390x
Description:
------------
Test cases
Test stream_isatty with redirected STDERR
[tests/output/stream_isatty_err.phpt]
Test stream_isatty with redirected STDIN/STDERR
[tests/output/stream_isatty_in-err.phpt]
Test stream_isatty with redirected STDIN/STDOUT
[tests/output/stream_isatty_in-out.phpt]
Test stream_isatty with redirected STDOUT
[tests/output/stream_isatty_out.phpt]
Test stream_isatty with redirected STDOUT/STDERR
[tests/output/stream_isatty_out-err.phpt]
Failed on s390x.
Test script:
---------------
Here is sample php code:
<?php
$closeMe = fopen(__FILE__, 'rb');
$tmp=stream_isatty($closeMe);
echo "closeme=$closeMe, stream_isatty=$tmp+\n";
echo "closeMe:"; var_dump(stream_isatty($closeMe));
gdb sapi/cli/php
(gdb) b zif_stream_isatty
(gdb) r case/sample.php
...
1651 RETVAL_BOOL(isatty(fileno));
(gdb) p fileno
$1 = 34359718632
(gdb) x /8b &fileno
0x3ffffffb360: 0 0 0 7 -1 -1 -78
-24
Seems the last 4 bytes of "fileno" wrong on s390x (Big_Endian)
--
Edit bug report at https://bugs.php.net/bug.php?id=75864&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75864&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75864&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75864&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75864&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75864&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75864&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75864&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75864&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75864&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75864&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75864&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75864&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75864&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75864&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75864&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75864&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75864&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75864&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75864&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75864&r=mysqlcfg