{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "If you decompress a stream using ZLib.GZipStream and throw an exception while decompressing in a using statement, the actual exception is swallowed and exceptions from GZipStream are thrown instead (I think the Dispose() method is verifying the stream CRC on exception which is causing problems).\n \nI'm not sure if this is possible, but Dispose() shouldn't do any more than close the stream (if required) on an exception. Lest it throw another exception which hides the first exception. \n \n(The reason why I'm not sure this is possible is I don't think its easy to know if your stack is unwinding or if there is an \"ambient\" exception. Here are a stack overflow link which looked slightly relevant: http://stackoverflow.com/questions/4041133/testing-for-stack-unwinding-during-statement-execution)\n \nI've attached a console app which demonstrates the issue. \n \nMy particular context was processing some compressed CSV streams using a forward only reader. I do one pass through the file and process records as I'm decompressing. I was throwing an exception from one of those records, but ZLib.GZipStream.Dispose() was trying to finish the CRC32 calculation before the end of the stream and I was seeing an exception saying the CRC was invalid rather than my application's exception (which is a bit misleading).\n \nIn my case, I can work around this because my streams are all in memory (after being loaded from the database) so I just don't put my GZipStream in a using statement and all is fine. But this wouldn't work as well if I was reading real files and needed to be more careful about disposing my streams correctly.",
    "LastUpdatedDate": "2013-02-21T18:43:02.917-08:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2011-09-05T23:52:29.23-07:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Exceptions thrown while ZLib.GZipStream is decompressing are swallowed",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 1,
    "Id": 14207
  },
  "FileAttachments": [
    {
      "FileId": 4091,
      "FileName": "ExceptionsThrownWithUsing.cs",
      "DownloadUrl": ".\\4091"
    }
  ],
  "Comments": []
}