{ "id": "107391", "key": "TIMOB-12209", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15079", "description": "2013 Sprint 02 API", "name": "2013 Sprint 02 API", "archived": true, "released": true, "releaseDate": "2013-01-28" }, { "id": "14812", "description": "2013 Sprint 02", "name": "2013 Sprint 02", "archived": true, "released": true, "releaseDate": "2013-01-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-01-15T14:20:03.000+0000", "created": "2013-01-04T16:51:34.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "qe-testadded" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-10-04T07:43:50.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "The application crashes when accessing the properties from contacts. The test case is provided below and crash logs are attached.\r\nh4. Steps to Repo\r\n1. Run the below code in the app.js of your project.\r\n2. The application crashes while trying to access the device contacts.\r\n\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({\r\n\t\ttitle : 'Tab 1',\r\n\t\tbackgroundColor : '#fff'\r\n\t});\r\n\r\nvar people = Ti.Contacts.getAllPeople();\r\nTi.API.info('Total contacts: ' + people.length);\r\nTi.API.info('All contacts: ' + JSON.stringify(people));\r\n\r\nwin1.open(); \r\n{code}\r\n\r\nh6.Additional details\r\ntc2 attachment reproduces the issue as well. Target environment has been already in summary.", "attachment": [ { "id": "34559", "filename": "tc1_log", "author": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-04T16:51:34.000+0000", "size": 38580, "mimeType": "application/octet-stream" }, { "id": "34560", "filename": "tc2", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-04T17:00:31.000+0000", "size": 44891, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "Android: Accessing properties from contacts crashes the app", "creator": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [ { "id": "107886", "key": "TIMOB-12290", "fields": { "summary": "3_0_X Backport: TIMOB-12209", "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": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } ], "reporter": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.0.0.GA\r\nSamsung Galaxy SII\r\nAndroid 2.3.6", "comment": { "comments": [ { "id": "233326", "author": { "name": "patakijv", "key": "patakijv", "displayName": "John V Pataki", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Per the details in tc2, the property in question here is most certainly the \"image\" property. If you comment out the last 3 lines of the code in the tc2 content so it never attempts person[\"image\"], then the crash will go away. This is not as apparent if you only review the code block listed in the \"Steps to Repo\" portion of this ticket.\r\n\r\n", "updateAuthor": { "name": "patakijv", "key": "patakijv", "displayName": "John V Pataki", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-04T17:22:51.000+0000", "updated": "2013-01-04T17:22:51.000+0000" }, { "id": "233906", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Accessing the image property will trigger memory allocations. If the image is large it could lead out of memory crashes.\nIf you wish to serialize the contact you may need to filter only the properties you care about.\n\nExample:\n\n{code:javascript}\n JSON.stringify(contacts, ['phone', 'address', ...]); // array specifies properties to serialize\n{code}\n", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-10T17:45:37.000+0000", "updated": "2013-01-10T17:45:37.000+0000" }, { "id": "233958", "author": { "name": "patakijv", "key": "patakijv", "displayName": "John V Pataki", "active": true, "timeZone": "America/Los_Angeles" }, "body": "1) Stringifying the entire contacts array is not the only way this problem shows up - please review the code block in tc2 where the image property is attempting to be accessed in a loop and the problem will show up eventually.\r\n\r\n2) Being able to access the image properties is a requirement so we can't solve the issue by avoiding the image property as a long term solution\r\n", "updateAuthor": { "name": "patakijv", "key": "patakijv", "displayName": "John V Pataki", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-11T10:23:11.000+0000", "updated": "2013-01-11T10:23:11.000+0000" }, { "id": "234280", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/3707", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-14T17:05:22.000+0000", "updated": "2013-01-14T17:05:22.000+0000" }, { "id": "239617", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Not crashing any more.\r\nEnvironment used for verification -\r\nTitanium SDK: 3.1.0.v20130223030327\r\nTitanium  Studio:3.0.2.201302141201\r\nDevice: Samsung GALAXY Note Android 2.3.6", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-25T07:25:23.000+0000", "updated": "2013-02-25T07:25:23.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }