Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opcache.jit=1211 in php.ini causes apache to crash #9105

Closed
Sophist-UK opened this issue Jul 22, 2022 · 8 comments
Closed

opcache.jit=1211 in php.ini causes apache to crash #9105

Sophist-UK opened this issue Jul 22, 2022 · 8 comments

Comments

@Sophist-UK
Copy link

Description

I tried to configure JIT with opcache.jit=1211 in php.ini and although I could successfully do a CLI php -i, when trying to load a php webpage through apache caused apache to crash.

Commenting this out (and falling back to opcache.jit=tracing made JIT work.

PHP Version

8.1.7

Operating System

Windows 10 / Apache 2.4.54

@cmb69
Copy link
Member

cmb69 commented Jul 23, 2022

I cannot reproduce this with php-8.1.7-Win32-vs16-x64. A stack backtrace might be helpful to figure out the root cause of the crash. Also any more relevant details about which script/application you are running (ideally a minimal reproduce script).

@Sophist-UK
Copy link
Author

Sophist-UK commented Jul 23, 2022

Here in my php.ini. You will see where I have commented out opcache.jit=1211.

I don't get a crash running php from the command line, only from Apache. Uncommenting this one line causes a crash.

php.ini.zip

P.S. Sorry - but the running a stack-trace is too much effort.

@cmb69
Copy link
Member

cmb69 commented Jul 23, 2022

Okay, I still cannot reproduce with a similar php.ini. Does it crash if you disable Xdebug (don't load it at all)?

@Sophist-UK
Copy link
Author

Hmmm. I tried this twice with both ;zend_extension=xdebug commented out and opcache.jit=1211 not commented out - one time it crashed the next time it worked.

@cmb69
Copy link
Member

cmb69 commented Jul 25, 2022

Hmmm. I tried this twice with both ;zend_extension=xdebug commented out and opcache.jit=1211 not commented out - one time it crashed the next time it worked.

Is opcache.file_cache involved? If so, delete the respective folder and try again. If it still fails only sometimes, that may explain why I couldn't reproduce, but it would be even harder to debug.

@Sophist-UK
Copy link
Author

No. They were being held in memory because there were no files in the opcache folder.

@cmb69
Copy link
Member

cmb69 commented Jul 26, 2022

Okay. That still might explain the different outcome. As is, apache2handler on Windows (assuming mpm_winnt) creates the shared memory for OPcache, and than tries to re-attach once. If the re-attaching fails, no OPcache is used at all. This is why we generally recommend to use the file_cache as backup mechanism. Of course, this info doesn't really help to resolve the issue at hand. :(

@cmb69 cmb69 removed their assignment Jul 26, 2022
@nielsdos
Copy link
Member

This ticket is unactionable right now. There have been countless fixes to opcache & jit since this, and there's even an entirely new JIT engine in PHP 8.4. Please retry on PHP 8.3 or higher. I'll close this now, if you still experience this and have more information please place a comment and we can reopen.

@nielsdos nielsdos closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants