Bug #79336 [NEW]: ext/exif/tests/bug79046.phpt fails on Big endian arch
| From: | vibhutisawant18 at gmail dot com | Date: | Tue, 03 Mar 2020 10:40:51 +0000 |
| Subject: | Bug #79336 [NEW]: ext/exif/tests/bug79046.phpt fails on Big endian arch | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225852@lists.php.net to get a copy of this message | ||
From: vibhutisawant18 at gmail dot com
Operating system: Ubuntu 16.04
PHP version: master-Git-2020-03-03 (Git)
Package: EXIF related
Bug Type: Bug
Bug description:ext/exif/tests/bug79046.phpt fails on Big endian arch
Description:
------------
NaN to int cast undefined behavior in exif
[ext/exif/tests/bug79046.phpt]
Above TC fails on big endian architecture, the expected value for
StripOffsets is NAN whereas that returned on Big endian is
float(8.9143601808023E-41)
Could you please guide us on how to go about it.
PFA test case logs on Little and Big endian Architecture.
Little Endian:
test@a2a9ec71b826:~/php/php-src$ ./sapi/cli/php -f
"ext/exif/tests/bug79046.phpt"
--TEST--
Bug #79046: NaN to int cast undefined behavior in exif
--FILE--
array(8) {
["FileDateTime"]=>
int(0)
["FileSize"]=>
int(33)
["FileType"]=>
int(8)
["MimeType"]=>
string(10) "image/tiff"
["SectionsFound"]=>
string(24) "ANY_TAG, IFD0, THUMBNAIL"
["COMPUTED"]=>
array(2) {
["IsColor"]=>
int(0)
["ByteOrderMotorola"]=>
int(1)
}
["StripOffsets"]=>
float(NAN)
["THUMBNAIL"]=>
array(1) {
["StripOffsets"]=>
float(NAN)
}
}
Big endian:
--TEST--
Bug #79046: NaN to int cast undefined behavior in exif
--FILE--
array(8) {
["FileDateTime"]=>
int(0)
["FileSize"]=>
int(33)
["FileType"]=>
int(8)
["MimeType"]=>
string(10) "image/tiff"
["SectionsFound"]=>
string(24) "ANY_TAG, IFD0, THUMBNAIL"
["COMPUTED"]=>
array(2) {
["IsColor"]=>
int(0)
["ByteOrderMotorola"]=>
int(1)
}
["StripOffsets"]=>
float(8.9143601808023E-41)
["THUMBNAIL"]=>
array(1) {
["StripOffsets"]=>
float(8.9143601808023E-41)
}
}
--
Edit bug report at https://bugs.php.net/bug.php?id=79336&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79336&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79336&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79336&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79336&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79336&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79336&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79336&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79336&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79336&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79336&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79336&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79336&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79336&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79336&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79336&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79336&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79336&r=mysqlcfg