{ "id": "78003", "key": "TIMOB-4751", "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": "11363", "description": "Mobile 1.8.0 M10", "name": "Sprint 2011-31", "archived": true, "released": true, "releaseDate": "2011-08-08" } ], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2011-08-01T11:54:31.000+0000", "created": "2011-07-20T05:10:22.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "bad_access", "callback", "xmlparsing" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-02-09T14:02:43.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" } ], "attachment": [ { "id": "21926", "filename": "stacktrace.txt", "author": { "name": "dade@dadeb.it", "key": "dade@dadeb.it", "displayName": "Davide Bertola", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-07-21T02:50:43.000+0000", "size": 1590, "mimeType": "text/plain" } ], "flagged": false, "summary": "Random crash using getElementsByTagName to parse XML", "creator": { "name": "dade@dadeb.it", "key": "dade@dadeb.it", "displayName": "Davide Bertola", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dade@dadeb.it", "key": "dade@dadeb.it", "displayName": "Davide Bertola", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* iOS 4.3.3\r\n* Ti 1.7.0, 1.7.1, 1.7.2 and Git version (daily updated)\r\n* XCode 4\r\n* Snow Leopard OSX 10.6.8", "comment": { "comments": [ { "id": "160347", "author": { "name": "dade@dadeb.it", "key": "dade@dadeb.it", "displayName": "Davide Bertola", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I don't know if it's useful but we discovered that we can workaround the crash rewriting the code like this\r\n\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar app = {};\r\n\r\nvar win = Ti.UI.createWindow({\r\n\ttitle: \"Nope\"\r\n});\r\n\r\nvar test = Ti.XML.parseString (\"ciao\");\r\nvar result = [];\r\nfunction crashIt () {\r\n\tfor (var i=0; i<1000; i++) {\r\n\t\tsetTimeout (function () {\r\n\t\t\tvar foo = test.getElementsByTagName (\"lat\").item (0).text;\r\n\t\t\tresult.push (i + \" - \" + foo);\r\n\t\t}, 1);\r\n\t}\r\n}\r\ncrashIt ();\r\n\r\n//Ti.API.debug (result);\r\n\r\nwin.open ();\r\n{code}", "updateAuthor": { "name": "dade@dadeb.it", "key": "dade@dadeb.it", "displayName": "Davide Bertola", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-07-22T11:55:41.000+0000", "updated": "2011-07-22T11:56:04.000+0000" }, { "id": "160396", "author": { "name": "dade@dadeb.it", "key": "dade@dadeb.it", "displayName": "Davide Bertola", "active": true, "timeZone": "America/Los_Angeles" }, "body": "inside KrollObject, in function ConvertIdTiValue around line 266 we have\r\n\r\n{code}\r\n\telse if ([obj isKindOfClass:[KrollMethod class]])\r\n\t{\r\n\t\tKrollContext * ourContext = [(KrollMethod *)obj context];\r\n\t\tif (context == ourContext)\r\n\t\t{\r\n\t\t\treturn [(KrollMethod *)obj jsobject];\r\n\t\t}\r\n\t\treturn TiObjectMake(jsContext,KrollMethodClassRef,obj);\r\n\t}\r\n{code}\r\n\r\ndisabling the internal IF seems to fix the crash, but don't know why\r\n\r\n{code}\r\n\telse if ([obj isKindOfClass:[KrollMethod class]])\r\n\t{\r\n\t\tKrollContext * ourContext = [(KrollMethod *)obj context];\r\n\t\tif (context == ourContext && 0)\r\n\t\t{\r\n\t\t\treturn [(KrollMethod *)obj jsobject];\r\n\t\t}\r\n\t\treturn TiObjectMake(jsContext,KrollMethodClassRef,obj);\r\n\t}\r\n{code}\r\n\r\nI hope this helps", "updateAuthor": { "name": "dade@dadeb.it", "key": "dade@dadeb.it", "displayName": "Davide Bertola", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-07-22T22:29:54.000+0000", "updated": "2011-07-22T22:29:54.000+0000" }, { "id": "160937", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "h4.Associated HD ticket\r\nA PRO customer relies on this, http://appc.me/c/APP-414331\r\n\r\nh4.Repro sequence\r\nOnce this snippet code starts working and parsing XML data, occasionally app crashes.\r\n{code:title=app.js}\r\nvar xhr = Ti.Network.createHTTPClient();\r\nxhr.open(\"GET\",\"http://v2.0.news.tmg.s3.amazonaws.com/feeds/news.xml\");\r\n xhr.onload = function()\r\n {\r\n try \r\n {\r\n var doc = this.responseXML.documentElement;\r\n var items = doc.getElementsByTagName(\"item\");\r\n var x = 0;\r\n var doctitle = doc.evaluate(\"//channel/title/text()\").item(0).nodeValue;\r\n\r\n\r\n\r\n for (var c=0, l=items.length;c '+elemTitle);\r\n\r\n var elemUrl = item.getElementsByTagName(\"link\").item(0).text;\r\n Ti.API.info('-> '+elemUrl);\r\n //Get and format the date\r\n\r\n var origDate = item.getElementsByTagName(\"pubDate\").item(0).text; \r\n\r\n var date_arr = origDate.split(\" \");\r\n\r\n var elemDate = date_arr[2]+\" \"+date_arr[1]+\", \"+date_arr[3];\r\n\r\n //Push to the array\r\n articlesData.push({\r\n title:elemTitle,\r\n url:elemUrl,\r\n date:elemDate\r\n });\r\n\r\n }\r\n Ti.App.Properties.setList('articlesProp', articlesData);\r\n\r\n }\r\n catch(E)\r\n {\r\n alert(E);\r\n }\r\n };\r\n\r\n xhr.send();\r\n{code}", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-07-27T19:06:36.000+0000", "updated": "2011-07-27T19:06:36.000+0000" }, { "id": "161321", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As of Aug 1, could not crash on device or simulator. Given the crash log given, it's highly likely that this was fixed by the new TiJSCore update that happened recently.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-01T11:54:31.000+0000", "updated": "2011-08-01T11:54:31.000+0000" }, { "id": "182637", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "closing as we are not able to reproduce using master (1.9.0 Feb 9 2012 09:46 rd47ce8a4)", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-09T14:02:43.000+0000", "updated": "2012-02-09T14:02:43.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }