FPM: Freeing child allocated data
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.1k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
Description
FPM allocates some data during child initialization for keeping around some configuration options. This is done in following places:
- https://github.com/php/php-src/blob/15184435007ae13d31902be2613632b813b80b0f/sapi/fpm/fpm/fpm_log.c#L81 (this was reported in https://bugs.php.net/bug.php?id=75635 and it is the reason for creating this issue).
- https://github.com/php/php-src/blob/15184435007ae13d31902be2613632b813b80b0f/sapi/fpm/fpm/fpm_log.c#L91
- https://github.com/php/php-src/blob/15184435007ae13d31902be2613632b813b80b0f/sapi/fpm/fpm/fpm_status.c#L32
- https://github.com/php/php-src/blob/15184435007ae13d31902be2613632b813b80b0f/sapi/fpm/fpm/fpm_status.c#L40-L41
- https://github.com/php/php-src/blob/15184435007ae13d31902be2613632b813b80b0f/sapi/fpm/fpm/fpm_php.c#L219-L221 (this just takes ownership but means the same sort of leak effectively)
Those values are never freed. They are needed for the whole life of child so it is not a big issue as it gets released on process exit (that's why this is classified more as a feature and not a bug because there is no impact of this). However it is a good convention to free those values so some child destroy functions should be created for that purpose and called before exiting the child.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit dem Lesen des Codes zur Initialisierung der Kindprozesse in sapi/fpm/fpm/fpm_log.c, fpm_status.c und fpm_php.c und verfolgen Sie anschließend den Pfad zum Beenden des Kindprozesses. Fügen Sie eine entsprechende Behandlung zur Zerstörung des Kindprozesses für die im Issue aufgeführten Allokationen hinzu und rufen Sie sie auf, bevor der Kindprozess beendet wird. Erledigt ist dies, wenn diese dem Kindprozess gehörenden Werte während des Herunterfahrens freigegeben werden und nicht erst beim Beenden des Prozesses.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- backend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100