Zend: Fix stack overflow crash in recursive function#22524
Conversation
|
your change seems to fix it but nonetheless you still need to add a test. |
|
Thank you. I added a new test file. |
|
I am not sure this is needed, it is recursive function, it will fail anyway, unless there is a real use-case this IMO should be a won't fix |
| const zend_op *opline = call->opline; | ||
| if (UNEXPECTED(!opline)) { | ||
| goto not_frameless_call; | ||
| } |
There was a problem hiding this comment.
This may be the wrong fix: A NULL opline implies that we are missing a SAVE_OPLINE() somewhere in the engine.
Emitting a PHP error instead of causing a seg fault improves user experience substantially in my opinion, so we should try to do so when possible. This is much easier to debug for most people. See #9104. In this case it's a bit different: Engine recursion causes an OOM fatal error, and we crash while generating the stack trace (possibly due to a missing Generating the stack trace takes a very long time. We should probably update #17056 so that it truncates large traces. |
#22521