{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "I use this simple code to add all the contents of a directory to a ZipFile\n            using (ZipFile zip = new ZipFile())\n            {\n                zip.AddDirectory(path);\n                zip.Save(zipPath);\n            }\n \nOn a specific directory, with certain contents, the application stalls/hangs.\n \nActually here is the stack trace:\n \n \t[In a sleep, wait, or join]\t\n \tmscorlib.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext) + 0x2b bytes\t\n \tmscorlib.dll!System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext) + 0x2d bytes\t\n \tmscorlib.dll!System.Threading.WaitHandle.WaitOne() + 0x10 bytes\t\n>\tIonic.Zip.dll!Ionic.Zlib.ParallelDeflateOutputStream.EmitPendingBuffers(bool doAll, bool mustWait) + 0x18b bytes\t\n \tIonic.Zip.dll!Ionic.Zlib.ParallelDeflateOutputStream.Write(byte[] buffer, int offset, int count) + 0x54 bytes\t\n \tIonic.Zip.dll!Ionic.Crc.CrcCalculatorStream.Write(byte[] buffer, int offset, int count) + 0x33 bytes\t\n \tIonic.Zip.dll!Ionic.Zip.ZipEntry._WriteEntryData(System.IO.Stream s) + 0x119 bytes\t\n \tIonic.Zip.dll!Ionic.Zip.ZipEntry.Write(System.IO.Stream s) + 0x162 bytes\t\n \tIonic.Zip.dll!Ionic.Zip.ZipFile.Save() + 0x1a5 bytes\t\n \tIonic.Zip.dll!Ionic.Zip.ZipFile.Save(string fileName) + 0x54 bytes\t\n \nUpon looking at the source code, reading the comments, of Ionic.Zlib.ParallelDeflateOutputStream.EmitPendingBuffers, I would suspect that I' in a deadlock here.\n \nDue to the proprietary nature of the of the files, I cannot upload them, but contact me and I can provide you with a reproducible application + contents of the directory.",
    "LastUpdatedDate": "2015-10-06T19:43:31.897-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2012-05-04T07:03:27.717-07:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Deadlock in ParallelDeflateOutputStream.EmitPendingBuffers",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 14,
    "Id": 15126
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "The code is in the handshake threadpool/main-thread hand shake. \r\n\r\n//                    if (!ThreadPool.QueueUserWorkItem( _DeflateOne, workitem ))\r\n//                        throw new Exception(\"Cannot enqueue workitem\");\r\n                    _DeflateOne(workitem);\r\n\r\nMake the code single threaded and the bug goes away. Even if you're not seeing the bug -- make the change. There is a intermittent multi-threading flaw. Pretty dangerous to release.\r\n\r\nI do respect the package authors. It is a nice package and they obviously put in a great deal of work. This is just a make-or-break bug.",
      "PostedDate": "2012-05-30T15:55:33.567-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-07-20T03:46:25.12-07:00",
      "Id": -2147483648
    },
    {
      "Message": "I've run into this as well. It happens most of the time, but not every time. That also leads me to believe it is a threading / deadlock issue. I have worked around it by setting the zip file to `.ParallelDeflateThreshold = -1;` seems to correct this issue. On the flip side, it only uses one thread, so the process is much slower.\r\n\r\nThis appears to be a new issue in v1.9.1.8. I have the same code running against 1.9.1.5 and it has not exhibited this behavior.",
      "PostedDate": "2012-08-17T14:12:50.463-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-08-22T01:24:31.907-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-09-05T14:25:49.647-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-09-14T13:47:02.443-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-09-19T15:14:18.927-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-10-26T02:25:29.02-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-11-28T20:58:34.54-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-08T12:52:45.84-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:42:51.133-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-07-02T06:27:03.693-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-07-03T02:10:35.22-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-08-26T13:29:18.29-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-12-12T03:10:04.9-08:00",
      "Id": -2147483648
    },
    {
      "Message": "does patch 14368 (http://dotnetzip.codeplex.com/SourceControl/list/patches) resolve this issue?",
      "PostedDate": "2015-02-03T04:25:00.6-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2015-10-06T19:43:31.897-07:00",
      "Id": -2147483648
    }
  ]
}