Bug 199339 - desktop apps have stray file descriptor 4 open to .fonts.cache-2
desktop apps have stray file descriptor 4 open to .fonts.cache-2
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: fontconfig (Show other bugs)
5
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Behdad Esfahbod
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-18 19:52 EDT by Jon Burgess
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-20 17:48:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix cache file descriptor leak (334 bytes, patch)
2006-07-18 21:17 EDT, Jon Burgess
no flags Details | Diff

  None (edit)
Description Jon Burgess 2006-07-18 19:52:01 EDT
Description of problem:
Multiple KDE applications that I have open have file descriptor 4 pointing at
.fonts.cache-2

Version-Release number of selected component (if applicable):
FC5 system with all released updates as of ~18th July 2006.
[jburgess@shark Desktop]$ konsole --version
Qt: 3.3.6
KDE: 3.5.3-0.4.fc5 Fedora-Core
Konsole: 1.6.3
[jburgess@shark Desktop]$ rpm -q fontconfig
fontconfig-2.3.94-1
fontconfig-2.3.94-1


How reproducible:
Many different applications currently seem to have a file descriptor open to a
font.cache file.

Steps to Reproduce:
1. Log into KDE desktop
2. Open konsole window
3. ls -l /proc/self/fd
  
Actual results:
[jburgess@shark Desktop]$ ls -l /proc/self/fd
total 5
lrwx------ 1 jburgess jburgess 64 Jul 19 00:48 0 -> /dev/pts/8
lrwx------ 1 jburgess jburgess 64 Jul 19 00:48 1 -> /dev/pts/8
lrwx------ 1 jburgess jburgess 64 Jul 19 00:48 2 -> /dev/pts/8
lr-x------ 1 jburgess jburgess 64 Jul 19 00:48 3 -> /proc/10742/fd
lr-x------ 1 jburgess jburgess 64 Jul 19 00:48 4 ->
/home/jburgess/.rh-fontconfig/.fonts.cache-2 (deleted)

Same for bash shell too:-
[jburgess@shark Desktop]$ ls -l /proc/$$/fd
total 5
lrwx------ 1 jburgess jburgess 64 Jul 19 00:29 0 -> /dev/pts/8
lrwx------ 1 jburgess jburgess 64 Jul 19 00:29 1 -> /dev/pts/8
lrwx------ 1 jburgess jburgess 64 Jul 19 00:25 2 -> /dev/pts/8
lrwx------ 1 jburgess jburgess 64 Jul 19 00:29 255 -> /dev/pts/8
lr-x------ 1 jburgess jburgess 64 Jul 19 00:29 4 ->
/home/jburgess/.rh-fontconfig/.fonts.cache-2 (deleted)


Expected results:
fd/4 should not be open and pointing at the fonts.cache file for processes like
bash or ls.

Additional info:
I tried opening a gnome-terminal from within KDE and the gnome session didn't
have the FD open so maybe this will not be visible in a Gnome desktop.

I'm not certain this is a fontconfig bug, maybe some other process (e.g.
konsole) should be closing the cache after use, but fontconfig looks like a good
candidate to me. I understand that many apps will probably have the .font.cache
file open at some time. It looks to me like the FD is being held open after it
has been finished with or it should have been opened with FD_CLOEXEC to prevent
it being inheritted by child processes.
Comment 1 Jon Burgess 2006-07-18 21:17:29 EDT
Created attachment 132636 [details]
Fix cache file descriptor leak

This patch seems to fix the problem for me. I've posted it to
fontconfig@lists.freedesktop.org for further comment.
Comment 2 Behdad Esfahbod 2006-07-20 17:48:47 EDT
Thanks, this was committed upstream.  Will be in next release.

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