{ "id": "80489", "key": "TIMOB-5335", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "12078", "description": "", "name": "Sprint 2011-38", "archived": true, "released": true, "releaseDate": "2011-09-26" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-09-22T10:45:38.000+0000", "created": "2011-09-22T05:29:04.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "branch-5062" ], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-12-10T10:53:35.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "We have a little bit of a problem with memory warnings in KrollBridge. Apparently, registeredProxies can be mutated while the fast iteration in -[KrollBridge didReceiveMemoryWarning:] is proceeding (see http://networkpx.blogspot.com/2009/07/analyzing-objective-cs-for-in-loop-fast.html for a description of how fast enumeration is unrolled, and judge for yourself how \"smart\" the OS is about preempting this at EXACTLY the wrong time to disrupt the mutationsPtr). And yes: jetsam apparently doesn't interact with any kind of scheduling to ensure that only an application's main thread is being run. This crash report is evidence enough of that. Wish we could have a good, hard, reproducible test case for Apple so they could try and fix this (is there really precedence for a watchdog application taking over kernel scheduling?)\r\n\r\nAnyway, here we go...\r\n\r\n{code:title=Crashed thread}\r\nIncident Identifier: EA23A633-B2EE-48EF-916D-B1B83BEDBEB4\r\nCrashReporter Key: 38cb7cb670efe80e40368cb85b5503770ed373ae\r\nHardware Model: iPad1,1\r\nProcess: tiapplication [924]\r\nPath: /var/mobile/Applications/10B644A6-1147-4754-BED5-DDC27F30259F/tiapplication.app/tiapplication\r\nIdentifier: tiapplication\r\nVersion: ??? (???)\r\nCode Type: ARM (Native)\r\nParent Process: launchd [1]\r\n\r\nDate/Time: 2011-09-21 18:14:03.062 +0200\r\nOS Version: iPhone OS 4.2.1 (8C148)\r\nReport Version: 104\r\n\r\nException Type: EXC_CRASH (SIGABRT)\r\nException Codes: 0x00000000, 0x00000000\r\nCrashed Thread: 0\r\n\r\nThread 0 Crashed:\r\n0 libSystem.B.dylib \t0x30d7c2d4 __kill + 8\r\n1 libSystem.B.dylib \t0x30d7c2c4 kill + 4\r\n2 libSystem.B.dylib \t0x30d7c2b6 raise + 10\r\n3 libSystem.B.dylib \t0x30d90d72 abort + 50\r\n4 libstdc++.6.dylib \t0x34981a20 __gnu_cxx::__verbose_terminate_handler() + 376\r\n5 libobjc.A.dylib \t0x34a83594 _objc_terminate + 104\r\n6 libstdc++.6.dylib \t0x3497fdf2 __cxxabiv1::__terminate(void (*)()) + 46\r\n7 libstdc++.6.dylib \t0x3497fe46 std::terminate() + 10\r\n8 libstdc++.6.dylib \t0x3497ff16 __cxa_throw + 78\r\n9 libobjc.A.dylib \t0x34a824c4 objc_exception_throw + 64\r\n10 CoreFoundation \t0x3587c12c -[NSObject(NSObject) doesNotRecognizeSelector:] + 96\r\n11 CoreFoundation \t0x35823aa2 ___forwarding___ + 502\r\n12 CoreFoundation \t0x35823858 _CF_forwarding_prep_0 + 40\r\n13 tiapplication \t0x00091b3a -[TiProxy toString:] (TiProxy.m:1137)\r\n14 tiapplication \t0x00091bcc -[TiProxy description] (TiProxy.m:1145)\r\n15 CoreFoundation \t0x3580e63e -[NSObject(NSObject) _copyDescription] + 18\r\n16 CoreFoundation \t0x3580e564 CFCopyDescription + 80\r\n17 CoreFoundation \t0x3588bcec __CFBasicHashStandardCopyKeyDescription + 8\r\n18 CoreFoundation \t0x3588d224 __CFBasicHashCopyDescription_block_invoke_1 + 236\r\n19 CoreFoundation \t0x357e60f4 CFBasicHashApply + 124\r\n20 CoreFoundation \t0x3588d65c CFBasicHashCopyDescription + 680\r\n21 CoreFoundation \t0x3588d768 __CFBasicHashCopyDescription + 44\r\n22 CoreFoundation \t0x35855092 __CFDictionaryCopyDescription + 2\r\n23 CoreFoundation \t0x3580e5a2 CFCopyDescription + 142\r\n24 CoreFoundation \t0x3587a2be __NSFastEnumerationMutationHandler + 138\r\n25 libobjc.A.dylib \t0x34a88486 objc_enumerationMutation + 18\r\n26 tiapplication \t0x00033008 -[KrollBridge didReceiveMemoryWarning:] (KrollBridge.mm:224)\r\n27 Foundation \t0x3117561c _nsnote_callback + 136\r\n28 CoreFoundation \t0x3580111c __CFXNotificationPost_old + 396\r\n29 CoreFoundation \t0x35800dbc _CFXNotificationPostNotification + 112\r\n30 Foundation \t0x31164d1c -[NSNotificationCenter postNotificationName:object:userInfo:] + 64\r\n31 Foundation \t0x3116e23a -[NSNotificationCenter postNotificationName:object:] + 18\r\n32 UIKit \t0x342aada2 -[UIApplication _performMemoryWarning] + 42\r\n33 UIKit \t0x342ab9c4 -[UIApplication _receivedMemoryNotification] + 120\r\n34 UIKit \t0x342a8770 _memoryStatusChanged + 36\r\n35 CoreFoundation \t0x358310c6 __CFNotificationCenterDarwinCallBack + 18\r\n36 CoreFoundation \t0x35817be0 __CFMachPortPerform + 204\r\n37 CoreFoundation \t0x3580f6f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20\r\n38 CoreFoundation \t0x3580f6bc __CFRunLoopDoSource1 + 160\r\n39 CoreFoundation \t0x35801f76 __CFRunLoopRun + 514\r\n40 CoreFoundation \t0x35801c80 CFRunLoopRunSpecific + 224\r\n41 CoreFoundation \t0x35801b88 CFRunLoopRunInMode + 52\r\n42 GraphicsServices \t0x320c84a4 GSEventRunModal + 108\r\n43 GraphicsServices \t0x320c8550 GSEventRun + 56\r\n44 UIKit \t0x341dc322 -[UIApplication _run] + 406\r\n45 UIKit \t0x341d9e8c UIApplicationMain + 664\r\n46 tiapplication \t0x00003bb8 main (main.m:36)\r\n47 tiapplication \t0x0000345c 0x1000 + 9308\r\n{code}\r\n\r\n{code:title=Responsible thread}\r\nThread 3:\r\n0 libSystem.B.dylib \t0x30d31398 pread + 20\r\n1 libsqlite3.dylib \t0x3617afaa _sqlite3_purgeEligiblePagerCacheMemory + 218\r\n2 libsqlite3.dylib \t0x3617ccb6 _sqlite3_purgeEligiblePagerCacheMemory + 7654\r\n3 libsqlite3.dylib \t0x361727d8 sqlite3_db_status + 996\r\n4 libsqlite3.dylib \t0x36189062 sqlite3_extended_errcode + 18502\r\n5 libsqlite3.dylib \t0x361890fa sqlite3_extended_errcode + 18654\r\n6 libsqlite3.dylib \t0x36189126 sqlite3_extended_errcode + 18698\r\n7 libsqlite3.dylib \t0x36189168 sqlite3_extended_errcode + 18764\r\n8 libsqlite3.dylib \t0x36189246 sqlite3_extended_errcode + 18986\r\n9 libsqlite3.dylib \t0x36192e80 sqlite3_column_bytes16 + 5752\r\n10 libsqlite3.dylib \t0x361b0c48 fts3DbExec + 21492\r\n11 libsqlite3.dylib \t0x36171de4 sqlite3_step + 56\r\n12 tiapplication \t0x0002abe8 -[PLSqliteResultSet next] (PLSqliteResultSet.m:147)\r\n13 tiapplication \t0x000a7b52 -[TiDatabaseProxy execute:] (TiDatabaseProxy.m:153)\r\n14 CoreFoundation \t0x35825cfc __invoking___ + 60\r\n15 CoreFoundation \t0x35825bce -[NSInvocation invoke] + 102\r\n16 tiapplication \t0x0003a622 -[KrollMethod call:] (KrollMethod.m:247)\r\n17 tiapplication \t0x0003984e KrollCallAsFunction (KrollMethod.m:42)\r\n18 tiapplication \t0x00171c80 TI::TiCallbackObject::call(TI::TiExcState*, TI::TiObject*, TI::TiValue, TI::ArgList const&) (TiCallbackObjectFunctions.h:396)\r\n19 tiapplication \t0x0015d550 TI::Interpreter::privateExecute(TI::Interpreter::ExecutionFlag, TI::RegisterFile*, TI::TiExcState*, TI::TiValue*) (Interpreter.cpp:3645)\r\n20 tiapplication \t0x0015f966 TI::Interpreter::execute(TI::FunctionExecutable*, TI::TiExcState*, TI::TiFunction*, TI::TiObject*, TI::ArgList const&, TI::ScopeChainNode*, TI::TiValue*) (Interpreter.cpp:815)\r\n21 tiapplication \t0x00169718 TI::TiFunction::call(TI::TiExcState*, TI::TiValue, TI::ArgList const&) (TiFunction.cpp:146)\r\n22 tiapplication \t0x001447fa TI::call(TI::TiExcState*, TI::TiValue, TI::CallType, TI::CallData const&, TI::TiValue, TI::ArgList const&) (CallData.cpp:46)\r\n23 tiapplication \t0x00170594 TiObjectCallAsFunction (TiObjectRef.cpp:449)\r\n24 tiapplication \t0x000403fa -[KrollObject triggerEvent:withObject:thisObject:] (KrollObject.m:1528)\r\n25 tiapplication \t0x00034ec0 -[KrollEvent invoke:] (KrollContext.mm:658)\r\n26 tiapplication \t0x00035ec6 -[KrollContext invoke:] (KrollContext.mm:895)\r\n27 tiapplication \t0x00036baa -[KrollContext main] (KrollContext.mm:1207)\r\n28 Foundation \t0x3116c192 -[NSThread main] + 38\r\n29 Foundation \t0x31165242 __NSThread__main__ + 966\r\n30 libSystem.B.dylib \t0x30d7d886 _pthread_start + 242\r\n31 libSystem.B.dylib \t0x30d72a88 thread_start + 0\r\n{code}\r\n\r\nThe problem is so dependent on OS scheduling, memory conditions, core availability, jetsam behavior, and possibly even iOS version, that it is nearly impossible to reproduce. The bug description and summary was worked backwards from the crash report.", "attachment": [], "flagged": false, "summary": "iOS: registeredProxies mutated during -[KrollBridge didReceiveMemoryWarning:]", "creator": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "166606", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The real problem, of course, is that we can't suspend/block our OWN threads as soon as a memory warning comes in. We need to have a discussion about memory management infrastructure vs. threading.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-22T05:50:39.000+0000", "updated": "2011-09-22T05:50:39.000+0000" }, { "id": "175666", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "qe cannot test - closing", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-10T10:53:35.000+0000", "updated": "2011-12-10T10:53:35.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }