Skip to content

Core dumped with specific jit config #15820

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

Closed
YuanchengJiang opened this issue Sep 10, 2024 · 5 comments
Closed

Core dumped with specific jit config #15820

YuanchengJiang opened this issue Sep 10, 2024 · 5 comments

Comments

@YuanchengJiang
Copy link

Description

The following code:

<?php
//any php file

Resulted in this output:

/php-src/ext/opcache/jit/zend_jit.c:3199: int zend_jit_script(zend_script *): Assertion `0' failed.
Aborted (core dumped)

To reproduce:

-d "extension_dir=/php-src/modules/" -d "zend_extension=/php-src/modules/opcache.so" -d "opcache.enable=1" -d "opcache.enable_cli=1" -d "opcache.jit=1245"

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

@YuanchengJiang
Copy link
Author

when -d "opcache.jit=1044":

/php-src/ext/opcache/jit/zend_jit.c:3119: int zend_jit_op_array(zend_op_array *, zend_script *): Assertion `0' failed.
Aborted (core dumped)

@cmb69
Copy link
Member

cmb69 commented Sep 10, 2024

Given the relatively high amount of bug reports regarding advanced JIT configuration (besides this ticket also #15821, #15662, #15657, and maybe more), I wonder whether we should explicitly document these advanced JIT settings as being experimental?

By the way, the documentation on Trigger 4 says it would be "currently unused", but is documented in zend_jit.h says compile functions with "@jit" tag in doc-comments. Maybe we should update the documentation, telling what it is supposed to do, but that this is not yet implemented. I wonder though, whether T=4 is treated as T=0 or what actually happens.

@YuanchengJiang
Copy link
Author

@cmb69 good point, I am also conservative when reporting such bugs, let me know if it is a global document problem or it is expected or if we don't care about such weird JIT errors

@cmb69
Copy link
Member

cmb69 commented Sep 10, 2024

Maybe @dstogov and/or @iluuu1994 can comment about the usage of advanced JIT configuration (i.e. opcache.jit anything other than on, off, function or tracing).

@iluuu1994
Copy link
Member

By the way, the documentation on Trigger 4 says it would be "currently unused", but is documented in zend_jit.h says compile functions with "@jit" tag in doc-comments.

I think this was never implemented. I'm not sure if there are any plans to do that, and if there would even be a benefit to it.

Regarding config, IMO it would make sense to simplify the JIT settings. It's doubtful many people are qualified to pick sensible settings, as they are quite cryptic for non-JIT specialists. Fewer special settings should reduce bugs and simplify the code.

dstogov added a commit that referenced this issue Sep 10, 2024
* PHP-8.2:
  Fix GH-15820: Core dumped with jit.opcache=1245
dstogov added a commit that referenced this issue Sep 10, 2024
* PHP-8.3:
  Fix GH-15820: Core dumped with jit.opcache=1245
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

4 participants