Skip to content

OutOfMemoryException in HelpText.AddLine#387

@qmfrederik

Description

@qmfrederik

After upgrading to the latest prerelease version, I'm seeing some of my unit tests fail because of what appears to be an infinite loop in HelpText.AddLine.

Basically, it looks like the same value is being added to the StringBuilder in a loop, until the system runs out of memory.

Stack trace:

System.OutOfMemoryException : Insufficient memory to continue the execution of the program. at System.Text.StringBuilder.ExpandByABlock(Int32 minBlockCharCount) at System.Text.StringBuilder.Append(Char* value, Int32 valueCount) at System.Text.StringBuilder.AppendHelper(String value) at System.Text.StringBuilder.Append(String value) at CommandLine.Text.HelpText.AddLine(StringBuilder builder, String value, Int32 maximumLength) at CommandLine.Text.HelpText.DefaultParsingErrorsHandler[T](ParserResult`1 parserResult, HelpText current) at CommandLine.Text.HelpText.AutoBuild[T](ParserResult`1 parserResult, Func`2 onError, Func`2 onExample, Boolean verbsIndex, Int32 maxDisplayWidth) at CommandLine.Parser.<>c__DisplayClass17_0`1.<DisplayHelp>b__1(IEnumerable`1 _, TextWriter writer) at CSharpx.MaybeExtensions.Do[T1,T2](Maybe`1 maybe, Action`2 action) at CommandLine.ParserResultExtensions.WithNotParsed[T](ParserResult`1 result, Action`1 action) at CommandLine.Parser.DisplayHelp[T](ParserResult`1 parserResult, TextWriter helpWriter, Int32 maxDisplayWidth) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions