[AC-297] iOS: Debug crash when setting breakpoint in Resources controller file with 4.1SDK
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Duplicate |
Resolution Date | 2015-11-05T09:47:22.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Studio |
Labels | ios |
Reporter | Christy Thomas |
Assignee | Shak Hossain |
Created | 2015-08-12T12:52:39.000+0000 |
Updated | 2015-11-05T21:59:59.000+0000 |
Description
Reproduction:
1. Start with an older version of a titanium app built with 3.2 or 3.4SDK.
2. Upgrade to the new appcelerator
3. Import the old app into appcelerator
4. Change the tiapp.xml file of the app to 4.1.0SDK
5. Set a breakpoint in the resources directory controller js file
6. When the app hits the breakpoint the app crashes (see attached crash file)
This is from /var/log/system.log:
Aug 11 12:21:01 DW1415USBUM com.apple.xpc.launchd[1] (com.apple.ReportCrash[28863]): Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.ReportCrash
Aug 11 12:21:01 DW1415USBUM.local ReportCrash[28863]: Saved crash report for EndlessAisle[28784] version 1.0 (10) to /Users/cthomas/Library/Logs/DiagnosticReports/EndlessAisle_2015-08-11-122101_DW1415USBUM.crash
If I build a new project (hello, world) and set a breakpoint using 4.1.0SDK the breakpoint is never triggered, but the app doesn't crash. If I set the SDK back to 3.4.1 in this tiapp.xml file the breakpoint is triggered.
Attachments
File | Date | Size |
---|---|---|
Demo App_2015-08-13-084140_DW1415USBUM.crash | 2015-08-13T12:46:45.000+0000 | 70462 |
DiagnosticLog.txt | 2015-10-08T06:06:19.000+0000 | 824112 |
EndlessAisle_2015-08-11-122101_DW1415USBUM.crash | 2015-08-12T12:42:50.000+0000 | 314863 |
Screenshot 2015-08-13 08.29.11.png | 2015-08-13T12:42:51.000+0000 | 150928 |
Screenshot 2015-08-13 08.37.34.png | 2015-08-13T12:43:02.000+0000 | 167318 |
Screen Shot 2015-08-13 at 3.30.59 PM.png | 2015-08-13T11:18:21.000+0000 | 90824 |
Studio.log | 2015-10-08T06:12:18.000+0000 | 15070 |
I set the same exact breakpoint as shown in the attached screenshot and it never stopped there. If I click on the label in the app it does not stop in appcelerator at all. I see the alert and the log output of what is happening. Nothing happens when the exception happens as well. If I change to 3.4.1 SDK then I get the correct behavior. I have attached images of the debugger looks like and what our project settings are. How did you get a breakpoint set in the index.js that is not in the Resources/compiled version of index.js? We have never been able to do that and have always had to set breakpoints in Resources directory. This has been a pain. My project type is 'Alloy' and 'Mobile - Primary'
I also noticed if I try to set a breakpoint (in the /Demo App/Resources/iphone/alloy/controllers/index.js) while the app is running I get a crash of the app. From /var/log/system.log: Aug 13 08:41:40 DW1415USBUM com.apple.xpc.launchd[1] (com.apple.ReportCrash[28545]): Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.ReportCrash Aug 13 08:41:40 DW1415USBUM.local ReportCrash[28545]: Saved crash report for Demo App[27850] version 1.0 (1.0) to /Users/cthomas/Library/Logs/DiagnosticReports/Demo App_2015-08-13-084140_DW1415USBUM.crash I will attach this crash log as well.
Any thoughts on what the issue might be here? Why aren't others seeing this problem? Anything we can try so that we can debug our project with 4.1 SDK? This is a critical issue for our team.
There are some breakpoints that do work, it seems to fail whenever an event is involved. I was able to set a breakpoint in our Resources/iphone/alloy/controllers/index.js with no events involved.
Now that 4.3.0 has released you can no longer pick 3.4 SDK and therefore we can no longer debug.
I have reproduced this issue using two lines of code in a brand new clean project generated by appcelerator. Steps to reproduce: 1) Create a new mobile app project in appcelerator using the 5.0.2.GA SDK 2) Replace the index.js with this code: function doClick(e) { alert($.label.text); } var a = {b:1, c:2, d:{e:3}}; a.d.f = a; // <------ COMMENT THIS LINE OUT AND IT WON'T CRASH THE APP $.index.open(); 3) Run the app in the debugger. Put a breakpoint on the line "a.d.f = a;" 4) When you step over the line of code in step 3, the app will crash with the infinite loop below. Note that it is crashing in the TiDebuggerUtils::generate_variables(). The debugger cannot handle the case when there are circular references in data objects. This problem started in the 3.5.1.GA SDK. Not allowing circular references in javascript objects seems like a very basic requirement of a debugger. Thread 6 Crashed:: KrollContext
I see you have updated the steps to reproduce, however, what you are seeing where the breakpoint does not get triggered is a different issue. That may be yet another bug, but if you follow the steps I put in the comment above then you will see the infinite loop and crash.