Red Hat Bugzilla – Bug 836345
Phtread objects leak in libgs.so (ghostscript library)
Last modified: 2014-06-04 12:18:05 EDT
Created attachment 595113 [details]
This zip file contains the Postscript file needed for the test program
Description of problem:
ghostscript suffers from a pthread objects leak
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Get the program from http://vouters.dyndns.org/tima/Unix-Linux-OpenVMS-Ghostscript-Pthreads_objects_leak_when_posync.html as well as this attachment.
2. $ cc -O0 -g -o test test.c
3. gbd ./test
4. (gdb) break gsapi_new_instance
5. (gdb) break pthread_mutex_init
6. (gdb) break pthread_mutex_destroy
7. (gdb) run
pthread_mutex_init/pthread_mutex_destroy count mismatch. This proves a pthread mutex leak.
I have not seen under gdb how to display pthread_mutex_t and pthread_mutex_cond_t types variables and watch out at their state and the thread waiters if any.
I have not seen using Ghostript 9.02 sources (ought to also apply to Ghostscript 9.05) a mean to get a gs_malloc_memory_t * pointer from a gs_malloc_block_t * pointer. The contrary is untrue.
Getting a gs_malloc_memory_t * pointer from a gs_malloc_block_t * pointer would have enabled to call gx_monitor_free in gs_heap_free_all (in the for (; bp != 0; bp = np) loop).
As far as observed and remembered from the program's execution under Fedora and Ghostscript V9.05, the application ought to only suffer from a "monitor" allocated pthread mutex leak.
Just a correction to my original bugzilla post. The correct cc command is:
$ cc -O0 -g -o test -lgs test.c
I re-executed the code under Fedora 17 (Ghostscript 9.05). I do confirm. The code does suffer from a "monitor" allocated pthread mutex leak (gx_monitor_alloc/gx_monitor_free unpaired). gx_semaphore_alloc/gx_semaphore_free calls are correctly paired.
This actual problem report which is very visible and much impacts the Ghostscript developer on OpenVMS platforms seems to competely pourrish. The actual fault is NOT on Red Hat shoulders but on Ghostscript developers who seem to do their best to protect themselves against any outside point of view regarding their work.
For Red Hat knowledge, I have been strictly unable to directly report the problem to Ghostscript developers. They forced me to report to Red Hat which seems to be also unempowered to correctly draw Ghostscript developers attention onto this full problem report in order to have it at last suitably addressed.
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. 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 '17'.
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 17'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 17 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, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.
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.
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.
This bug is still present in the f19 version
http://bugs.ghostscript.com/show_bug.cgi?id=693593#c7 indicates that an instance is expected to last for the lifetime of the process.
However, I did fine one suspicious piece of code, which I've reported upstream.