Bug #80014 [NEW]: PHP 8.0 beta2 crashes with default JIT flags due to hardware incompatibility

From: Date: Mon, 24 Aug 2020 14:44:37 +0000
Subject: Bug #80014 [NEW]: PHP 8.0 beta2 crashes with default JIT flags due to hardware incompatibility
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228737@lists.php.net to get a copy of this message
From:             buschmann at nidsa dot net
Operating system: Windows 10 Pro 64bit
PHP version:      8.0.0beta2
Package:          JIT
Bug Type:         Bug
Bug description:PHP 8.0 beta2 crashes with default JIT flags due to hardware incompatibility

Description:
------------
During the test of PHP 8 on all our applications I changed my
development machine from PHP 7.4.9 to PHP 8.

The overall configuration is the same as on the test server.

PHP crashes immediatly when running any script (opcache_gui.php for
example).

The configuration for JIT was as recommended:

opcache.jit_buffer_size=16M
opcache.jit=1205

In the apache error log the following showed up:

[Sun Aug 23 16:10:14.639607 2020] [mpm_winnt:notice] [pid 13272:tid 904]
AH00428: Parent: child process 12228 exited with status 3221225501 --
Restarting.

Error 3221225501 is 0xc000001d and means "Illegal instruction"

The root cause is that the crashing machine has no AVX instructions
available (Celeron G1840) and opcache.jit was set at 1205 where the "1"
indicates "enable AVX instruction generation" as mentioned in the WIKI.

It is quite common to encounter machines with no AVX instructions:
Celerons, ATOM, elder Server generations such as XEON x5570,
non-x86-architectures etc.

It should be possible to use the same configuration on different
hardware without a specific change.

The optimization parameter C=1 (enable AVX instruction generation)
should not always generate AVX-instructions, but only when they are
available in the hardware and otherwise fall back to non-AVX-JIT.

From the WIKI it is not clear, which AVX instruction set is used and
required for this optimization (AVX-1? or AVX2?, AVX512 can be ruled out
for now).

This error disappeared by setting opcache.jit=0205

PHP should detect the capabilities of the hardware before using
unsupported advanced CPU optimization Flags.


Environment:
- Windows 10 64bit Pro
- Apache 2.46 64bit from apachelounge
- php 8 beta2 64bit thread safe from php.net QA download
- php loaded as a module with php_module


Actual result:
--------------
Crash dump follows:


Report for
httpd__PID__10812__Date__08_24_2020__Time_04_00_39PM__171__Second_Chance_Exception_C000001D.dmp





Type of Analysis Performed Crash Analysis 
Machine Name WINHB16 
Operating System Windows 10 - 18363 
Number Of Processors 2 
Process ID 10812 
Process Image N:\Apache\Apache24\bin\httpd.exe 
Command Line httpd -X 
System Up-Time 9 day(s) 22:20:25 
Process Up-Time 00:01:26 
Processor Type X64 
Process Bitness 64-Bit 



Faulting Thread




Entry point   libhttpd!ap_run_generate_log_id+3ab0 
Create time   24.08.2020 15:59:14 
Time spent in user mode   0 Days 0:0:0.0 
Time spent in kernel mode   0 Days 0:0:0.0 






    Arg 1

    Arg 2

    Arg 3

    Arg 4

  Source

0x000010000300fe2e     000023724a95000     0000237`245e42e0    
000023724a95000     000023724a68000    
0x0000023724a15300     0000237245e42e0     0000237`24a95000    
000023724a68000     000000000000003    
0x0000023724a95000     000023724a95000     0000237`24a68000    
000000000000003     000000000000000    
0x00000237245e42e0     000023724a68000     0000000`00000003    
000000000000000     000000000000000    
0x0000023724a95000     000000000000003     0000000`00000000    
000000000000000     000023724a90660    
0x0000023724a68000     000000000000000     0000000`00000000    
000023724a90660     0000237245e42e0    
0x00000003     000000000000000     000023724a90660    
0000237245e42e0     000000000000000    






CLR Information






Exception Information


In
httpd__PID__10812__Date__08_24_2020__Time_04_00_39PM__171__Second_Chance_Exception_C000001D.dmp
the assembly instruction at 0x00001000`0300fe2e which does not
correspond to any known native module in the process has caused an
unknown exception (0xc000001d) on thread 98

-- 
Edit bug report at https://bugs.php.net/bug.php?id=80014&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80014&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80014&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80014&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80014&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80014&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80014&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80014&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80014&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80014&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80014&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80014&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80014&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80014&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80014&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80014&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80014&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80014&r=mysqlcfg


Thread (8 messages)

« previous php.bugs (#228737) next »