{ "id": "79093", "key": "AC-3089", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2011-09-07T07:12:08.000+0000", "created": "2011-08-10T11:45:54.000+0000", "labels": [ "1.7.2", "database", "defect", "ios" ], "versions": [], "issuelinks": [ { "id": "12666", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "79534", "key": "TIMOB-5196", "fields": { "summary": "Reading from a database crashes the app", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "updated": "2016-03-08T07:48:08.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Copy this code into a newly created project\r\n\r\n{noformat}\r\nvar num_rows = 100;\r\nvar dbname = 'user_db5.db';\r\nvar db = Titanium.Database.open(dbname);\r\ndb.execute('DROP TABLE IF EXISTS playlist');\r\ndb.execute('CREATE TABLE IF NOT EXISTS playlist (category_id INTEGER KEY PRIMARY KEY)');\r\nfor(var i = 0; i < num_rows; ++i)\r\n{\r\n db.execute('INSERT INTO playlist(category_id) VALUES(?)', i); \r\n}\r\ndb.close();\r\nvar win1 = Ti.UI.createWindow({backgroundColor:'blue'});\r\nwin1.addEventListener('focus', function(){\r\n var db = Titanium.Database.open(dbname);\r\n for(var j = 0; j < num_rows * 100; ++j)\r\n {\r\n var r = j % 100;\r\n var rows = db.execute('SELECT * FROM playlist WHERE category_id=?', r);\r\n var id = rows.fieldByName('category_id');\r\n Ti.API.info('id = ' + id);\r\n rows.close();\r\n }\r\n db.close();\r\n});\r\nvar win2 = Ti.UI.createWindow({backgroundColor:'red'});\r\nvar tab_group = Ti.UI.createTabGroup();\r\ntab_group.addTab(\r\n Ti.UI.createTab({window:win1})\r\n);\r\ntab_group.addTab(\r\n Ti.UI.createTab({window:win2})\r\n);\r\ntab_group.open();\r\n{noformat}\r\nRun in IOS simulator\r\nSwitch between tabs until crash occurs. \r\n\r\nIn Studio the application will just exit, running under XCode gives a EXC_BAD_ACCESS with the following callstack\r\n{noformat}\r\n#0 0x002d7bab in _Z4toJSPN2TI10TiExcStateEPK13OpaqueTiValue [inlined] at /Users/stiv/src/appcelerator/tijscore/TiCore/API:75\r\n#1 0x002d7bab in TiObjectSetProperty at /Users/stiv/src/appcelerator/tijscore/TiCore/API/TiObjectRef.cpp:295\r\n#2 0x00056291 in -[KrollObject noteObject:forTiString:context:] at /Users/martinslater/code/EasyLang/mobile/EasyLang Mobile/build/iphone/Classes/KrollObject.m:1302\r\n#3 0x0005155b in KrollGetProperty ()\r\n#4 0x002da7ff in TI::TiCallbackObject::getOwnPropertySlot(TI::TiExcState*, TI::Identifier const&, TI::PropertySlot&) ()\r\n#5 0x002b8b2a in _ZN2TI6TiCell22fastGetOwnPropertySlotEPNS_10TiExcStateERKNS_10IdentifierERNS_12PropertySlotE [inlined] ()\r\n#6 0x002b8b2a in TI::TiValue::get(TI::TiExcState*, TI::Identifier const&, TI::PropertySlot&) const ()\r\n#7 0x002b6126 in cti_op_get_by_id_generic ()\r\n#8 0x0c3f9746 in ()\r\n#9 0x00273415 in TI::Interpreter::execute(TI::FunctionExecutable*, TI::TiExcState*, TI::TiFunction*, TI::TiObject*, TI::ArgList const&, TI::ScopeChainNode*, TI::TiValue*) at /Users/stiv/src/appcelerator/tijscore/TiCore/jit/JITCode.h:84\r\n#10 0x002c4bed in TI::TiFunction::call(TI::TiExcState*, TI::TiValue, TI::ArgList const&) ()\r\n#11 0x0023c30b in TI::call(TI::TiExcState*, TI::TiValue, TI::CallType, TI::CallData const&, TI::TiValue, TI::ArgList const&) ()\r\n#12 0x002d7816 in TiObjectCallAsFunction ()\r\n#13 0x00056d53 in -[KrollObject triggerEvent:withObject:thisObject:] ()\r\n#14 0x000492a1 in -[KrollEvent invoke:] ()\r\n#15 0x0004800d in -[KrollContext invoke:] ()\r\n#16 0x00046bee in -[KrollContext main] ()\r\n#17 0x0067acf4 in -[NSThread main] ()\r\n{noformat}\r\n\r\nSee [Q&A|http://developer.appcelerator.com/question/123951/crash-updating-window-from-focus-event-while-querying-database--ios-43--sdk-172]", "attachment": [], "flagged": false, "summary": "Running a large number of queries on a database causes crash", "creator": { "name": "mslater@hellinc.net", "key": "mslater@hellinc.net", "displayName": "Martin Slater", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mslater@hellinc.net", "key": "mslater@hellinc.net", "displayName": "Martin Slater", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK Version : 1.7.2\r\nPlatform : IOS 4.3 \r\nDevice : Simulator\r\nHost Operating System : OS X Lion\r\n\r\nTitanium Studio, build: 1.0.2.201107130739\r\n(c) Copyright 2011 by Appcelerator, Inc. All rights reserved.\r\n\r\nBuild date: 13 July 2011, 07:42:08\r\n", "comment": { "comments": [ { "id": "162489", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Martin\n\nThere are problems with your usecase that may be impacting the stability of your app. Please make sure you have received adequate advice in the Q&A before you consider a crash must be the result of a bug.\n\nI will make some suggestions in your question, and hopefully we can get to the bottom of it.\n\nI will close this ticket for the moment, and we will open it again if it turns out, in actual fact, to be a bug.\n\nNote that this ticket is missing some information. Please follow the [Jira Ticket Checklist|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist] when raising tickets.\n\nThanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-10T14:23:14.000+0000", "updated": "2011-08-10T14:23:14.000+0000" }, { "id": "163273", "author": { "name": "mslater@hellinc.net", "key": "mslater@hellinc.net", "displayName": "Martin Slater", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hey Paul, \r\n\r\nJust wondering when you will be able to get a fix in for this. I am about 3-4 weeks away from release and this is one of 2 issues currently that will hold that back. (other is a sound issue in 1.7.2 that I'm still trying to get a solid repro for where they start playing and cut out)\r\n\r\nthanks\r\n\r\nMartin", "updateAuthor": { "name": "mslater@hellinc.net", "key": "mslater@hellinc.net", "displayName": "Martin Slater", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-17T17:03:05.000+0000", "updated": "2011-08-17T17:03:05.000+0000" }, { "id": "165201", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Martin\n\nPlease watch the linked ticket for the ongoing status of this issue. Thank you.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-09-07T07:12:08.000+0000", "updated": "2011-09-07T07:12:08.000+0000" }, { "id": "177249", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Ticket resolved and not updated since last curator action.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-12-27T06:40:49.000+0000", "updated": "2011-12-27T06:40:49.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }