php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80015 opcache.jit setting not documented
Submitted: 2020-08-24 15:05 UTC Modified: 2021-07-19 15:10 UTC
From: buschmann at nidsa dot net Assigned: cmb (profile)
Status: Closed Package: JIT
PHP Version: 8.0.0beta2 OS: Windows 10 Pro 64bit
Private report: No CVE-ID: None
 [2020-08-24 15:05 UTC] buschmann at nidsa dot net
Description:
------------
On my development machine I set the following configuration for JIT (no AVX available):

opcache.jit_buffer_size=16M
opcache.jit=0205

opcache-gui.php executes after apache start.

When prewarming some scripts from one of our applications PHP crashes with access violation.

One example line is:

$bresult=opcache_compile_file('N:\Apache\tcpdf\tcpdf.php');

On the server machine (with avx, jit=1205) our application runs fine (prewarming etc.)

The only solution on the dev machine was to disable JIT completely.

With disabled JIT our applications ran fine.


Environment:
- Windows 10 64bit Pro on Celeron G1840 (no AVX)
- 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:


CrashHangAnalysis





Report for httpd__PID__10696__Date__08_24_2020__Time_04_48_52PM__948__Second_Chance_Exception_C0000005.dmp





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



Faulting Thread




Entry point   libhttpd!ap_run_generate_log_id+3ab0 
Create time   24.08.2020 16:47:46 
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

