Giter Site home page Giter Site logo

Error adding big file to archive about zipzap HOT 5 CLOSED

isaksky avatar isaksky commented on August 23, 2024
Error adding big file to archive

from zipzap.

Comments (5)

pixelglow avatar pixelglow commented on August 23, 2024

The fix should work for entries > 2G in size, it's a workaround for a fairly obscure OS X bug:

http://comments.gmane.org/gmane.comp.version-control.git/220647

If you still get errors with your 367M movie file, do send me the exact files, some minimal code to demonstrate it and I'll try to reproduce it. Were you running on OS X or iOS?

from zipzap.

isaksky avatar isaksky commented on August 23, 2024

I tried this new change, but I still get that error. I've made an isolated test case that demonstrates the problem. This breaks on both an iPhone 4 and an iPad 2 running iOS 6.

Here is a link: http://s3.amazonaws.com/dev_capture_uploads/isak/ZipZapCrash.zip
(archive with a 368 MB XCode project).

What I find incredibly strange here is that the order in which you add things to the archive determines whether it breaks or not. Try adding the webcam first instead of last, for example - it works then. (AppDelegate.m:34)

This is the output I'm getting of a run:

2013-07-30 11:45:52.900 ZipZapCrash[158:3c07] Adding ui_events.jsv to archive... 
2013-07-30 11:45:52.973 ZipZapCrash[158:3c07] Added ui_events.jsv to archive 
2013-07-30 11:45:52.975 ZipZapCrash[158:3c07] Adding urls_visited.csv to archive... 
2013-07-30 11:45:52.986 ZipZapCrash[158:3c07] Added urls_visited.csv to archive 
2013-07-30 11:45:52.988 ZipZapCrash[158:3c07] Adding webcam.mov to archive... 
2013-07-30 11:46:28.697 ZipZapCrash[158:3c07] Could not add webcam.mov to archive. Error: Error Domain=com.pixelglow.zipzap Code=8 "The operation couldn’t be completed. (com.pixelglow.zipzap error 8.)" UserInfo=0x1ed82a20 {NSUnderlyingError=0x1edaf5e0 "The operation couldn’t be completed. (Cocoa error 256.)"} 

from zipzap.

pixelglow avatar pixelglow commented on August 23, 2024

I've tested the fix on your test case and it works -- all green.

Your test iOS app had been running out of memory because autorelease pools were not being drained quickly enough. I've made several changes to reduce the impact of these stagnant pools.

Do note, you shouldn't really be calling -[ZZArchive updateEntries:error:] in a loop with each new entry, you should put everything you want in a single NSMutableArray and then update with that. I don't know if that was intentional in your test case or just a quick and dirty way to trigger the bug.

from zipzap.

isaksky avatar isaksky commented on August 23, 2024

Interesting. Awesome, thank you for the fix!

And yeah, in the real code I do it in a single pass like that, don't worry.

from zipzap.

pixelglow avatar pixelglow commented on August 23, 2024

No worries. Also consider using the stream block methods instead of the data block methods if you're getting similar issues with even larger files.

from zipzap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.