Objective-Zip icon indicating copy to clipboard operation
Objective-Zip copied to clipboard

Crash when trying to unzip file

Open erwinl opened this issue 8 years ago • 2 comments

Hello, first of all thanks for the library.

When trying to unzip a zip file, it always crash for me on this step:

OZZipFile *unzipFile= [[OZZipFile alloc] initWithFileName:@"test.zip" mode:OZZipFileModeUnzip];

I double checked and the zip file is exist and can be unzipped correctly by OSX archiver. Zip file is created by OSX archiver.

It always crash on: unzip.c > unzOpenInternal() line 577 unzGoToFirstFile((unzFile)s);

#0  0x00000001842bb7b8 in flockfile ()
#1  0x00000001842c7488 in fseek ()
#2  0x0000000100371ca0 in unzlocal_GetCurrentFileInfoInternal ()
#3  0x0000000100372d08 in unzGoToFirstFile ()
#4  0x000000010013a4bc in unzOpenInternal at /Users/Est/tiramisu/Pods/objective-zip/MiniZip/unzip.c:577
#5  0x000000010013a500 in unzOpen64 at /Users/Est/tiramisu/Pods/objective-zip/MiniZip/unzip.c:613
#6  0x0000000100130ff4 in -[OZZipFile initWithFileName:mode:legacy32BitMode:] at /Users/Est/tiramisu/Pods/objective-zip/Objective-Zip/OZZipFile.m:98
#7  0x0000000100130e20 in -[OZZipFile initWithFileName:mode:] at /Users/Est/tiramisu/Pods/objective-zip/Objective-Zip/OZZipFile.m:83
#8  0x0000000100131320 in -[OZZipFile initWithFileName:mode:error:] at /Users/Est/tiramisu/Pods/objective-zip/Objective-Zip/OZZipFile.m:134

Any idea why it crash when initializing the OZZipFile ? Thanks in advance.

erwinl avatar Mar 16 '16 15:03 erwinl

Several possibilities, but one thought: You're not specifying a full path; try [[NSBundle mainBundle] pathForResource:@"test" ofType:@"zip"] if this file is in your bundle, or the full path if you've downloaded it.

evands avatar Aug 25 '16 17:08 evands

Hello @evands, I made sure that the zip file is there.

erwinl avatar Aug 26 '16 02:08 erwinl