Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5180] iOS: Ti.API.info crashes if passed a window when debugging

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2011-10-03T18:57:13.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sSprint 2011-40
ComponentsiOS
Labelsn/a
ReporterJon Alter
AssigneeBlain Hamon
Created2011-08-31T10:51:42.000+0000
Updated2014-06-19T12:46:29.000+0000

Description

If you pass Ti.API.info() a window in when debugging, the app will crash. If you just run the app in the simulator without debugging it works as expected and does not crash. Step 1: run the code below in *debug* mode Step 2: notice the app crash
var win = Ti.UI.createWindow({
  backgroundColor:"#fff",
  title:"My App"
});
win.open();

Ti.API.info(win);
// Ti.API.info("win: "+win);
[ERROR] The application has crashed with an unhandled exception. Stack trace:

0   CoreFoundation                      0x025c758c __exceptionPreprocess + 156
1   libobjc.A.dylib                     0x0271b313 objc_exception_throw + 44
2   CoreFoundation                      0x025c90bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3   CoreFoundation                      0x02538966 ___forwarding___ + 966
4   CoreFoundation                      0x02538522 _CF_forwarding_prep_0 + 50
5   Test2                               0x00405227 -[TiDebugger log:level:] + 134
6   Test2                               0x00406cac TiDebuggerLogMessage + 69
7   Test2                               0x001433c6 -[APIModule logMessage:severity:] + 486
8   Test2                               0x001435b3 -[APIModule info:] + 147
9   CoreFoundation                      0x02537c7d __invoking___ + 29
10  CoreFoundation                      0x02537b51 -[NSInvocation invoke] + 145
11  Test2                               0x0004dcf9 -[KrollMethod call:] + 3081
12  Test2                               0x0004c79e KrollCallAsFunction + 542
13  Test2                               0x002d92b9 _ZN2TI16TiCallbackObjectINS_8TiObjectEE4callEPNS_10TiExcStateEPS1_NS_7TiValueERKNS_7ArgListE + 391
14  Test2                               0x002b657b cti_op_call_NotTiFunction + 299
15  ???                                 0x08fc0875 0x0 + 150734965
16  Test2                               0x00273502 _ZN2TI11Interpreter7executeEPNS_17ProgramExecutableEPNS_10TiExcStateEPNS_14ScopeChainNodeEPNS_8TiObjectEPNS_7TiValueE + 648
17  Test2                               0x00242f34 _ZN2TI8evaluateEPNS_10TiExcStateERNS_10ScopeChainERKNS_10SourceCodeENS_7TiValueE + 388
18  Test2                               0x002bd109 TiEvalScript + 297
19  Test2                               0x00042112 -[KrollBridge evalFileOnThread:context:] + 2082
20  Test2                               0x000496e7 -[KrollInvocation invoke:] + 135
21  Test2                               0x000475de -[KrollContext invokeOnThread:method:withObject:callback:selector:] + 286
22  Test2                               0x000418de -[KrollBridge evalFile:callback:selector:] + 126
23  Test2                               0x00041223 -[KrollBridge didStartNewContext:] + 2579
24  Test2                               0x0004626e -[KrollContext main] + 3214
25  Foundation                          0x008b6cf4 -[NSThread main] + 81
26  Foundation                          0x008b6c80 __NSThread__main__ + 1387
27  libSystem.B.dylib                   0x92170259 _pthread_start + 345
28  libSystem.B.dylib                   0x921700de thread_start + 34

Workaround

concatenate the window with a string. Ti.API.info("win: "+win);

Associated Helpdesk Ticket

httP://appc.me/c/APP-794556

Comments

  1. Reggie Seagraves 2011-09-14

    We are unable to recreate this problem if the project is created from 1.8 master.
  2. Jon Alter 2011-09-14

    This issue is resolved if the app is created in 1.8.0.v20110908112549 It only happens if the project was originally created with 1.7.2. Confirmed resolved by creating a new project with 1.8.0.v20110908112549 This will not affect customers that create an app with 1.8.0. This will affect customers that create an app with 1.7.2 (the current live sdk) even if they update to 1.8.0 (where the fix exists)

    Updated steps to reproduce

    Step 1: create a project using 1.7.2 Step 2: change the sdk to 1.8.x Step 3: In studio run the above example with debugging
  3. Jon Alter 2011-10-03

    Tested with 1.8.0.v20110928105812 Can no longer reproduce this issue.
  4. Michael Pettiford 2012-03-30

    Closing issue Tested with Ti Studio build 2.0.0.201203291340 Ti Mobile SDK 2.0.0.v20120329191102 hash r1fbf18c4 OSX Lion 10.7.3 iPhone 4S OS 5.0.1 Cannot reproduce issue

JSON Source