Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory issue: Address Sanitizer complains about Zip.quickUnzipFile #91

Closed
IuriiIaremenko opened this issue Jun 21, 2017 · 1 comment
Closed

Comments

@IuriiIaremenko
Copy link

IuriiIaremenko commented Jun 21, 2017

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.

Issue is in Zip.swift: 195

            fclose(filePointer) // <------ Address Sanitizer complains here
            crc_ret = unzCloseCurrentFile(zip)
            if crc_ret == UNZ_CRCERROR {
                throw ZipError.unzipFail
            }

==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)
#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)
#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)
#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)
#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)
#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)
#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)

@AvdLee
Copy link
Collaborator

AvdLee commented Jun 15, 2018

This is working now and fixed with #128

@AvdLee AvdLee closed this as completed Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants