Bug #1876
closedparent process's resource is not freed when it exits
Description
Hi,
I set server.max-worker > 0, and run "valgrind --leak-check=full sbin/lighttpd -f ..."
valgrind reported a "definitely lost".
I checked the source code, and found:
1614 /* if we are the parent, leave here */ 1615 if (!child) return 0;
I modified line 1615:
if (!child) { plugins_free(srv); network_close(srv); server_free(srv); return 0; }
Then I run valgrind again, no "definitely lost" was reported.
Updated by liming almost 16 years ago
Hi,
I set server.max-worker > 0, and run "valgrind --leak-check=full sbin/lighttpd -D -f ... -m ..."
valgrind reported a "definitely lost".
I checked the source code, and found:
1614 /* if we are the parent, leave here */
1615 if (!child) return 0;
I modified line 1615:
if (!child) {
plugins_free(srv);
network_close(srv);
server_free(srv);
return 0;
}
Then I run valgrind again, no "definitely lost" was reported.
Updated by nitrox almost 16 years ago
- Status changed from New to Wontfix
I think we´re not gonna fix anything about server.max-worker.
http://redmine.lighttpd.net/wiki/1/Server.max-workerDetails is clear about this!
Updated by darix almost 16 years ago
- Status changed from Wontfix to Reopened
this is a valid bug and has nothing to do with the usual problems of max-worker.
Updated by Olaf-van-der-Spek almost 16 years ago
liming wrote:
1614 /* if we are the parent, leave here */
1615 if (!child) return 0;I modified line 1615:
if (!child) {
plugins_free(srv);
network_close(srv);
server_free(srv);
return 0;
}Then I run valgrind again, no "definitely lost" was reported.
What's the advantage? The OS cleans up resources after process exit anyway.
Updated by liming almost 16 years ago
Olaf-van-der-Spek wrote:
liming wrote:
1614 /* if we are the parent, leave here */
1615 if (!child) return 0;I modified line 1615:
if (!child) {
plugins_free(srv);
network_close(srv);
server_free(srv);
return 0;
}Then I run valgrind again, no "definitely lost" was reported.
What's the advantage? The OS cleans up resources after process exit anyway.
I think everything should be freed at last.
You can't always count on OS.
Besides, since you free memory resource at most parts of source code, why here don't?
Updated by Olaf-van-der-Spek almost 16 years ago
liming wrote:
You can't always count on OS.
Why not?
Besides, since you free memory resource at most parts of source code, why here don't?
Code simplicity. Maybe it's even faster to let the OS do it.
Updated by liming about 15 years ago
OK, this is not a serious problem, and you can close it.
Updated by gstrauss over 8 years ago
- Status changed from Reopened to Wontfix
The process is about to exit, so while not explicitly clean up, the memory is not leaked. The OS reclaims all memory from the process.
Also available in: Atom