Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#11688 closed Bug Report - Memory Leak (fixed)

Rapid memory consumption with running myth commands with --help

Reported by: dancy@… Owned by: Raymond Wagner
Priority: minor Milestone: 0.27
Component: MythTV - General Version: 0.26
Severity: medium Keywords:
Cc: Ticket locked: no

Description (last modified by Raymond Wagner)

For example, running "mythutil --help" results in no output but free memory on the system rapidly drops until I kill the process. If I run under gdb and control-c after a while, the backtrace is:

(gdb) bt
#0  0x000000303b6c19ee in QString::mid(int, int) const () from /lib64/
#1  0x0000003046ef9b51 in wrapList(QStringList&, int) () from /lib64/
#2  0x0000003046f28c75 in CommandLineArg::GetHelpString(int, QString, bool) const () from /lib64/
#3  0x0000003046f34712 in MythCommandLineParser::GetHelpString() const () from /lib64/
#4  0x0000003046f34d80 in MythCommandLineParser::PrintHelp() const () from /lib64/
#5  0x0000000000405ca5 in main (argc=2, argv=<optimized out>) at main.cpp:124

Change History (5)

comment:1 Changed 8 years ago by Raymond Wagner

Owner: set to Raymond Wagner
Status: newassigned

comment:2 Changed 8 years ago by Raymond Wagner

Description: modified (diff)

comment:3 Changed 8 years ago by Raymond Wagner

Could you describe the circumstances a bit more? The only scenario I can find that might produce this issue is when your console is too narrow to actually display the command line arguments without wrapping, much less the help text.

comment:4 Changed 8 years ago by Raymond Wagner <rwagner@…>

Resolution: fixed
Status: assignedclosed

In 1ebf70131c868160b3a6225e99f11c0c5a900bff/mythtv:

Correct issue where too narrow a console can break help output

If the terminal width used to display the help output is narrower than
the longest defined argument, the command line parser will attempt to
wrap the help text at a negative length, and will eventually OOM. This
makes sure that the wrap function does not allow that, and tries to
behave a bit more intelligently during help output.

Fixes #11688

comment:5 Changed 8 years ago by paulh

Milestone: unknown0.27
Note: See TracTickets for help on using tickets.