Bug #73668 [Opn->Csd]: "SIGFPE Arithmetic exception" in opcache when divide by minus 1

From: Date: Tue, 06 Dec 2016 21:26:50 +0000
Subject: Bug #73668 [Opn->Csd]: "SIGFPE Arithmetic exception" in opcache when divide by minus 1
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205811@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73668&edit=1

 ID:                 73668
 Updated by:         nikic@php.net
 Reported by:        richardh at channelgrabber dot com
 Summary:            "SIGFPE Arithmetic exception" in opcache when divide
                     by minus 1
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            opcache
 Operating System:   Ubuntu 14.04.1 LTS
 PHP Version:        7.1.0
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=76c4a3db080e347663a3999ae38b78cf26dd4c84
Log: Fix bug #73668


Previous Comments:
------------------------------------------------------------------------
[2016-12-06 12:44:54] richardh at channelgrabber dot com

Description:
------------
We recently switched to PHP 7.1.0 and noticed that when https://github.com/Setasign/FPDF/blob/master/fpdf.php
was included it caused PHP to exit with SIGFPE.

We installed the debug symbols and ran it through GDB a few times, reducing the issue down to lines
901 and 902 (https://github.com/Setasign/FPDF/blob/master/fpdf.php#L901).

From this we created the reduced test case attached below.

The backtrace from the error is:
#0  0x00007ffff5b069a7 in zend_inference_calc_range (op_array=op_array@entry=0x7ffff6075008,
ssa=ssa@entry=0x7ffff6097028, var=var@entry=1, 
    widening=widening@entry=0, narrowing=narrowing@entry=1, tmp=tmp@entry=0x7fffffffa7f0)
    at /build/php7.1-kMIlXM/php7.1-7.1.0/ext/opcache/Optimizer/zend_inference.c:727
#1  0x00007ffff5b0c21f in zend_infer_ranges (op_array=op_array@entry=0x7ffff6075008,
ssa=ssa@entry=0x7ffff6097028)
    at /build/php7.1-kMIlXM/php7.1-7.1.0/ext/opcache/Optimizer/zend_inference.c:1954
#2  0x00007ffff5b133f3 in zend_ssa_inference (arena=arena@entry=0x7fffffffa960,
op_array=op_array@entry=0x7ffff6075008, script=0x7ffff6075000, 
    ssa=ssa@entry=0x7ffff6097028) at
/build/php7.1-kMIlXM/php7.1-7.1.0/ext/opcache/Optimizer/zend_inference.c:4181
#3  0x00007ffff5afb7f7 in zend_dfa_analyze_op_array (op_array=0x7ffff6075008,
ctx=ctx@entry=0x7fffffffa960, ssa=0x7ffff6097028, flags=0x7ffff6097024)
    at /build/php7.1-kMIlXM/php7.1-7.1.0/ext/opcache/Optimizer/dfa_pass.c:106
#4  0x00007ffff5aef7e7 in zend_optimize_script (script=script@entry=0x7ffff6075000,
optimization_level=2147467263, debug_level=0)
    at /build/php7.1-kMIlXM/php7.1-7.1.0/ext/opcache/Optimizer/zend_optimizer.c:967
#5  0x00007ffff5adf1c4 in cache_script_in_shared_memory (from_shared_memory=<synthetic
pointer>, key_length=22, 
    key=0x7ffff5d2e6cc <accel_globals+556> "test.php:223344:223384",
new_persistent_script=0x7ffff6075000)
    at /build/php7.1-kMIlXM/php7.1-7.1.0/ext/opcache/ZendAccelerator.c:1271
#6  persistent_compile_file (file_handle=<optimized out>, type=8) at
/build/php7.1-kMIlXM/php7.1-7.1.0/ext/opcache/ZendAccelerator.c:1863
#7  0x00007ffff589ff9d in xdebug_compile_file (file_handle=<optimized out>, type=<optimized
out>) at /build/xdebug-_hXbf9/xdebug-2.5.0/build-7.1/xdebug.c:2153
#8  0x00005555557b469d in zend_execute_scripts ()
#9  0x0000555555754b18 in php_execute_script ()
#10 0x000055555584e1c9 in ?? ()
#11 0x000055555563d92f in main ()


Test script:
---------------
<?php
$a/-1;




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=73668&edit=1


Thread (3 messages)

« previous php.bugs (#205811) next »