{ "id": "171744", "key": "TIMOB-26098", "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": [], "resolution": null, "resolutiondate": null, "created": "2018-06-05T22:00:42.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-06-05T22:15:33.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "We recently updated the Ti.Buffer API to be more comprehensive and tested. In a recent PR, I now noticed a crash occurring when calling \"toBlob\" on a Ti.Buffer instance (crash log attached). It looks like it instantiates a Ti.Blob successfully, but it then gets deallocated too early and crashes with a bad access.\r\n\r\nThis might either be related to [this change|https://github.com/appcelerator/titanium_mobile/commit/38f9ebcc506f9b5275ea9a032794fd66c6cb4502#diff-cf2c45a6e64c734d0a5fc57a971170d7R309] from 2 years ago or from [this change|https://github.com/appcelerator/titanium_mobile/pull/10028] a few months ago. I feel it might even have happened before these two, but haven't been surfaced before [~cwilliams] added the unit tests for it.", "attachment": [ { "id": "65249", "filename": "mocha_2018-05-31-162329_curlywurly-macos.crash", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-05T22:06:21.000+0000", "size": 166692, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "iOS: Simulator randomly crashes during Ti.Buffer \"toBlob()\" test", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "438150", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "A quick stress test does not trigger the crash (30+ runs):\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: 'Trigger'\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n var win2 = Ti.UI.createWindow({ backgroundColor: 'red' });\r\n win2.addEventListener('open', function () {\r\n var blob;\r\n\r\n // just a simple ascii string\r\n var buffer = Ti.createBuffer({\r\n length: 12\r\n });\r\n buffer[0] = 97; // a\r\n buffer[1] = 112; // p\r\n buffer[2] = 112; // p\r\n buffer[3] = 99; // c\r\n buffer[4] = 101; // e\r\n buffer[5] = 108; // l\r\n buffer[6] = 101; // e\r\n buffer[7] = 114; // r\r\n buffer[8] = 97; // a\r\n buffer[9] = 116; // t\r\n buffer[10] = 111; // o\r\n buffer[11] = 114; // r\r\n \r\n Ti.API.info(buffer.toString());\r\n \r\n blob = buffer.toBlob();\r\n Ti.API.info('BLOB LENGTH = ' + blob.length + ', BUFFER LENGTH = ' + buffer.length);\r\n Ti.API.info(blob.text);\r\n\r\n setTimeout(function () {\r\n win2.close();\r\n }, 1000);\r\n });\r\n\r\n win2.open();\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-05T22:15:25.000+0000", "updated": "2018-06-05T22:15:33.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }