Summary: | Fonts file descriptors are not released | ||
---|---|---|---|
Product: | cairo | Reporter: | Adrien BUSTANY <madcat> |
Component: | general | Assignee: | poppler-bugs <poppler-bugs> |
Status: | RESOLVED NOTABUG | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | alex.hunziker, j, pvanhoof |
Version: | 1.9.7 | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Valgrind logs showing "leaked" fds at the top |
Description
Adrien BUSTANY
2010-02-03 06:35:43 UTC
Which poppler revision do you mean? Revision 65fba0aac7d60a0ff2ae26f21d99673de8a9de74 doesn't exist in poppler git repo. I think this should have been 6825a219f0bc0ac6fd469fb8a6ebb86df774375f That commit should fix the problem for you because it doesn't use CairoOutputdev anymore, but not the bug since there seems to be a leak in CairoOutputDev, maybe this one: http://cgit.freedesktop.org/poppler/poppler/commit/?h=poppler-0.12&id=e25e4fd2e76619dd42715a1e9d78088850d8fe7e that was comitted after 0.12.3, could you confirm this commit fixes the problem? I can backport the other commit too if it works better for you anyway. Created attachment 33034 [details]
Valgrind logs showing "leaked" fds at the top
Nope, that commit doesn't fix my bug, I still have opened file descriptors when the program exits (still the fonts). Attached is my valgrind log, the "leaked" fds are at the top.
I think it's a cairo issue, we use cairo_font_face_set_user_data() to close the file descriptor when the font is destroyed, but fonts are never destroyed. Cairo holds references of the fonts that are never released. Moving to cairo Cairo holds a large (256) scaled-font holdover cache because a lot of applications create, destroy and then recreate the small working set of fonts regularly. However, in situations such as this you will then need to exercise poppler with a large number of fonts before you see evictions. During shutdown, in order to fully clean up global caches you need to call cairo_debug_reset_static_data() [as well as all the other per library cleanup routines]. This is only recommended during leak checking, at all other times is simply more efficient to let the OS reap the resources upon exit(). Since the test case is behaving exactly as designed, I do not see the bug... |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.