Project: titanium
Issue TIMOB-23410: iOS debugger: crash with use of {attribute} in view xml file
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. {code} 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]	{code} I have attached the crash log as well and here is the useful parts. {code} 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 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::__throw_out_of_range() const + 85 9 libc++.1.dylib	0x05c7a763 std::__1::basic_string, std::__1::allocator >::basic_string(std::__1::basic_string, std::__1::allocator > const&, unsigned long, unsigned long, std::__1::allocator 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, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator >&, int&) + 328 16 com.demandware.alloytestproject	0x003ae067 handleEval(TiDebuggerInterface*, std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > >) + 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, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > 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 {code}
Story points: 3