Titanium JIRA Archive
Appcelerator Community (AC)

[AC-297] iOS: Debug crash when setting breakpoint in Resources controller file with 4.1SDK

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionDuplicate
Resolution Date2015-11-05T09:47:22.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsStudio
Labelsios
ReporterChristy Thomas
AssigneeShak Hossain
Created2015-08-12T12:52:39.000+0000
Updated2015-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

FileDateSize
Demo App_2015-08-13-084140_DW1415USBUM.crash2015-08-13T12:46:45.000+000070462
DiagnosticLog.txt2015-10-08T06:06:19.000+0000824112
EndlessAisle_2015-08-11-122101_DW1415USBUM.crash2015-08-12T12:42:50.000+0000314863
Screenshot 2015-08-13 08.29.11.png2015-08-13T12:42:51.000+0000150928
Screenshot 2015-08-13 08.37.34.png2015-08-13T12:43:02.000+0000167318
Screen Shot 2015-08-13 at 3.30.59 PM.png2015-08-13T11:18:21.000+000090824
Studio.log2015-10-08T06:12:18.000+000015070

Comments

  1. Christy Thomas 2015-08-13

    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'
  2. Christy Thomas 2015-08-13

    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.
  3. Christy Thomas 2015-08-18

    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.
  4. Christy Thomas 2015-08-19

    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.
  5. Christy Thomas 2015-09-30

    Now that 4.3.0 has released you can no longer pick 3.4 SDK and therefore we can no longer debug.
  6. Manny Parasirakis 2015-10-06

    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 0 com.demandware.EndlessAisle 0x006376f7 WTI::CString::CString(char const*, unsigned long) + 39 1 com.demandware.EndlessAisle 0x0064e7d9 WTI::StringImpl::utf8ForRange(unsigned int, unsigned int, WTI::ConversionMode) const + 297 2 com.demandware.EndlessAisle 0x0064e8bf WTI::StringImpl::utf8(WTI::ConversionMode) const + 47 3 com.demandware.EndlessAisle 0x00652c6b WTI::String::utf8(WTI::ConversionMode) const + 43 4 com.demandware.EndlessAisle 0x0035aaf5 TiDebuggerUtils::wtf_string_to_string(WTI::String const&) + 37 5 com.demandware.EndlessAisle 0x0035bc66 TiDebuggerUtils::generate_variables(TI::ExecState*, TI::JSObject*, std::__1::map, std::__1::allocator >, TiDebuggerVariableStruct, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > const, TiDebuggerVariableStruct> > >&, bool, std::__1::basic_string, std::__1::allocator > const&) + 278 6 com.demandware.EndlessAisle 0x0035ba92 TiDebuggerUtils::generate_variable(TI::ExecState*, TI::TiValue&, TiDebuggerVariableStruct&, std::__1::basic_string, std::__1::allocator > const&, bool, std::__1::basic_string, std::__1::allocator > const&) + 1922 7 com.demandware.EndlessAisle 0x0035be43 TiDebuggerUtils::generate_variables(TI::ExecState*, TI::JSObject*, std::__1::map, std::__1::allocator >, TiDebuggerVariableStruct, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > const, TiDebuggerVariableStruct> > >&, bool, std::__1::basic_string, std::__1::allocator > const&) + 755 8 com.demandware.EndlessAisle 0x0035ba92 TiDebuggerUtils::generate_variable(TI::ExecState*, TI::TiValue&, TiDebuggerVariableStruct&, std::__1::basic_string, std::__1::allocator > const&, bool, std::__1::basic_string, std::__1::allocator > const&) + 1922 9 com.demandware.EndlessAisle 0x0035be43 TiDebuggerUtils::generate_variables(TI::ExecState*, TI::JSObject*, std::__1::map, std::__1::allocator >, TiDebuggerVariableStruct, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > const, TiDebuggerVariableStruct> > >&, bool, std::__1::basic_string, std::__1::allocator > const&) + 755 10 com.demandware.EndlessAisle 0x0035ba92 TiDebuggerUtils::generate_variable(TI::ExecState*, TI::TiValue&, TiDebuggerVariableStruct&, std::__1::basic_string, std::__1::allocator > const&, bool, std::__1::basic_string, std::__1::allocator > const&) + 1922 11 com.demandware.EndlessAisle 0x0035be43 TiDebuggerUtils::generate_variables(TI::ExecState*, TI::JSObject*, std::__1::map, std::__1::allocator >, TiDebuggerVariableStruct, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > const, TiDebuggerVariableStruct> > >&, bool, std::__1::basic_string, std::__1::allocator > const&) + 755 12 com.demandware.EndlessAisle 0x0035ba92 TiDebuggerUtils::generate_variable(TI::ExecState*, TI::TiValue&, TiDebuggerVariableStruct&, std::__1::basic_string, std::__1::allocator > const&, bool, std::__1::basic_string, std::__1::allocator > const&) + 1922 13 com.demandware.EndlessAisle 0x0035be43 TiDebuggerUtils::generate_variables(TI::ExecState*, TI::JSObject*, std::__1::map, std::__1::allocator >, TiDebuggerVariableStruct, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > const, TiDebuggerVariableStruct> > >&, bool, std::__1::basic_string, std::__1::allocator > const&) + 755 14 com.demandware.EndlessAisle 0x0035ba92 TiDebuggerUtils::generate_variable(TI::ExecState*, TI::TiValue&, TiDebuggerVariableStruct&, std::__1::basic_string, std::__1::allocator > const&, bool, std::__1::basic_string, std::__1::allocator > const&) + 1922 15 com.demandware.EndlessAisle 0x0035be43 TiDebuggerUtils::generate_variables(TI::ExecState*, TI::JSObject*, std::__1::map, std::__1::allocator >, TiDebuggerVariableStruct, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > const, TiDebuggerVariableStruct> > >&, bool, std::__1::basic_string, std::__1::allocator > const&) + 755 16 com.demandware.EndlessAisle 0x0035ba92 TiDebuggerUtils::generate_variable(TI::ExecState*, TI::TiValue&, TiDebuggerVariableStruct&, std::__1::basic_string, std::__1::allocator > const&, bool, std::__1::basic_string, std::__1::allocator > const&) + 1922 17 com.demandware.EndlessAisle 0x0035be43 TiDebuggerUtils::generate_variables(TI::ExecState*, TI::JSObject*, std::__1::map, std::__1::allocator >, TiDebuggerVariableStruct, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > const, TiDebuggerVariableStruct> > >&, bool, std::__1::basic_string, std::__1::allocator > const&) + 755 18 com.demandware.EndlessAisle 0x0035ba92 TiDebuggerUtils::generate_variable(TI::ExecState*, TI::TiValue&, TiDebuggerVariableStruct&, std::__1::basic_string, std::__1::allocator > const&, bool, std::__1::basic_string, std::__1::allocator > const&) + 1922 19 com.demandware.EndlessAisle 0x0035be43 TiDebuggerUtils::generate_variables(TI::ExecState*, TI::JSObject*, std::__1::map, std::__1::allocator >, TiDebuggerVariableStruct, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > const, TiDebuggerVariableStruct> > >&, bool, std::__1::basic_string, std::__1::allocator > const&) + 755
  7. Manny Parasirakis 2015-10-08

    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.

JSON Source