-
Notifications
You must be signed in to change notification settings - Fork 467
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
StartJob can leak fds and/or memory #921
Comments
CUPS.org User: mike Thanks, will rename close_pipe to cupsdClosePipe() so we can use it for the client code, and maybe rename cupsdPipe() to cupsdOpenPipe() while I'm at it... |
CUPS.org User: mike Attached is an updated patch with the new name; I also changed the other places that used similar coding to use cupsdClosePipe() instead... Please let me know if I missed anything... |
CUPS.org User: mike Fixed in CVS - the anonymous CVS repository will be updated at midnight EST. |
"startjob.patch": Index: job.cRCS file: /home/anoncvs/cups/scheduler/job.c,v
static int ipp_length(ipp_t *ipp);
@@ -1865,6 +1875,7 @@
if (i < (num_filters - 1) ||
if (pid == 0)
if (pid == 0)
close(statusfds[1]); @@ -2625,6 +2648,23 @@ /*
+/*
|
"str921.patch": Index: client.cRCS file: /development/cvs/cups/scheduler/client.c,v
@@ -3389,8 +3389,7 @@
Index: cupsd.hRCS file: /development/cvs/cups/scheduler/cupsd.h,v /* Index: dirsvc.cRCS file: /development/cvs/cups/scheduler/dirsvc.c,v
Index: job.cRCS file: /development/cvs/cups/scheduler/job.c,v
@@ -1818,6 +1819,14 @@
@@ -1865,6 +1875,7 @@
if (i < (num_filters - 1) ||
if (pid == 0)
if (pid == 0)
close(statusfds[1]); Index: main.cRCS file: /development/cvs/cups/scheduler/main.c,v
/*
int /* O - 0 on success, -1 on error /
if (CGIPipes[0] >= 0)
- close(CGIPipes[1]);
/* |
Version: 1.1-current
CUPS.org User: jlovell
StartJob can leak fds and/or memory.
Saw this when some other process filed the process table with children which prevented cupsd from starting jobs. Eventually the original process was killed but by that time cupsd had leaked too many fds so that it wasn't able to recover.
The attached patch fixes it.
Thanks!
The text was updated successfully, but these errors were encountered: