Repository navigation
Fix GH-24661: Wrong function called or crash if the function table changed - #24766
Enfiladeguide wants to merge 1 commit into
Conversation
|
I'm not sure this is really a nice solution, it is bolted on top with extra machinery. |
c6780d1 to
89f46e7
Compare
|
Quoted text written with an LLM and checked by a human developer.
|
|
I don't think this is the right approach. It's just hacking around the fact that opcache is shared between pools. We have got various related issues and think the proper solution is the pool manager: #11723 (please don't try to ask your LLM to implement it - this needs a proper design and you need to know what you are doing for that). |
|
I was checking this more and I just can't see a clean solution for this in stable branches. The current implementation (especially the FPM part) is just mixing the opcache inner working to fpm which is just not right IMHO. I'm open to ideas but it just cannot be something like this. |
… changed ZEND_INIT_FCALL is only emitted for a function that exists at compile time. Since da68458 its handler asserts that the function still exists, and since 980f7bd the ZEND_INIT_FCALL_OFFSET specialization takes an internal function from the offset it had in the function table at compile time. Opcache can run a script with a different function table: the file cache can hold a script compiled after dl(), and FPM pools apply their own disable_functions and extension after the master has started, so a pool can run scripts compiled by another pool or preloaded by the master. The offset can then point to another function, which is called instead, and a call to a function that doesn't exist anymore crashes. On a run-time cache miss, use the offset only if the function there has the expected name, otherwise look the function up by name, as before 980f7bd. Throw "Call to undefined function" if the function doesn't exist, as before da68458, and also if a call compiled for an internal function (op2.extra holds its offset) finds a user function of that name, as its call frame was sized for the internal function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
89f46e7 to
8958d4b
Compare
|
Quoted text written with an LLM and checked by a human developer.
|
Fixes GH-24661.
Quoted text written with an LLM and checked by a human developer.