{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "ZipFile.Save() hangs when 2 files with a size of 65536 * (9 or grater) are added before.\nTo work around this you have disable compression.\nSample:\n        static void Main(string[] args) {\n\n            var zipFile = new Ionic.Zip.ZipFile();\n            int contentSize = 65536 * 9; // * 9, 10, 11 ...\n\n            var content1 = new byte[contentSize];\n            var content2 = new byte[contentSize];\n\n            zipFile.AddEntry(\"content1\", content1);\n            zipFile.AddEntry(\"content2\", content2);\n\n            zipFile.Save(System.IO.Path.GetTempFileName()); // it hangs here\n\n            System.IO.File.Delete(zipFile.Name);\n        }",
    "LastUpdatedDate": "2016-08-26T07:41:28.403-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2012-11-21T04:37:15.917-08:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "AddEntry() deadlock depending on size",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 3,
    "Id": 15806
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "I wrote simple test that demonstrates this problem with a single file.  The code creates a random file of a given size and then zip it and unzip it.  If there is an error it returns false.  I found that most but not all files that are of size that is a multiple of 65536 will fail starting with 65536 * 9.  Please fix this bug.  I am using version 1.9.1.8.\r\n\r\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            if (Directory.Exists(unzipDir))\n                Directory.Delete(unzipDir, true);\r\n\r\n            Directory.CreateDirectory(unzipDir);\r\n\r\n            //6094848\n            for (int i = 1; i <= 200; i++)\n            {\n                int size = 65536 * i;\n                if (TestZip(size) == false)\n                {\n                    Console.WriteLine(\"***\" + i.ToString() + \" \" + size.ToString() + \"***\");\n                }\n                else\n                {\n                    Console.WriteLine(\"...\" + i.ToString() + \" \" + size.ToString() + \"...\");\n          \n                }\n            }\r\n\r\n\n            Console.ReadKey();\r\n\r\n\n        }\r\n\r\n        private static string unzipDir = @\"c:\\ziptest\\unzipdir\";\r\n\r\n        private static bool TestZip(int size)\n        {\n            try\n            {\n                string filePath = @\"c:\\ziptest\\\" + size.ToString();\n                string filePathZip = @\"c:\\ziptest\\\" + size.ToString()+\".zip\";\n                string filePathUnZip = unzipDir+\"\\\\\" + size.ToString();\r\n\r\n\n                byte[] array = new byte[size];\n                Random random = new Random();\n                random.NextBytes(array);\r\n\r\n                if (File.Exists(filePath))\n                    File.Delete(filePath);\r\n\r\n                File.WriteAllBytes(filePath, array);\r\n\r\n\n                if (File.Exists(filePathZip))\n                    File.Delete(filePathZip);\r\n\r\n                Ionic.Zip.ZipFile ZF = new Ionic.Zip.ZipFile();\n                ZF.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;\n                ZF.AddFile(filePath, \"\");\n                ZF.Save(filePathZip);\r\n\r\n\r\n\r\n\n                using (ZipFile zip1 = ZipFile.Read(filePathZip))\n                {\r\n\r\n                    if (zip1.Count != 1)\n                        throw new Exception(\"must contain only one file\");\r\n\r\n                    ZipEntry ZE = zip1[0];\n                    ZE.Extract(unzipDir, ExtractExistingFileAction.OverwriteSilently);\n                }\r\n\r\n\n                if (File.Exists(filePath))\n                    File.Delete(filePath);\r\n\r\n                if (File.Exists(filePathZip))\n                    File.Delete(filePathZip);\r\n\r\n                if (File.Exists(filePathUnZip))\n                    File.Delete(filePathUnZip);\r\n\r\n\n                return true;\n            }\n            catch\n            {\n                return false;\n            }\n        }\n    }",
      "PostedDate": "2012-12-12T11:00:48.46-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-12-27T13:59:49.093-08:00",
      "Id": -2147483648
    },
    {
      "Message": "I have the exact same Issue, also same Version.\nPlease fix that :)",
      "PostedDate": "2013-02-14T07:38:13.267-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-14T07:45:24.313-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-14T07:45:27.09-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-14T07:45:29.023-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:42:43.05-08:00",
      "Id": -2147483648
    },
    {
      "Message": "Hi\nGlad I looked at this, I have the same issue.  Lots of files (which is fine, unless) some are large\nthe .Save(..) hangs\r\n\r\nI re-did the test and turned compression OFF then re-tested as OK\r\n\r\nIam working on version 1.9.1.8 of Ionic.Zip.DLL\r\n\r\nThe issue seems to date back awhile to 2012 and its now August 2016\nNo progress?\r\n\r\n",
      "PostedDate": "2016-08-26T07:41:28.403-07:00",
      "Id": -2147483648
    }
  ]
}