-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Constants in Enum classes causes php-fpm worker to segfault #8133
Comments
I cannot reproduce the segfault (PHP-8.1 on Windows CLI; tried with JIT and without). If I put
Can you please provide a stack backtrace? |
I would be happy to, and I have the coredump file, but when I compiled php with the --enable-debug flag, my application no longer runs:
So I can't, sorry. |
I think you still could get a backtrace if you're running under gdb; after the assertion has been triggered, typing |
I failed at it. As far as I understand, gdb attaches to one of the fpm processes. But my php-fpm (when compiled with --enable-debug) doesn't start at all. I should also clarify that I observe this in a docker container inside a kubernetes pod. Also, I cannot reproduce it running same script in CLI (even with opcache.enable_cli => On). In answer to the second question:
|
So OPcache JIT is disabled. I have no idea how to proceed here; maybe someone else has. |
I also tried reproducing this, to no avail.
The assertion hints at |
We are meeting very similar issue. Disabling opcache helps. |
Seems like even disabling preloading helps in our case. |
No feedback was provided. The issue is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so. Thank you. |
Thanks for the hint, I can reproduce it with preloading. |
Thanks! |
Just for the record, we're experiencing really strange errors after re-enabling preloading on PHP 8.1.6, as if the memory was somehow messed up: return BillingType::tryFrom($value); where BillingType is regular backed enum: enum BillingType: string
{
case Terms = 'terms';
case Prepaid = 'prepaid';
} fails on following error: We're still using the same preloading configuration which worked before transitioning from constants to enums and the code works just fine with preloading disabled. I'll try to create a reproducible case and submit a new issue, I just wanted to warn others about possible problems for now. |
@olsavmic, yes, please file a new ticket. :) |
@olsavmic You never created an issue for this, are you still experiencing this problem? |
@iluuu1994 Yes, the issue still occurs, we're running with preloading disabled. I was just not able to create a reproducible test case nor extract some insightful logs as I was quite busy for the past week (and will be for the week to come). If you're fine with creating an open issue with no more details than those I posted to this channel, I'll create the issue offhand :) |
@olsavmic It can also wait until you have more information, I just wanted to confirm this is still an issue. 🙂 Thanks for your response. |
Description
I have such class:
When I use this constant in a loop in another class, the php-worker crashes
Output:
The same code works if I:
So it is probably a bug with opcache.
PHP Version
PHP 8.1.3
Operating System
Alpine 3.13
The text was updated successfully, but these errors were encountered: