[Mono-bugs] [Bug 657388] Array.Resize corrupts a GZipStream.Read operation

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jul 18 18:44:48 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=657388

https://bugzilla.novell.com/show_bug.cgi?id=657388#c7


Jeffrey Stedfast <jeff at xamarin.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeff at xamarin.com

--- Comment #7 from Jeffrey Stedfast <jeff at xamarin.com> 2011-07-18 22:44:47 UTC ---
Johan:

FWIW, Array.Resize<T>() does more-or-less the same as what your workaround code
does - allocates a new array and copies the data over.

The difference is that Buffer.BlockCopy uses a different icall
(BlockCopyInternal) than Array.Resize() which uses FastCopy(). To be honest, I
suspect your workaround might even be more efficient (BlockCopyInternal is very
simple, other than a few bounds checks, it just does memcpy() while FastCopy()
is kinda complex).

Still, you shouldn't be getting buffers which have corrupted data in them using
Array.Resize().

All I can think of is that FastCopy() is failing for some reason and
(hopefully) returning false (Array.Resize<T>() is not properly handling the
case where FastCopy() returns false).

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list