Bug #80422 [Asn]: php_opcache.dll crashes when using Apache 2.4 with JIT
| From: | dmitry@php.net | Date: | Wed, 13 Jan 2021 06:12:39 +0000 |
| Subject: | Bug #80422 [Asn]: php_opcache.dll crashes when using Apache 2.4 with JIT | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231523@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80422&edit=1
ID: 80422
Updated by: dmitry@php.net
Reported by: martin at radiok2r dot de
Summary: php_opcache.dll crashes when using Apache 2.4 with
JIT
Status: Assigned
Type: Bug
Package: JIT
Operating System: Windows 10 64-bit
PHP Version: 8.0.0
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
I wasn't able to reproduce the crash on test case from @martin.
Is it crashes on very first request (after web server start)?
I need a well reproducible test case to analyse and fix this.
Better, if it possible to reproduce the crash with CLI PHP (without Apache).
However, the problem may be especially related to Apache SAPI (ZTS or Windows ASLR).
Previous Comments:
------------------------------------------------------------------------
[2021-01-13 02:30:15] louisowen at me dot com
same situation,hope this bug can be solved quickly.
------------------------------------------------------------------------
[2020-12-14 15:49:47] martin at radiok2r dot de
Thanks for your reply and all your hints!
It all works with opcache.jit=1205 without problems.
Without opcache.jit=1205 (no setting for opcache.jit at all in the php.ini) this php-code crashes:
<?php
print "Hello world\r\n";
print $_SERVER["DOCUMENT_ROOT"]."\r\n";
for ($i = 0; $i < 100; $i++)
{ $b = file_exists($_SERVER["DOCUMENT_ROOT"]."/index.php");
}
print "It worked";
When reducing the loop to run 50 times it works, but 100 times is too much and it crashes.
Hope this helps.
------------------------------------------------------------------------
[2020-12-14 13:42:57] dmitry@php.net
Also try to reproduce the same problem with opcache.jit=1205. If you see the same crash, try to
isolate the problem with opcache.jit=1205 (it should be easier).
------------------------------------------------------------------------
[2020-12-14 13:39:11] dmitry@php.net
Check what page causes the crash.
Try to reproduce the same crash, passing the script and CGI environment variables command line PHP
(or PHP-CGI).
If the application doesn't use external resources (DB, etc) and doesn't contain sensitive
data, you may just pack and send it to me (with instruction, how to reproduce the crash).
Otherwise, you need to track down to the problem yourself... You may catch the crash in debugger and
check the PHP source position printing
(char*)executor_globals.current_execute_data->func->op_array.function_name.val and
executor_globals.current_execute_data->opline->lineno. Then try to isolate the function(s)
involved into crash. This is not a simple task...
------------------------------------------------------------------------
[2020-12-14 13:34:20] martin at radiok2r dot de
I tried to debug the process httpd by VS -> Debug -> Attach to Process.
There are 2 httpd-processes, and I get for the first:
php_opcache.dll!zend_jit_trace_exit_is_hot(unsigned int trace_num, unsigned int exit_num) Line
6916 C
php_opcache.dll!zend_jit_trace_exit(unsigned int exit_num, Line 7343 C
[External Code]
php8ts.dll!00007ffaa0225d88() Unknown
And for the second:
ntdll.dll!KiRaiseUserExceptionDispatcher() Unknown
KernelBase.dll!00007ffacf202cb5() Unknown
libapr-1.dll!00000000569d88bd() Unknown
libapr-1.dll!00000000569d8752() Unknown
mod_socache_shmcb.so!00007ffaa1f5169c() Unknown
mod_ssl.so!00007ffaa1f25382() Unknown
mod_ssl.so!00007ffaa1f15b57() Unknown
libapr-1.dll!00000000569ce24e() Unknown
httpd.exe!00007ff7ea281c6c() Unknown
httpd.exe!00007ff7ea282fa4() Unknown
[External Code]
Thanks for looking into this!
------------------------------------------------------------------------
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=80422
--
Edit this bug report at https://bugs.php.net/bug.php?id=80422&edit=1