php / php/php-src

FPM: Freeing child allocated data

Open
#11,461 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature SAPI: fpm
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

FPM allocates some data during child initialization for keeping around some configuration options. This is done in following places:

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the child-initialization code in sapi/fpm/fpm/fpm_log.c, fpm_status.c, and fpm_php.c, then trace the child exit path. Add corresponding child-destroy handling for the allocations listed in the issue and call it before the child exits. Done means those child-owned values are freed during shutdown rather than only at process exit.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.