Bug #79595 [Csd]: zend_init_fpu() alters FPU precision

From: Date: Tue, 26 May 2020 16:23:41 +0000
Subject: Bug #79595 [Csd]: zend_init_fpu() alters FPU precision
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227181@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79595&edit=1 ID: 79595 User updated by: v-yitam at microsoft dot com Reported by: v-yitam at microsoft dot com Summary: zend_init_fpu() alters FPU precision Status: Closed Type: Bug Package: Math related Operating System: Alpine Linux PHP Version: 7.4.5 Assigned To: cmb Block user comment: N Private report: N New Comment: > Note that the fix missed the deadline for PHP 7.4.7, so will have to wait for PHP 7.4.8 (roughly mid July). No worries. We will jot it down. A brief testing shows that the new fix works. Thank you all! Previous Comments: ------------------------------------------------------------------------ [2020-05-26 15:24:31] cmb@php.net Note that the fix missed the deadline for PHP 7.4.7, so will have to wait for PHP 7.4.8 (roughly mid July). ------------------------------------------------------------------------ [2020-05-26 15:22:08] cmb@php.net Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=879004dae325e50d3e1a8f9477e66cdfeef0d366 Log: Fix #79595: zend_init_fpu() alters FPU precision ------------------------------------------------------------------------ [2020-05-26 07:03:48] cmb@php.net Thanks for checking, and yes, this was helpful! I had forgotten to add the guard to that #elif[1]. [1] <https://github.com/php/php-src/pull/5621/commits/c3fe3f7424b7e9a793ef4b55f197de9e2b6593af> ------------------------------------------------------------------------ [2020-05-25 17:15:17] v-yitam at microsoft dot com Thank you all for working hard on fixing this issue. I just tested the new proposed fix but unfortunately it didn't work in Alpine Linux. I added the following 'debugging' lines in zend_float.c: ZEND_API void zend_init_fpu(void) /* {{{ */ { int x = -1; #if defined(HAVE__CONTROLFP_S) && !defined(__x86_64__) x = 1; #elif defined(HAVE__CONTROLFP) && !defined(__x86_64__) x = 2; #elif defined(HAVE__FPU_SETCW) && !defined(__x86_64__) x = 3; #elif defined(HAVE_FPSETPREC) && !defined(__x86_64__) x = 4; #elif defined(HAVE_FPU_INLINE_ASM_X86) x = 5; #else x = 0; #endif Then I ran the debugger: Breakpoint 1, zend_init_fpu () at /home/jennyt/php-7.4.6/Zend/zend_float.c:24 24 { (gdb) s 25 int x = -1; (gdb) s 36 x = 5; (gdb) Hope this helps! ------------------------------------------------------------------------ [2020-05-25 08:41:01] cmb@php.net The fix had to be reverted due to unforeseen issues on i386. PR #5621 is hopefully a better fix. ------------------------------------------------------------------------ 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=79595 -- Edit this bug report at https://bugs.php.net/bug.php?id=79595&edit=1

« previous php.bugs (#227181) next »