Bug 536741 - Memory leak can occur in cupsd if `file' devices are configured
Summary: Memory leak can occur in cupsd if `file' devices are configured
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cups
Version: 10
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-11 07:49 UTC by Jiri Popelka
Modified: 2009-12-04 23:49 UTC (History)
1 user (show)

Fixed In Version: 1.3.11-4.fc10
Doc Type: Bug Fix
Doc Text:
Clone Of: 496008
Environment:
Last Closed: 2009-12-01 04:18:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jiri Popelka 2009-11-11 07:49:18 UTC
+++ This bug was initially created as a clone of Bug #496008 +++

Description of problem:
The lspp patch for scheduler/printers.c adds this code to cupsdSetPrinterAttrs():

      printerfile = strstr(p->device_uri, "/dev/");
      if (printerfile == NULL && (strncmp(p->device_uri, "file:/", 6) == 0))
        printerfile = strdup(p->device_uri + strlen("file:/"));

Note that in the first line printerfile is made to point into an existing string, and in the third line a *new* string is allocated with strdup() - and the code does *not* free it. Also note that this duplicated sub-string is wrong: It does not include the first `/'.

A possible fix is to change the third line to:

        printerfile = p->device_uri + 5;


Version-Release number of selected component (if applicable):
cups-1.3.7-8

Steps to Reproduce:
1. In /etc/cups/cupsd.conf set:
   FileDevice Yes
2. Restart cups
3. lpadmin -p "Create Postscript file" -v file:/home/opher/dump.ps -m postscript.ppd.gz -E
4. In /etc/cups/cupsd.conf set:
   FileDevice No
5. Restart cups

Additional info:
I'm not sure when and where cupsdSetPrinterAttrs() is called and hence how much memory is leaking ... but this should be fixed.

Also, if we're at it, my system (RHEL5) is installed with selinux *disabled* so every cups restart I get this:

    E [16/Apr/2009:01:35:08 +0300] cupsdSetPrinterAttrs: Unable to get printer context

for every configured printer (225 printers currently) that have a device uri: file:/dev/null
Could you check that selinux is enabled before you log the error?

Regards,
Opher.

Comment 1 Bug Zapper 2009-11-18 12:55:56 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Fedora Update System 2009-11-18 14:08:44 UTC
cups-1.4.2-5.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cups'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-11314

Comment 3 Fedora Update System 2009-11-18 14:15:18 UTC
cups-1.4.2-5.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cups'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-10891

Comment 4 Fedora Update System 2009-11-20 05:23:42 UTC
cups-1.4.2-7.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cups'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-10891

Comment 5 Fedora Update System 2009-11-20 05:39:27 UTC
cups-1.4.2-7.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cups'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-11314

Comment 6 Fedora Update System 2009-12-01 04:17:45 UTC
cups-1.4.2-7.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2009-12-01 04:33:09 UTC
cups-1.4.2-7.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2009-12-03 11:40:51 UTC
cups-1.3.11-4.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/cups-1.3.11-4.fc10

Comment 9 Fedora Update System 2009-12-04 23:49:21 UTC
cups-1.3.11-4.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.