php_opcache!zend_jit_trace_exit_is_hot+68 [C:\php-snap-build\php80\vs16\x64\php-8.0.0beta2-ts\ext\opcache\jit\zend_jit_trace.c @ 5458 + 4]     0000000`00000001     000022a`00000006     0001000`0041fb98     00000c4`3c7fd068   C:\php-snap-build\php80\vs16\x64\php-8.0.0beta2-ts\ext\opcache\jit\zend_jit_trace.c @ 5458 + 4 
php_opcache!zend_jit_trace_exit+a76 [C:\php-snap-build\php80\vs16\x64\php-8.0.0beta2-ts\ext\opcache\jit\zend_jit_trace.c @ 5827 + 47]     0001000`00000006     00000c4`3c7fd1b0     0000000`000000a5     000022a`8ba75300   C:\php-snap-build\php80\vs16\x64\php-8.0.0beta2-ts\ext\opcache\jit\zend_jit_trace.c @ 5827 + 47 
0x00001000`03000613     00000c4`3c7fd1b0     0000000`000000a5     000022a`8ba75300     0000000`00000003    
0x00001000`00000006     0000000`000000a5     000022a`8ba75300     0000000`00000003     000022a`8ba579bc    
0x000000c4`3c7fd1b0     000022a`8ba75300     0000000`00000003     000022a`8ba579bc     0000dd5`746e0848    
0x000000a5     0000000`00000003     000022a`8ba579bc     0000dd5`746e0848     0001000`0300083d    
0x0000022a`8ba75300     000022a`8ba579bc     0000dd5`746e0848     0001000`0300083d     000022a`8ba15370    
0x00000003     0000dd5`746e0848     0001000`0300083d     000022a`8ba15370     000022a`8ba15370    
0x0000022a`8ba579bc     0001000`0300083d     000022a`8ba15370     000022a`8ba15370     000022a`8ba15370    
0x00000dd5`746e0848     000022a`8ba15370     000022a`8ba15370     000022a`8ba15370     000022a`8a983120    
0x00001000`0300083d     000022a`8ba15370     000022a`8ba15370     000022a`8a983120     0000000`00000000    
0x0000022a`8ba15370     000022a`8ba15370     000022a`8a983120     0000000`00000000     000022a`8ba15300    
0x0000022a`8ba15370     000022a`8a983120     0000000`00000000     000022a`8ba15300     000022a`8b2092e0    
0x0000022a`8ba15370     0000000`00000000     000022a`8ba15300     000022a`8b2092e0     0000000`00000246    
0x0000022a`8a983120     000022a`8ba15300     000022a`8b2092e0     0000000`00000246     0000000`00000008    






CLR Information






Exception Information


PHP_OPCACHE!ZEND_JIT_TRACE_EXIT_IS_HOT+68In httpd__PID__10696__Date__08_24_2020__Time_04_48_52PM__948__Second_Chance_Exception_C0000005.dmp the assembly instruction at php_opcache!zend_jit_trace_exit_is_hot+68 in N:\Apache\php8\ext\php_opcache.dll from The PHP Group has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000006 on thread 99




Module Information 

Image Name: N:\Apache\php8\ext\php_opcache.dll   Symbol Type:  PDB 
Base address: 0x00000003`00905a4d   Time Stamp:  Wed Aug 19 00:50:02 2020  
Checksum: 0x00000000`00000000   Comments:  Thanks to Andi Gutmans, Zeev Suraski, Stanislav Malyshev, Dmitry Stogov, Xinchen Hui 
COM DLL: False   Company Name:  The PHP Group 
ISAPIExtension: False   File Description:  Opcache 
ISAPIFilter: False   File Version:  8.0.0beta2 
Managed DLL: False   Internal Name:  OPCACHE extension 
VB DLL: False   Legal Copyright:  Copyright © The PHP Group 
Loaded Image Name:  php_opcache.dll   Legal Trademarks:  PHP 
Mapped Image Name:     Original filename:  php_opcache.dll 
Module name:  php_opcache   Private Build:   
Single Threaded:  False   Product Name:  PHP 
Module Size:  1,5 MBytes   Product Version:  8.0.0beta2 
Symbol File Name:  n:\apache\php8_debug_b1\php_opcache.pdb   Special Build:  & 



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-24 16:29 UTC] cmb@php.net
-Summary: Access violation Crash of PHP 8 +Summary: opcache.jit setting not documented -Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem
 [2020-08-24 16:29 UTC] cmb@php.net
The meaning of opcache.jit is changed as of PHP 8.0.0beta1; now it
basically accepts "function", "tracing" (the default) and "off".
Since "0205" is no longer accepted, the default is used, and so
the crash has the same root cause as bug #80014.

I'm changing this to documentation problem, because the change of
opcache.jit doesn't seem to be documented.
 [2020-08-24 16:33 UTC] cmb@php.net
Well, that's not quite right.  The old numeric flags are still
supported, but "0205" is interpreted as actual, and as such
rejected.  You could use "205" instead.
 [2020-08-24 16:34 UTC] cmb@php.net
s/actual/octal/
 [2020-08-25 11:55 UTC] buschmann at nidsa dot net
I tried the solution with 

opcache.jit=205

and got 
[24-Aug-2020 14:47:46 UTC] PHP Warning:  Invalid "opcache.jit" setting. Should be "disable", "on", "off" or 4-digit number in Unknown on line 0

Setting it to 

opcache.jit=on

(on non AVX machine) resulted in

[Tue Aug 25 13:33:21.150470 2020] [mpm_winnt:notice] [pid 12728:tid 680] AH00428: Parent: child process 7524 exited with status 4294967295 -- Restarting.

Setting it to 

opcache.jit="on"

(on non AVX machine) resulted in

[Tue Aug 25 13:37:13.241891 2020] [mpm_winnt:notice] [pid 10180:tid 688] AH00428: Parent: child process 5420 exited with status 3221225477 -- Restarting.


Setting it to 

opcache.jit="off"

disabled it and apps are running fine.

IMHO it is really difficult to get our applications tested against PHP 8.

We as users are asked to test our software in the prerelease phase from alpha1 to RC5. But we have no information how to configure the new features.

Is there a beta version of the documentation containing the new configuration flags, the incompatibilities and deprecations and the new features?

For me it is even not clear if I should specify the value of opcache.jit in doublequotes or not.

The problem with not AVX-capable hardware still remains and is not transparent for the user.

Please provide the beta documentation or integrate the new stuff in https://www.php.net/docs.php

Thanks
 [2020-08-25 17:32 UTC] cmb@php.net
It's pretty strange that you get an error with opcache.jit=205;
that does exactly what it should for me.  The error message has
apparently not been updated since the latest changes, though.

Anyhow, it doesn't matter whether the INI value is enclosed in
double-quotes or not.

> Is there a beta version of the documentation containing the new
> configuration flags, the incompatibilities and deprecations and
> the new features?

All relevant information is supposed to be contained in
UPGRADING[1]; unfortunately, there is almost no info about the
JIT.

[1] <https://github.com/php/php-src/blob/php-8.0.0beta2/UPGRADING>
 [2021-07-19 15:10 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-07-19 15:10 UTC] cmb@php.net
The documentation has been written in the meantime:
<https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC