[TIMOB-23871] iOS: Safari/WebInspector Debugger crashes app when hitting breakpoint
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-09-07T03:22:00.000+0000 |
Affected Version/s | Release 5.5.0 |
Fix Version/s | Release 6.0.0 |
Components | iOS |
Labels | qe-6.0.0 |
Reporter | Christopher Williams |
Assignee | Christopher Williams |
Created | 2016-09-06T14:39:03.000+0000 |
Updated | 2016-09-28T11:46:27.000+0000 |
Description
When attempting to hit a breakpoint in a callback function (i.e. inside a setInterval function callback, or on a click event callback for a label), the Safari WebInspector debugger crashes the Titanium app.
Note you need to set the value to try in your tiapp.xml to test.
This uses the "provided" JSCore engine for Titanium apps. As such, we should be able to use standard iOS tooling to debug the app, like Safari's debugger. However, the way we set up on particular object in the JS world, our code doesn't handle it. Specifically e hang a "Kroll" object off the global and ave it wrap a single instance of our KrollContext class in Obj-C. But all our code for handling wrapped JS objects assume it _always_ a KrollObject inside. In tis case, it's a KrollContext. So our Kroll*Property functions in KrollObject need to check for and handle this special object.
Here's the error causing the crash:
To reproduce: * launch a Titanium app with use-jscore-framework set to true and run-on-main-thread. (I used the standard template and just added a click listener for the label on each tab's content) * Open Safari > Develop > Simulator > JSContext. * Set a breakpoint in a callback function (i.e. on the label click event handler or a setInterval callback). * When it hits the breakpoint, it crashes.
Steps to test
1. appc new --classic 2. includeExpected Result
App will not crash and breakpoint works correctly. PRs reviewed and merged.Verified as fixed, Following the above test steps provided and using the latest 6.0.X SDK build, the app no longer crashes when hitting a breakpoint using the Safari/WebInspector Debugger, and the breakpoint works correctly. Tested On: iPhone 7 10.0 Simulator iPhone 6S 9.3 Simulator Mac OSX El Capitan 10.11.6 Ti SDK: 6.0.0.v20160919141738 Appc Studio: 4.8.0.201609101003 Appc NPM: 4.2.8-6 App CLI: 6.0.0-45 Xcode 8.0 Node v4.4.7 *Closing ticket.*