{"action":"closed","issue":{"url":"https://api.github.com/repos/marmelroy/Zip/issues/91","repository_url":"https://api.github.com/repos/marmelroy/Zip","labels_url":"https://api.github.com/repos/marmelroy/Zip/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/marmelroy/Zip/issues/91/comments","events_url":"https://api.github.com/repos/marmelroy/Zip/issues/91/events","html_url":"https://github.com/marmelroy/Zip/issues/91","id":237523723,"node_id":"MDU6SXNzdWUyMzc1MjM3MjM=","number":91,"title":"Memory issue: Address Sanitizer complains about Zip.quickUnzipFile","user":{"login":"IuriiIaremenko","id":8626301,"node_id":"MDQ6VXNlcjg2MjYzMDE=","avatar_url":"https://avatars1.githubusercontent.com/u/8626301?v=4","gravatar_id":"","url":"https://api.github.com/users/IuriiIaremenko","html_url":"https://github.com/IuriiIaremenko","followers_url":"https://api.github.com/users/IuriiIaremenko/followers","following_url":"https://api.github.com/users/IuriiIaremenko/following{/other_user}","gists_url":"https://api.github.com/users/IuriiIaremenko/gists{/gist_id}","starred_url":"https://api.github.com/users/IuriiIaremenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IuriiIaremenko/subscriptions","organizations_url":"https://api.github.com/users/IuriiIaremenko/orgs","repos_url":"https://api.github.com/users/IuriiIaremenko/repos","events_url":"https://api.github.com/users/IuriiIaremenko/events{/privacy}","received_events_url":"https://api.github.com/users/IuriiIaremenko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-21T12:54:08Z","updated_at":"2018-06-15T08:36:38Z","closed_at":"2018-06-15T08:36:38Z","author_association":"NONE","body":"I'm using Zip in my project and on very start I must unzip some package. So during address sanitizer tests I found that it complains on function quickUnzipFile(_ path: URL). So there is memory issue on very start of my project in Zip, thus can't test my code.  \r\n\r\n\r\nIssue is in Zip.swift: 195\r\n```\r\n            fclose(filePointer) // <------ Address Sanitizer complains here\r\n            crc_ret = unzCloseCurrentFile(zip)\r\n            if crc_ret == UNZ_CRCERROR {\r\n                throw ZipError.unzipFail\r\n            }\r\n```\r\n\r\n> ==5827==AddressSanitizer CHECK failed: /Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-802.0.41/src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:202 \"((h->type == CommonInterceptorMetadata::CIMT_FILE)) != (0)\" (0x0, 0x0)\r\n    #0 0x100374ddf in __asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/var/containers/Bundle/Application/D2FB8C94-89AB-46E6-B6C0-F41BEC122A30/MyApp.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x54ddf)\r\n    #1 0x1003884bf in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/var/containers/Bundle/Application/D2FB8C94-89AB-46E6-B6C0-F41BEC122A30/MyApp.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x684bf)\r\n    #2 0x100363177 in wrap_fclose (/var/containers/Bundle/Application/D2FB8C94-89AB-46E6-B6C0-F41BEC122A30/MyApp.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x43177)\r\n    #3 0x1001f8947 in static Zip.Zip.unzipFile (Foundation.URL, destination : Foundation.URL, overwrite : Swift.Bool, password : Swift.Optional<Swift.String>, progress : Swift.Optional<(Swift.Double) -> ()>) throws -> () (/private/var/containers/Bundle/Application/D2FB8C94-89AB-46E6-B6C0-F41BEC122A30/MyApp.app/Frameworks/Zip.framework/Zip:arm64+0x30947)\r\n    #4 0x1001ee267 in static Zip.Zip.quickUnzipFile (Foundation.URL, progress : Swift.Optional<(Swift.Double) -> ()>) throws -> Foundation.URL (/private/var/containers/Bundle/Application/D2FB8C94-89AB-46E6-B6C0-F41BEC122A30/MyApp.app/Frameworks/Zip.framework/Zip:arm64+0x26267)\r\n    #5 0x1001ed297 in static Zip.Zip.quickUnzipFile (Foundation.URL) throws -> Foundation.URL (/private/var/containers/Bundle/Application/D2FB8C94-89AB-46E6-B6C0-F41BEC122A30/MyApp.app/Frameworks/Zip.framework/Zip:arm64+0x25297)"}}
{"actor":{"display_login":"AvdLee"}}