Fix access to uninitialized vars in preload_load()#20081
Fix access to uninitialized vars in preload_load()#20081arnaud-lb wants to merge 1 commit intophp:PHP-8.3from
Conversation
dstogov
left a comment
There was a problem hiding this comment.
I didn't completely understand the problem, but I suppose, you are right.
|
Attempting a better description of the problem: There are two possible sequences during preloading:
I think this has gone unnoticed because So we can not update It is not necessary to update it in the forking case, as the next However it's necessary in the non-forking case, as |
Found while looking at GH-20051.
preload_load()accessesEG(function_table)andEG(class_table), but these may be uninitialized at this point. For instance, when preloading is done in a sub-process, these variables are uninitialized when the parent callspreload_load().The update of
EG(persistent_constants_count),EG(persistent_functions_count),EG(persistent_classes_count)is only necessary whenpreload_load()is invoked inaccel_preload(), and preloading doesn't fork, because in this case, shutdown will truncate global symbol tables after the preloading request.