Destructors not invoked after a fatal error
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
This behavior is caused by https://github.com/php/php-src/blob/9306c9584b01f29d2986460a13a7a34b991a9063/main/main.c#L1477 and is causing a few issues in our code.
Granted, the application state after a fatal error (mainly execution timeout/memory limit) may not be consistent, however shutdown handlers are executed anyway after a fatal: thus, to match the behavior of shutdown handlers, I'd like to submit a PR to re-enable execution of destructors, opening this issue to gauge the mood.
PHP Version
8.4.6
Operating System
Ubuntu 24.04
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read main/main.c at the linked line and compare fatal-error handling with the shutdown-handler path. Reproduce the behavior on PHP 8.4.6 under Ubuntu 24.04 using an execution timeout or memory limit; done means destructors are invoked after the fatal error in the intended cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100