{ "id": "165909", "key": "TIMOB-24389", "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": "19275", "description": "Patch release for 6.0.x regressions or important fixes", "name": "Release 6.0.3", "archived": false, "released": true, "releaseDate": "2017-03-22" } ], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2017-07-11T07:57:11.000+0000", "created": "2017-02-09T05:03:20.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "18154", "name": "Release 6.0.1", "archived": false, "released": true, "releaseDate": "2016-12-21" } ], "issuelinks": [ { "id": "55327", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "168736", "key": "TIMOB-24918", "fields": { "summary": "iOS: Fix the problem of late GC'ing of objects while using main thread ", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "54304", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "164964", "key": "TIMOB-24206", "fields": { "summary": "iOS: Memory leaks after select camera or photo gallery with jscore framework", "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": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-08-07T18:01:12.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": "h5. Problem Description:\r\nTitanium App Crashes after some Camera usage time.\r\n\r\nh5. Steps to Reproduce:\r\n- Use the attached app.js code in a classic app. tiapp.xml file is also attached.\r\n- Touch \"open camera\"\r\n- Take picture\r\n- Touch \"Use Photo\"\r\n- Repeat steps 30-35 times.\r\n\r\nh5. Actual Result\r\nApp crashes during the process of taking picture in above scenario.\r\n\r\nh5.Expected Results:\r\n\r\nApp should work usual and should not crash.\r\n\r\nh5. Some more details and question from customer:\r\nRemarks: \r\n- iOS 10.2 camera permission is set\r\n- Happens once/twice a day.\r\n- Not directly/always reproducible\r\n- App closes and iOS springboard gets visible \r\n- Fabric.io is configured for crash reporting, but no crashes are captured (seems that Fabric doesn't get the chance to capture the crash).\r\n\r\nWe couldn't get any logs of the issue due the fact production devices are not within reach.\r\n\r\nQuestion: is it possible that iOS kills the app because the camera screen (iOS app) takes a lot of memory/resources?\r\n\r\n", "attachment": [ { "id": "61526", "filename": "app.js", "author": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "created": "2017-02-09T05:03:01.000+0000", "size": 533, "mimeType": "text/javascript" }, { "id": "61722", "filename": "Bildschirmfoto 2017-02-24 um 11.40.12.png", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-24T15:38:37.000+0000", "size": 56442, "mimeType": "image/png" }, { "id": "61721", "filename": "Bildschirmfoto 2017-02-24 um 11.42.04.png", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-24T15:38:37.000+0000", "size": 146660, "mimeType": "image/png" }, { "id": "61727", "filename": "InstrumentsLog24389.trace.zip", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-25T01:34:33.000+0000", "size": 753535, "mimeType": "application/zip" }, { "id": "62668", "filename": "SampleCameraApp.zip", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-15T08:07:50.000+0000", "size": 26952, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: Appcelerator Titanium App Crashes after some usage time", "creator": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "subtasks": [], "reporter": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "environment": "iPad mini\r\niPad Pro\r\niOS 10.2\r\nSDK 6.0.1.GA\r\n", "closedSprints": [ { "id": 847, "state": "closed", "name": "2017 Sprint 05 SDK", "startDate": "2017-02-26T17:39:21.095Z", "endDate": "2017-03-12T17:39:00.000Z", "completeDate": "2017-03-12T19:14:38.838Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "406709", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I cannot see a crash-log, please attach. And did this also happen n earlier versions of the SDK (5.5.x)? If we have those infos, we can patch it for 6.0.2, thx!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-09T09:08:26.000+0000", "updated": "2017-02-09T09:22:50.000+0000" }, { "id": "406794", "author": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "body": "[~hansknoechel] : Attaching the crash log for the app I tested at my end. Also with couple of test with SDK 5.5.0 and CLI 5.5.0, i did not see any crash. I can't confirm it yet. I will check once more and post it here.", "updateAuthor": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "created": "2017-02-10T04:39:07.000+0000", "updated": "2017-02-10T04:39:07.000+0000" }, { "id": "406795", "author": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "body": "crash log.", "updateAuthor": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "created": "2017-02-10T04:39:42.000+0000", "updated": "2017-02-10T04:39:42.000+0000" }, { "id": "406832", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Here is the related crash-log:\r\n\r\n{quote}\r\nTCC, This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.\r\n{quote}\r\n\r\nSo either they didn't add the {{NSCameraUsageDescription}} key to the plist like noted in both the 5.5.0 and 6.0.0 release, or the crash comes from an invalid test-case to reproduce the issue.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-10T22:58:42.000+0000", "updated": "2017-02-11T19:28:26.000+0000" }, { "id": "406942", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Made the ticket private.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-13T23:44:22.000+0000", "updated": "2017-02-13T23:44:22.000+0000" }, { "id": "406949", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I was able to reproduce the issue. Here is the environment, and a description of what I did:\r\n\r\nNPM Version: 2.15.9\r\nNode Version: 4.5.0\r\nMac OS: 10.12.1\r\nAppc CLI: 6.1.0\r\nAppc CLI NPM: 4.2.8\r\nTitanium SDK version: 6.0.1. GA\r\nAppcelerator Studio, build: 4.8.1.201612050850\r\niOS Device: 10\r\n\r\nI tested this by following the steps the reporter outlined. I clicked the button to take a picture, and the then clicked on the \"Use Picture\". After 35 times, the app crashed. The crashed occurred when clicking to take the picture.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-14T01:42:52.000+0000", "updated": "2017-02-14T16:02:18.000+0000" }, { "id": "407485", "author": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "body": "[~hansknoechel] : Do you have any updates on it? ", "updateAuthor": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "created": "2017-02-21T17:05:51.000+0000", "updated": "2017-02-21T17:05:51.000+0000" }, { "id": "407634", "author": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "body": "[~hansknoechel] : I have shared it over email.", "updateAuthor": { "name": "nmishra", "key": "nmishra", "displayName": "Neeraj Mishra", "active": true, "timeZone": "America/Phoenix" }, "created": "2017-02-22T22:57:12.000+0000", "updated": "2017-02-22T22:57:12.000+0000" }, { "id": "407958", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've fixed it. Tested with both main- and kroll-thread monitoring it with Instruments. The heap grows per image and is autoreleased a few seconds afterwards. I implemented an autorelease-pool around the sensitive core-image operation (the internal rotation of the image), retained the resulting image by the current context and released it after creating a blob from it. I also attached [two Instruments-traces|https://www.dropbox.com/s/h0jgv9pqr1hpqtt/OpenPhotoGallery-Traces.zip?dl=1] that show the leak (before) and the fix using the PR (afterwards), as well as some insights on the memory analysis. \r\n\r\nWe could still include it in the 6.0.2.GA if the fix get's an approval before next Monday. [~emerriman] could your team test the issue today already? I know Vijay is on Holiday until Monday, so we could the fix in place before. Thx!\r\n\r\nPR: https://github.com/appcelerator/titanium_mobile/pull/8849\r\n\r\nTest-Case (based on the one from the customer, modified to validate the fix by setting the image-view image as well):\r\n{code:js}\r\nvar welcomeWindow = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar button = Ti.UI.createButton({ \r\n title: 'Open Camera', \r\n top: 50\r\n});\r\n\r\nvar imgView = Ti.UI.createImageView();\r\n\r\nbutton.addEventListener('click', function() {\r\n // Change to \"openPhotoGallery\" to test gallery as well\r\n Ti.Media.showCamera({\r\n success: function(e) {\r\n imgView.image = null;\r\n imgView.image = e.media;\r\n },\r\n error: function() { },\r\n cancel: function() { },\r\n allowEditing: false,\r\n mediaTypes: [ Ti.Media.MEDIA_TYPE_PHOTO ]\r\n });\r\n});\r\n\r\nwelcomeWindow.add(imgView);\r\nwelcomeWindow.add(button);\r\nwelcomeWindow.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-24T13:59:39.000+0000", "updated": "2017-02-26T12:16:36.000+0000" }, { "id": "408007", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Using this environment:\r\nNPM Version: 2.15.9\r\nNode Version: 4.5.0\r\nMac OS: 10.12.3\r\nAppc CLI: 6.1.0\r\nAppc CLI NPM: 4.2.8\r\nAppcelerator Studio, build: 4.8.1.201612050850\r\niOS Device: 10.0\r\n\r\nI did FR, and found that the app still crashes after 30 times when cycling between taking a picture and using picture. I tried this on main thread and also with jscore and in both cases the app crashes. I had Instruments running, and attached is the log \"InstrumentsLog24389.trace.zip\"\r\n", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-25T01:33:36.000+0000", "updated": "2017-02-25T01:36:43.000+0000" }, { "id": "408023", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel] I verified the changes on main thread. In my case after 5-6 image memory get released and if I continue app get crashed after 16 more images . Instrument trace are https://www.dropbox.com/s/1quujgplkvjqs2g/Instruments_crash.trace.zip?dl=0 .\r\nProblem looks at core level. We have to dig out more for solution.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-27T07:13:30.000+0000", "updated": "2017-02-27T10:12:51.000+0000" }, { "id": "408025", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I can reproduce it again. The {{adjustRotation}} method is still causing it. I don't think it's on the core-level, because Kroll-objects are unaffected. The results from the CoreGraphics operations are causing it, as it can be seen in the Instruments details (see attached images). I tried releases the CGContext and CGImage manually, but a) this is done by {{UIGraphicsEndImageContext}} and b) calling it manually will crash the app. The issue is caused by the reference image ({{imgRef}}}) that doesn't get released, the actual result of the CG-operation is properly released.\r\n\r\nWe need to check other solutions this week and I also want to create a native sample app to check the behavior there. Will ping back soon, thx!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-27T08:47:36.000+0000", "updated": "2017-02-27T08:47:36.000+0000" }, { "id": "408027", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have verified it by replacing line -\r\n\r\n{code:java}\r\n resultImage = [TiUtils adjustRotation:editedImage ?: originalImage];\r\nwith\r\nresultImage = editedImage?:originalImage;\r\n{code}\r\n\r\nThis is also causing the same problem. So the problem is not with adjustRotation method.\r\n\r\nChecking behavior with native sample app is good idea.\r\n\r\n ", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-27T10:22:08.000+0000", "updated": "2017-02-27T10:22:08.000+0000" }, { "id": "408197", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "On basis of few points (mentioned below)\r\n1.In case of KROLL THREAD due to below code snippet in KrollContext.m the heap is getting released early -\r\nif (loopCount == GC_LOOP_COUNT){\r\n[self forceGarbageCollectNow];\r\n}\r\nSo heap do not grow much in this case.\r\n2. In case of main thread, after reaching near crash point(e.g if crash is happening with 30 image, use 29 image), wait for approx. 10 mints (sometimes early). Heap will get release.\r\n3. So similar to point 1 forceGarbageCollectNow called in mentioned PR, which will release heap early.\r\n\r\nPR :https://github.com/appcelerator/titanium_mobile/pull/8853\r\n\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-01T09:07:21.000+0000", "updated": "2017-03-01T09:07:21.000+0000" }, { "id": "409447", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I continue to get a crash after 22-26 picture takings when both main thread and jscore framework are true. If either are false, I do not encounter the crash. Also, as you say [~vijaysingh], if I wait just before the crash then the heap will be released and I can continue taking pictures after some time. The question is: Is this the intended and now expected behavior?", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-06T23:20:32.000+0000", "updated": "2017-03-06T23:20:32.000+0000" }, { "id": "409472", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Please note that this fix is only for this ticket (the customers has main-thread, no JSCore enabled). For JSCore, we track TIMOB-24206.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-07T07:06:06.000+0000", "updated": "2017-03-07T07:06:06.000+0000" }, { "id": "409643", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR passed, using:\r\nMacOS 10.12 (16A323)\r\nStudio 4.8.1.201612050850\r\nTi SDK 6.1.0\r\nAppc NPM 4.2.8\r\nAppc CLI 6.1.0\r\nAlloy 1.9.5\r\nXcode 8.2.1 (8C1002)\r\n\r\nTested using the provided sample code by taking over 50 pictures in the app, built with main-thread enabled and disabled. No crash was encountered unless JScore was also enabled. This will be addressed by another ticket/PR.\r\n\r\nVerified in SDK 6.1.0.v20170307133328", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-07T21:14:38.000+0000", "updated": "2017-03-07T21:55:52.000+0000" }, { "id": "409644", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel], [~vijaysingh]: Can we get a backport to 6_0_X or have the fixVersion updated accordingly?", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-07T21:17:35.000+0000", "updated": "2017-03-07T21:17:35.000+0000" }, { "id": "409794", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backported PR : https://github.com/appcelerator/titanium_mobile/pull/8864\r\n[~hansknoechel] Please review.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-08T04:41:12.000+0000", "updated": "2017-03-08T04:42:17.000+0000" }, { "id": "410289", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified in SDKs 6.0.3.v20170309031327 and 6.1.0.v20170307133328", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T16:41:54.000+0000", "updated": "2017-03-09T16:41:54.000+0000" }, { "id": "420572", "author": { "name": "ray@raymondverbruggen.nl", "key": "ray@raymondverbruggen.nl", "displayName": "Raymond Verbruggen", "active": true, "timeZone": "Europe/Berlin" }, "body": "Sorry but this is the only way of asking;\r\n\r\nThe issue has to to with NSCameraUsageDescription amongst others in a multi-language app.\r\nHowever I cannot file an issue in Jira...\r\n\r\nHow can I add an issue to Jira TIMOB? I can only create an issue into the Aptana Studio part...\r\n\r\n", "updateAuthor": { "name": "ray@raymondverbruggen.nl", "key": "ray@raymondverbruggen.nl", "displayName": "Raymond Verbruggen", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-29T12:20:42.000+0000", "updated": "2017-05-29T12:20:42.000+0000" }, { "id": "423889", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Resolving this ticket as per comment by [~nmishra].", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-11T07:57:11.000+0000", "updated": "2017-07-11T07:57:11.000+0000" }, { "id": "426009", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket with reference to the previous comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-08-07T18:01:12.000+0000", "updated": "2017-08-07T18:01:12.000+0000" } ], "maxResults": 47, "total": 47, "startAt": 0 } } }