You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
In file PagedCharBuffer.cs, method public void Append(string value), the loopwhile (count > 0) at line 56 doed not exit in some scenarios. As a result, the web application hangs.
The problem is that GetCurrentPage and NewPage calls within the loop make use of ArrayPool.RentUse (public abstract T[] Rent(int minimumLength) which takes one parameter, which is the minimumLength. Sometimes the actual length of the returned array is greater than requested one (1024 corresponding to PageSize const). As soon as this happens (apparently when Append argument is a quite long string) any further invokation of GetCurrentPage fails to get new pages.
In fact, if (CurrentPage == null || _charIndex == PageSize returns false as _charIndex is now set to a different value than the expected PageSize (2048 whenever I experienced the bug).
I solved the bug by changing line 59 like this var copyLength = Math.Min(count, PageSize - _charIndex);