{ "id": "130081", "key": "TIMOB-16924", "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": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2016-08-04T03:14:57.000+0000", "created": "2014-05-06T18:01:57.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-3.3.0" ], "versions": [ { "id": "15971", "description": "Release 3.2.3", "name": "Release 3.2.3", "archived": false, "released": true, "releaseDate": "2014-04-30" } ], "issuelinks": [ { "id": "38283", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "130524", "key": "AC-1695", "fields": { "summary": "iOS: Crash with Segmentation fault: 11, TiViewProxy", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-08-04T03:14:57.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": "*Details:* From this [QA thread|http://developer.appcelerator.com/question/173862/ios-crash---segmentation-fault-11], the user is experiencing an intermittent crash with \"Segmentation fault: 11\" exception being thrown when launching a Titanium app on iOS 7 device (see crash.log).\r\n\r\nAccording to the user, the bug is occurring in the TiViewProxy.m file (specifically, on the line \\[self parentForBubbling\\]). Hence, he fixed the issue by applying the fix to the following methods in the TiViewProxy.m file:\r\n{code}\r\n-(void)setParent:(TiViewProxy*)parent_\r\n{\r\n [parent_ retain];\r\n RELEASE_TO_NIL(parent);\r\n parent = parent_;\r\n \r\n if (parent_!=nil && [parent windowHasOpened])\r\n {\r\n [self windowWillOpen];\r\n }\r\n}\r\n{code}\r\n\r\nand\r\n\r\n{code}\r\n-(void)dealloc\r\n{\r\n RELEASE_TO_NIL(pendingAdds);\r\n RELEASE_TO_NIL(destroyLock);\r\n RELEASE_TO_NIL(parent);\r\n pthread_rwlock_destroy(&childrenLock);\r\n \r\n //Dealing with children is in _destroy, which is called by super dealloc.\r\n \r\n [super dealloc];\r\n}\r\n{code}\r\n\r\n*Note:* No Titanium sample code was provided.", "attachment": [ { "id": "47871", "filename": "crash.log", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-05-06T18:01:57.000+0000", "size": 2466, "mimeType": "text/plain" } ], "flagged": false, "summary": "iOS: TiViewProxy - An intermittent crash with \"Segmentation fault: 11\" exception being thrown when launching a Titanium app on iOS 7", "creator": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Titanium build: 3.2.3.201404181442\r\nSDK 3.2.3.GA\r\nDevice: iphone 5 (7.1.1)", "comment": { "comments": [ { "id": "303698", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Seems like this might be an easy fix for 3.3.0", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-06T20:00:53.000+0000", "updated": "2014-05-06T20:00:53.000+0000" }, { "id": "325876", "author": { "name": "thebrousse", "key": "thebrousse", "displayName": "Christian Brousseau", "active": true, "timeZone": "Europe/Berlin" }, "body": "I can reproduce the issue with 3.3 100% of the time. But the code base on which I am experiencing the issue is too convoluted to isolate one use case to replicate it. But I would be more than willing to test a continuous build that have this fix and (if possible) add as much info as I can.", "updateAuthor": { "name": "thebrousse", "key": "thebrousse", "displayName": "Christian Brousseau", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-09-26T17:58:13.000+0000", "updated": "2014-09-26T17:58:13.000+0000" }, { "id": "325886", "author": { "name": "thebrousse", "key": "thebrousse", "displayName": "Christian Brousseau", "active": true, "timeZone": "Europe/Berlin" }, "body": "It seems the bug comes from bad practices on the JS side. \r\nHere is basically what the defective code does:\r\n\r\nSay you have a window containing a text field that you want to update the value from another window. (you click on the field, a new window opens with a list of choices, you select an item from the list, the window closes and the field is now updated with the value you selected from the list) The \"recommended\" way to do it would be to pass a callback function to the popup window so it can be triggered when the user selects an element from the list. \r\n\r\nBut in this case (the one where it crashes) the original developer passed the *actual field* object to the other window. (stored in a local variable for greater readability I guess)) And then, when the user would select the value from the list, it would just set the value from the text field directly from the popup window. Now we close the popup window, it invalidates and frees the memory. *But*, when it tries to free the local variable containing the textfield from the original window, it should technically fail. (I am speculating here) \r\n\r\nSo the code would look something like this (keep in mind that I'm doing this by head)\r\n\r\n{code:title=app.js|borderStyle=solid}\r\nvar textField = Ti.UI.createTextField();\r\n\r\nvar popup = require('popup')(textField);\r\n\r\npopup.open();\r\n{code}\r\n\r\n{code:title=popup.js|borderStyle=solid}\r\n\r\nfunction popup(_fieldFromOtherWin) {\r\n var localVar = _fieldFromOtherWin;\r\n \r\n var newWin = Ti.UI.createWindow();\r\n \r\n newWin.addEventListener('click', function() {\r\n // We update the field through the local var\r\n localVal.text = 'Changed from another window';\r\n \r\n // We close the window, and all its children, but what happens to localVar \r\n // since it references to the textfield from the other window?\r\n newWin.close();\r\n });\r\n\r\n return newWin;\r\n}\r\nmodule.exports = popup;\r\n\r\n{code}", "updateAuthor": { "name": "thebrousse", "key": "thebrousse", "displayName": "Christian Brousseau", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-09-26T18:43:45.000+0000", "updated": "2014-09-26T18:45:52.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }