Skip to content

Fix GH-10611: fpm_env_init_main leaks environ #10618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

Fixes GH-10611

@Girgias Girgias requested a review from bukka February 18, 2023 19:55
@devnexen
Copy link
Member

@nielsdos what do you get with a ASAN build ? do you think your changes trigger the FPM failures ?

@nielsdos
Copy link
Member Author

I did use an ASAN build, no failures here... I probably did something wrong though, let me check...

@nielsdos
Copy link
Member Author

nielsdos commented Feb 18, 2023

It was my fault. I put the wrong "which" argument and apparently had a stale build so that the test failures didn't trigger.
I changed it to FPM_CLEANUP_PARENT_EXIT_MAIN which I think is correct now and the memleak also doesn't trigger.
Thanks for notifying me!

@bwoebi
Copy link
Member

bwoebi commented Mar 11, 2023

@nielsdos Planning on merging that? :-)

@nielsdos
Copy link
Member Author

@nielsdos Planning on merging that? :-)

I didn't get an approval from @bukka yet, but after that I can merge :)

@nielsdos nielsdos self-assigned this Mar 11, 2023
@nielsdos nielsdos closed this in 71c6372 Mar 11, 2023
@bwoebi
Copy link
Member

bwoebi commented Feb 13, 2024

@nielsdos If I'm not mistaken that actually also needs to run in the child processes, as fpm will fork without exec?

I'm currently still seeing:

[13-Feb-2024 17:35:00] WARNING: [pool www] child 37438 said into stderr: "Direct leak of 232 byte(s) in 1 object(s) allocated from:"
[13-Feb-2024 17:35:00] WARNING: [pool www] child 37438 said into stderr: "    #0 0x7f834082a330 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)"
[13-Feb-2024 17:35:00] WARNING: [pool www] child 37438 said into stderr: "    #1 0x5586267d0df9 in fpm_env_init_main /usr/local/src/php/sapi/fpm/fpm/fpm_env.c:282"
[13-Feb-2024 17:35:00] WARNING: [pool www] child 37438 said into stderr: "    #2 0x5586267bdf04 in fpm_init /usr/local/src/php/sapi/fpm/fpm/fpm.c:62"
[13-Feb-2024 17:35:00] WARNING: [pool www] child 37438 said into stderr: "    #3 0x5586267df8ff in main /usr/local/src/php/sapi/fpm/fpm/fpm_main.c:1822"
[13-Feb-2024 17:35:00] WARNING: [pool www] child 37438 said into stderr: "    #4 0x7f833fb0509a in __libc_start_main ../csu/libc-start.c:308"

@nielsdos
Copy link
Member Author

Possibly, you could try that and see if it solves it. I could also look at it next week or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants