Bug 836345 - Phtread objects leak in libgs.so (ghostscript library)
Phtread objects leak in libgs.so (ghostscript library)
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: ghostscript (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-28 15:28 EDT by Philippe Vouters
Modified: 2014-06-04 12:18 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-04 12:18:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
This zip file contains the Postscript file needed for the test program (16.98 KB, application/zip)
2012-06-28 15:28 EDT, Philippe Vouters
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Ghostscript 695296 None None None Never

  None (edit)
Description Philippe Vouters 2012-06-28 15:28: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):
ghostscript-devel-9.05-1.fc17.i686
ghostscript-9.05-1.fc17.i686

How reproducible:
Always

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
  
Actual results:
pthread_mutex_init/pthread_mutex_destroy count mismatch. This proves a pthread mutex leak.

Expected results:
count matches.

Additional info:
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.
Comment 1 Philippe Vouters 2012-07-20 15:03:31 EDT
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.
Comment 2 Philippe Vouters 2012-07-20 15:43:36 EDT
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.

Yours truly,
Philippe
Comment 3 Philippe Vouters 2012-09-04 13:08:17 EDT
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.
Comment 4 Fedora End Of Life 2013-07-04 00:07:48 EDT
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.
Comment 5 Fedora End Of Life 2013-08-01 08:45:21 EDT
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.
Comment 6 Paul Wouters 2013-08-16 12:31:15 EDT
This bug is still present in the f19 version
Comment 7 Tim Waugh 2014-06-04 12:18:05 EDT
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.

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