Bug 26177 - GZipStream Internal error reading zero byte length stream
Summary: GZipStream Internal error reading zero byte length stream
Status: RESOLVED DUPLICATE of bug 22346
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 3.12.0
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: João Matos
URL:
Depends on:
Blocks:
 
Reported: 2015-01-19 17:06 UTC by John Miller [MSFT]
Modified: 2015-01-21 18:17 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Case (4.62 KB, application/zip)
2015-01-19 17:06 UTC, John Miller [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 22346

Description John Miller [MSFT] 2015-01-19 17:06:02 UTC
Created attachment 9404 [details]
Test Case

**Overview:**

   Regression with GZipStream. Reading a zero byte length stream throws an exception. 

**Steps to Reproduce:**

   1. Run the attached sample. 


   Sample code:

            >using (MemoryStream compressedDataStream = new MemoryStream(new byte[] {}))
            >{
            >   using (GZipStream zip = new GZipStream(compressedDataStream, CompressionMode.Decompress))
            >  {
            >        byte[] buffer = new byte[8192];
            >        int test = zip.Read(buffer, 0, buffer.Length); // BAM
            >    }
            >}

**Actual Results:**

  >System.IO.IOException: Internal error (no progress possible) ReadInternal
  >at System.IO.Compression.DeflateStreamNative.CheckResult (Int32 result, System.String where) [0x000a5] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/System/System.IO.Compression/DeflateStream.cs:477 
  >at System.IO.Compression.DeflateStreamNative.ReadZStream (IntPtr buffer, Int32 length) [0x0000e] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/System/System.IO.Compression/DeflateStream.cs:375 
  >at System.IO.Compression.DeflateStream.ReadInternal (System.Byte[] array, Int32 offset, Int32 count) [0x0002f] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/System/System.IO.Compression/DeflateStream.cs:125 
  >at System.IO.Compression.DeflateStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x00086] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/System/System.IO.Compression/DeflateStream.cs:145 
  >at System.IO.Compression.GZipStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x0001c] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/System/System.IO.Compression/GZipStream.cs:80 
  >at GzipIssue.MainClass.Main (System.String[] args) [0x00028] in /Users/johnmiller/Projects/GzipIssue/GzipIssue/Program.cs:16 

**Expected Results:**

   Read succeeds and returns a length of zero bytes.

**Build Date & Platform:**

   Mono 3.12

**Additional Information:**

   Run this on Windows with .NET and you will get the expected results.
Comment 1 John Miller [MSFT] 2015-01-19 17:22:12 UTC
I tested with Mono 3.10.0.31 and 3.8.0.13 and I am still able to reproduce this.
Comment 2 John Miller [MSFT] 2015-01-19 17:27:57 UTC
Also tested with Mono 3.6.0 and XS 5.2, still reproducing.
Comment 4 João Matos 2015-01-21 07:14:16 UTC
Works here with master, seems like a duplicate of #22346.

Please re-open if you are able to reproduce with master.

*** This bug has been marked as a duplicate of bug 22346 ***
Comment 5 Tim Dawson 2015-01-21 07:29:54 UTC
I am glad to hear the issue has been fixed. However, I need to know when that fix will appear in the "stable" channel for Xamarin's iOS and Android products, please.
Comment 6 Rodrigo Kumpera 2015-01-21 18:17:04 UTC
It was fixed after the deadlines for including patches on the current stables.

It will be out on the next cycle of stables in a few months.