Bug #79336 [Opn->Csd]: ext/exif/tests/bug79046.phpt fails on Big endian arch

From: Date: Thu, 16 Apr 2020 10:19:29 +0000
Subject: Bug #79336 [Opn->Csd]: ext/exif/tests/bug79046.phpt fails on Big endian arch
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226606@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79336&edit=1 ID: 79336 Updated by: nikic@php.net Reported by: vibhutisawant18 at gmail dot com Summary: ext/exif/tests/bug79046.phpt fails on Big endian arch -Status: Open +Status: Closed Type: Bug Package: EXIF related Operating System: Ubuntu 16.04 PHP Version: master-Git-2020-03-03 (Git) Block user comment: N Private report: N New Comment: Automatic comment on behalf of nikita.ppv@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=0b709e3409a1899caa6aaf3a5442e83524e2355c Log: Fix bug #79336 Previous Comments: ------------------------------------------------------------------------ [2020-03-30 11:31:38] cmb@php.net Related To: Bug #79430 ------------------------------------------------------------------------ [2020-03-30 11:31:38] cmb@php.net Related To: Bug #79430 ------------------------------------------------------------------------ [2020-03-25 05:50:11] vibhutisawant18 at gmail dot com @nikic following observations were made wrt the TC behaviour on Big endian System(s390x) char data type is signed(-128 to 127) by default on x86 arch whereas char is treated as unsigned(0 to 255) on s390x. In function static float php_ifd_get_float(char *data) of php-src/ext/exif/exif.c ,the 3rd byte (data[2]) is referring to -8(Hex: fffffff8 ),where as its referred to 248 (Hex: f8) on s390x as char is treated as unsigned char. Hence byte swap won't solve the issue, could you please guide us on what could possibly help to tackle the above scenario? ------------------------------------------------------------------------ [2020-03-09 05:57:40] vibhutisawant18 at gmail dot com I added a byte swap in php_ifd_get_float() and php_ifd_get_double(), however same behavior continues to persist. Could you please provide with some more insights. ------------------------------------------------------------------------ [2020-03-03 10:45:48] nikic@php.net You likely need to introduce a byte-swap into php_ifd_get_float() and php_ifd_get_double() on big-endian architectures. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=79336 -- Edit this bug report at https://bugs.php.net/bug.php?id=79336&edit=1

« previous php.bugs (#226606) next »