praeclarum / FuGetGallery

An alternative web UI for browsing nuget packages
https://www.fuget.org
MIT License
683 stars 121 forks source link

API Diff can cause StackOverflow #154

Open praeclarum opened 3 years ago

praeclarum commented 3 years ago

From Azure:

Your app crashed because of Stack Overflow Exception

Your app, fuget, crashed because of Stack Overflow Exception and aborted the requests it was processing when the overflow occurred. As a result, your app’s users may have experienced HTTP 502 errors.

This call stack caused the exception:

FaultingExceptionFrame
System.Text.StringBuilder.Append
System.Text.StringBuilder.AppendHelper
System.Text.StringBuilder.Append
Mono.Cecil.PropertyDefinition.get_FullName
FuGetGallery.ApiDiff+<>c.<.ctor>b__23_7
ListDiff.ListDiff`2[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]].GenDiff
ListDiff.ListDiff`2[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]].GenDiff
ListDiff.ListDiff`2[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]].GenDiff
ListDiff.ListDiff`2[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]].GenDiff
ListDiff.ListDiff`2[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]].GenDiff
ListDiff.ListDiff`2[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]].GenDiff
ListDiff.ListDiff`2[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]].GenDiff

There is a queue-based ListDiff I can use that will prevent the stack overflow. But it's still going to eat a lot of memory. Maybe limit the differ somehow.