Bug 171053 - Memory Leak in XmGetVisibility Function
Summary: Memory Leak in XmGetVisibility Function
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: openmotif21
Version: 3.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 187497 187539
TreeView+ depends on / blocked
 
Reported: 2005-10-17 19:13 UTC by Warren W. Thompson
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version: RHBA-2006-0431
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-05-17 17:45:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0431 0 normal SHIPPED_LIVE openmotif21 bug fix update 2006-07-19 18:31:00 UTC

Description Warren W. Thompson 2005-10-17 19:13:53 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050921 Red Hat/1.7.12-1.4.1

Description of problem:
Note: This bug is also present on Red Hat Enterprise Linux version 4 in the openmotif21-2.1.30-11.RHEL4.4 package.

There exists a bug in OpenMotif 2.1.30 in the XmGetVisibility method, the list of children returned by XQueryTree() function is not free'd. This bug has been identified and fixed in the Imperial Software Technologies version of OpenMotif 2.1.31. Here is a link to their 2.1.31 release notes document:

http://www.ist-inc.com/motif/motif_changes.html

Notice the description of the bug under the Traversal.c file.

Their fix to Traversal.c on line 1541 involves simply calling XFree((Window*)children); before returning from the XmGetVisibility() function.

This bug causes a series memory leak in our application, and I would imagine any that calls the XtSetValues function in order to update the resources behind a Motif widget.


Version-Release number of selected component (if applicable):
openmotif21-2.1.30-8

How reproducible:
Always

Steps to Reproduce:
1. Write a motif GUI application that updates the resource value of a Motif widget about once per second using the XtSetValues() function.
2. Execute said application.

  

Actual Results:  Memory leaks from the XmGetVisibility() function.

Here is the output from Valgrind showing the offending call stack (Notice that this function has leaked 32868 bytes in only 10 invocations.):

==359== 32868 bytes in 83 blocks are definitely lost in loss record 143 of 146
==359==    at 0x1B8FF88D: malloc (vg_replace_malloc.c:149)
==359==    by 0x1BBDB374: XQueryTree (in /usr/X11R6/lib/libX11.so.6.2)
==359==    by 0x1BAB9413: XmGetVisibility (in /usr/X11R6/lib/libXm.so.2.1)
==359==    by 0x1BAB96B2: (within /usr/X11R6/lib/libXm.so.2.1)
==359==    by 0x1BABA588: _XmNavigSetValues (in /usr/X11R6/lib/libXm.so.2.1)
==359==    by 0x1BAB60D0: (within /usr/X11R6/lib/libXm.so.2.1)
==359==    by 0x1BB8F6A4: (within /usr/X11R6/lib/libXt.so.6.0)
==359==    by 0x1BB8F660: (within /usr/X11R6/lib/libXt.so.6.0)
==359==    by 0x1BB8FAB2: XtSetValues (in /usr/X11R6/lib/libXt.so.6.0)
==359==    by 0x1BBA27AE: XtVaSetValues (in /usr/X11R6/lib/libXt.so.6.0)
==359==    by 0x804A5ED: update_page (dsp_mnepage.c:917)
==359==    by 0x1BB85752: (within /usr/X11R6/lib/libXt.so.6.0)


Expected Results:  The list of children returned by the call to XQueryTree() should be free'd; thereby, eliminating the memory leak.

Additional info:

Comment 10 Red Hat Bugzilla 2006-05-17 17:45:27 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0431.html



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