Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23410] iOS debugger: crash with use of {attribute} in view xml file

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-05-31T21:18:13.000+0000
Affected Version/sRelease 5.2.2
Fix Version/sRelease 5.4.0
ComponentsiOS
Labelsdefect, qe-5.4.0
ReporterChristy Thomas
AssigneeAngel Petkov
Created2016-05-12T13:08:50.000+0000
Updated2016-07-28T21:00:08.000+0000

Description

I have attached a sample project that demonstrates this problem. When you run the app in Run mode the app works fine. When you run the app in Debug mode the app will crash at startup. The crash is a result of this line of code in underscore.js: render = new Function(settings.variable || 'obj', '_', source); Here is the stack trace for the breakpoint I set and stepping over or into the line will crash the app.
Thread [kroll$1] (Suspended (breakpoint at line 1261 in /AlloyTestProject/Resources/iphone/alloy/underscore.js))	
	template(text, data, settings) [underscore.js:1261]	
	__alloyId5(e) [index.js:24]	
	trigger(events) [backbone.js:163]	
	_onModelEvent(event, model, collection, options) [backbone.js:844]	
	trigger(events) [backbone.js:170]	
	add(models, options) [backbone.js:631]	
	Controller() [index.js:70]	
	createController(name, args) [alloy.js:232]	
	[Top-level script] [app.js:3]	
I have attached the crash log as well and here is the useful parts.
Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
terminating with uncaught exception of type std::out_of_range: basic_string
abort() called
CoreSimulator 209.19 - Device: iPad Retina - Runtime: iOS 9.3 (13E230) - DeviceType: iPad Retina

Thread 6 Crashed:: KrollContext<kroll$1>
0   libsystem_kernel.dylib        	0x074f4572 __pthread_kill + 10
1   libsystem_pthread.dylib       	0x074bc654 pthread_kill + 101
2   libsystem_c.dylib             	0x0725c65d abort + 156
3   libc++abi.dylib               	0x0692cae7 abort_message + 151
4   libc++abi.dylib               	0x0694d667 default_terminate_handler() + 272
5   libobjc.A.dylib               	0x058610c9 _objc_terminate() + 127
6   libc++abi.dylib               	0x0694ad0d std::__terminate(void (*)()) + 14
7   libc++abi.dylib               	0x0694a72b __cxa_throw + 122
8   libc++.1.dylib                	0x05c7a29d std::__1::__basic_string_common<true>::__throw_out_of_range() const + 85
9   libc++.1.dylib                	0x05c7a763 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, unsigned long, std::__1::allocator<char> const&) + 91
10  com.demandware.alloytestproject	0x003b410c TiDebuggerInterface::sourceParsed(TI::ExecState*, TI::SourceProvider*, int, WTI::String const&) + 524
11  com.demandware.alloytestproject	0x004b9f23 TI::JSGlobalObject::createEvalCodeBlock(TI::ExecState*, TI::EvalExecutable*) + 323
12  com.demandware.alloytestproject	0x0041d905 TI::EvalExecutable::create(TI::ExecState*, TI::SourceCode const&, bool) + 293
13  com.demandware.alloytestproject	0x004178a0 TI::DebuggerCallFrame::evaluateWithCallFrame(TI::ExecState*, WTI::String const&, TI::TiValue&) + 256
14  com.demandware.alloytestproject	0x00417792 TI::DebuggerCallFrame::evaluate(WTI::String const&, TI::TiValue&) const + 34
15  com.demandware.alloytestproject	0x003b5598 TiDebuggerInterface::evalExpression(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, int&) + 328
16  com.demandware.alloytestproject	0x003ae067 handleEval(TiDebuggerInterface*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >) + 391
17  com.demandware.alloytestproject	0x003b0449 TiDebuggerFunctionInvocation::invoke() + 57
18  com.demandware.alloytestproject	0x003aeed4 TiDebuggerDelegate::suspend() + 132
19  com.demandware.alloytestproject	0x003b3790 TiDebuggerController::suspend() + 256
20  com.demandware.alloytestproject	0x003af9e8 TiDebuggerDelegate::suspended(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 840
21  com.demandware.alloytestproject	0x003b85ba TiDebuggerInterface::handlePause(TI::Debugger::ReasonForPause, TI::JSGlobalObject*) + 2490
22  com.demandware.alloytestproject	0x00414f89 TI::Debugger::pauseIfNeeded(TI::ExecState*) + 265
23  com.demandware.alloytestproject	0x00415231 TI::Debugger::atStatement(TI::ExecState*) + 65
24  com.demandware.alloytestproject	0x00432b0c TI::Interpreter::debug(TI::ExecState*, TI::DebugHookID) + 140
25  com.demandware.alloytestproject	0x0054fdf2 llint_slow_path_debug + 66
26  com.demandware.alloytestproject	0x00555485 llint_op_debug + 40

Attachments

FileDateSize
AlloyTestProject_2016-05-12-085416_DW1415USBUM.crash2016-05-12T13:01:41.000+000090416
AlloyTestProject 2.zip2016-05-12T13:01:12.000+00008197947
wilson.crash2016-05-18T22:08:00.000+000056815

Comments

  1. Ajith Rohini 2016-05-16

    Spoke to support (Motiur) and this is an ongoing issue with us with the new release. On the Weekly support call our dev team, they are going to look into it and will reach out to support for additional details
  2. Wilson Luu 2016-05-18

    I was able to reproduce this issue with current GA stack: Appcelerator Studio, build: 4.5.0.201602170821 Appc CLI NPM: 4.2.4 Appc CLI Core: 5.2.2 Arrow: 1.7.29 SDK: 5.2.2.GA Node: v4.4.0 OS: El Capitan (10.11.4) Xcode: 7.3.1 Device: iphone 6s (9.3.1) Notes: * You do not need to set a breakpoint to reproduce this issue. If you debug the attached app without any breakpoints, the app will crash on launch. * In the attached app, if you comment out <Label text="Value is {bookTitle} ranked {ranking}"/> in index.xml and debug the app again, the app will launch without any issues. * On crash, I also get the EXC_CRASH (SIGABRT); see [^wilson.crash]
  3. Angel Petkov 2016-05-25

    Hello, this bug is no longer present in iOS 5.4.X with main-thread enabled. This actually relates to another ticket created by your self, the fix also works for this issue as its the same crash regarding bad string extraction. Thank you! Enable Main-Thread in 5.4.X:
       <property name="run-on-main-thread" type="bool">true</property>
       
  4. Wilson Luu 2016-05-31

    [~apetkov], Yep, can't reproduce this issue anymore on SDK 5.4.0.v20160531130657.
  5. Angel Petkov 2016-05-31

    [~wluu] Great, thank you. Resolving the issue as fixed in 5.4.0!
  6. Josh Longton 2016-07-28

    I am now able to run applications on {{
Ti SDK: 5.4.0.v20160727143921}} without crashing using debug. Tested on:
       iPhone 6s (9.3.1)
       iOS Simulator (9.3)
       
Mac OSX El Capitan 10.11.6
       Studio: 4.7.0.201607130543
       
Ti SDK: 5.4.0.v20160727143921
       
Appc NPM: 4.2.7
       Appc CLI: 5.4.0-36
       Node: v4.4.4
       
    *Closing issue.*

JSON Source