Project

General

Profile

Actions

Bug #1876

closed

parent process's resource is not freed when it exits

Added by liming over 15 years ago. Updated almost 8 years ago.

Status:
Wontfix
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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.

Actions #1

Updated by liming over 15 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.

Actions #2

Updated by nitrox over 15 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!

Actions #3

Updated by darix over 15 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.

Actions #4

Updated by Olaf-van-der-Spek over 15 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.

Actions #5

Updated by liming over 15 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?

Actions #6

Updated by Olaf-van-der-Spek over 15 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.

Actions #7

Updated by liming over 14 years ago

OK, this is not a serious problem, and you can close it.

Actions #8

Updated by stbuehler over 14 years ago

  • Missing in 1.5.x set to No
Actions #9

Updated by gstrauss almost 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.

Actions

Also available in: Atom