darshb / gdata-objectivec-client

Automatically exported from code.google.com/p/gdata-objectivec-client
Other
0 stars 0 forks source link

Crash when receiving data #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A rare crash when downloading a file using GDataHTTPFetcher class. 

Crash log below:
----------------------
<Error>: *** Terminating app due to uncaught exception 'NSMallocException', 
reason: '*** -[NSConcreteMutableData appendData:]: unable to allocate memory 
for length (1572864)'
    *** Call stack at first throw:
    (
        0 CoreFoundation 0x309a5fd3 __exceptionPreprocess + 114
        1 libobjc.A.dylib 0x318b58a5 objc_exception_throw + 24
        2 CoreFoundation 0x309a5e91 +[NSException raise:format:arguments:] + 68
        3 CoreFoundation 0x309a5ecb +[NSException raise:format:] + 34
        4 Foundation 0x31460c1f _NSMutableDataGrowBytes + 558
        5 Foundation 0x31481415 -[NSConcreteMutableData appendData:] + 80
        6 MyApp 0x000207ed -[GDataHTTPFetcher connection:didReceiveData:] + 28
        7 Foundation 0x3148d2f3 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidReceiveData:originalLength:] + 150
        8 Foundation 0x3148d21f _NSURLConnectionDidReceiveData + 90
        9 CFNetwork 0x351ebaa9 _ZN19URLConnectionClient21_clientDidReceiveDataEPK8__CFDataPNS_26ClientConnectionEventQueueE + 200
        10 CFNetwork 0x351dfbe7 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 214
        11 CFNetwork 0x351dfa67 _ZN19URLConnectionClient13processEventsEv + 70
        12 CFNetwork 0x351dfa19 _ZN13URLConnection24multiplexerClientPerformEP18RunLoopMultiplexer + 36
        13 CFNetwork 0x351df997 _ZN17MultiplexerSource7performEv + 126
        14 CFNetwork 0x351df915 _ZN17MultiplexerSource8_performEPv + 8
        15 CoreFoundation 0x3097ba8d __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
        16 CoreFoundation 0x3097d76f __CFRunLoopDoSources0 + 382
        17 CoreFoundation 0x3097e50b __CFRunLoopRun + 230
        18 CoreFoundation 0x309278eb CFRunLoopRunSpecific + 230
        19 CoreFoundation 0x309277f3 CFRunLoopRunInMode + 58
        20 GraphicsServices 0x30a8b6ef GSEventRunModal + 114
        21 GraphicsServices 0x30a8b79b GSEventRun + 62
        22 UIKit 0x31dc32a7 -[UIApplication _run] + 402
        23 UIKit 0x31dc1e17 UIApplicationMain + 670
        24 WhatsApp 0x00003eab main + 42
        25 WhatsApp 0x00003e7c start + 40
    )
----------------------

Crash happened in the application compiled with GData Objective-C Client 
Library release 1.9.1. and running on an iPhone 3GS with iOS 4.1.

Original issue reported on code.google.com by igor.sol...@gmail.com on 6 Sep 2010 at 12:57

GoogleCodeExporter commented 9 years ago
This is an exception, not really a crash.

"unable to allocate memory for length (1572864)'" implies your app has run out 
of memory; a 1.5 megabyte allocation should not be excessive

Original comment by gregrobbins on 6 Sep 2010 at 9:46

GoogleCodeExporter commented 9 years ago
to the user exception is similar to crash :) do you think worth trying to check 
if application has required amount of free memory? if we know that application 
doesn't have enough free memory we could gracefully return error and do not 
crash.

Original comment by igor.sol...@gmail.com on 7 Sep 2010 at 7:21

GoogleCodeExporter commented 9 years ago
There's not really a way to make the judgement on behalf of the application. 
Some will download tiny feeds; some will download huge feeds. Nor is there much 
point; if the app fails now with a 1.5 MB allocation, there's a good chance it 
would fail soon somewhere else. The OS isn't designed for reliable behavior 
under very low memory.

In this case, it's likely something in the application is already leaking a lot 
of memory.

Original comment by gregrobbins on 8 Sep 2010 at 6:59

GoogleCodeExporter commented 9 years ago
ok, I agree. need to work on reducing application's memory footprint. thank you

Original comment by igor.sol...@gmail.com on 9 Sep 2010 at 8:43

GoogleCodeExporter commented 9 years ago

Original comment by gregrobbins on 10 Sep 2010 at 12:45