Bug 1273513 - tcsh memory leak with source command
tcsh memory leak with source command
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tcsh (Show other bugs)
7.2
All Linux
medium Severity medium
: rc
: ---
Assigned To: David Kaspar [Dee'Kej]
Iveta Wiedermann
: Patch
Depends On: 1134132
Blocks: 1313485 1289025 1295829
  Show dependency treegraph
 
Reported: 2015-10-20 11:29 EDT by David Kaspar [Dee'Kej]
Modified: 2016-11-03 21:46 EDT (History)
7 users (show)

See Also:
Fixed In Version: tcsh-6.18.01-9.el7
Doc Type: Bug Fix
Doc Text:
NO_DOCS
Story Points: ---
Clone Of: 1134132
Environment:
Last Closed: 2016-11-03 21:46:30 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)

  None (edit)
Description David Kaspar [Dee'Kej] 2015-10-20 11:29:32 EDT
+++ This bug was initially created as a clone of Bug #1134132 +++

Description of problem:

tcsh appears to leak some memory during every invocation of its 'source' command


Version-Release number of selected component (if applicable):
tcsh-6.18.01-8.el7.x86_64


How reproducible:
Always


Steps to Reproduce:
1. Create a script to source:
% touch noop.csh

2.Sit in a loop, continuously invoking 'source':
% while (1)
while? source noop.csh
while? end

3. Watch memory grow on the tcsh process

Actual results:
Memory growth (without any apparent limit) on the tcsh process

Expected results:
No memory growth

Additional info:
The leak appears to be rather small and would require a lot of source invocations to consume any significant amount of memory.  But this can still be an issue for long-running tcsh environments.

--- Additional comment from Angelo Bonet on 2014-09-08 15:26:58 EDT ---

FYI:  

Upstream bug report:  http://bugs.gw.com/view.php?id=377

--- Additional comment from Fridolín Pokorný on 2014-09-09 05:11:24 EDT ---

Thanks! I was going to upload the patch, but you were faster. The upstream fix is only partial; I still get memory leaks. The problem is that variable "paraml" is overwritten and allocated memory is lost (there should be freelex() called).

To merge upstream changes, our file file locking patch has to be adjusted (tcsh-6.18.00-history-file-locking.patch).

--- Additional comment from David Kaspar [Dee'Kej] on 2015-10-19 13:47:52 EDT ---

This problem was already fixed by upstream in tcsh version 6.19.00. It is a simple "one-liner" fix:
https://github.com/tcsh-org/tcsh/commit/b73f3a4dbd4892bc796087022f6907b20c773f69

Extracting the patch and creating the reproducer shouldn't be any problem.
Comment 7 errata-xmlrpc 2016-11-03 21:46:30 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2260.html

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