Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-692] camera crash

GitHub Issuen/a
Resolution Date2011-04-17T01:53:56.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.2.0
ReporterNolan Wright
AssigneeBlain Hamon


Phone => Camera => Camera Basic

crashes on device


  1. Stephen Tramer 2011-04-15

    Very difficult to reproduce this crash. But the relevant stack trace is:

       0   CoreFoundation                      0x32de1d1d __exceptionPreprocess + 52
       1   libobjc.A.dylib                     0x3266be14 objc_exception_throw + 40
       2   CoreFoundation                      0x32de2bfd -[NSObject doesNotRecognizeSelector:] + 112
       3   CoreFoundation                      0x32d67b19 ___forwarding___ + 480
       4   CoreFoundation                      0x32d5e840 _CF_forwarding_prep_0 + 48
       5   Titanium                            0x0008fd55 -[TitaniumViewController loadView] + 376
       6   UIKit                               0x30c59758 -[UIViewController view] + 52
       7   UIKit                               0x30ce094c -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 1268
       8   UIKit                               0x30cd7788 -[UIViewController dismissModalViewControllerWithTransition:] + 452
       9   UIKit                               0x30cd75bc -[UIViewController dismissModalViewControllerAnimated:] + 36
       10  Titanium                            0x000923dd -[TitaniumApp hideModalController:animated:] + 116
       11  Titanium                            0x000c3091 -[MediaModule imagePickerController:didFinishPickingMediaWithInfo:] + 128
  2. Stephen Tramer 2011-04-15

    Isolated the crash in -[TitaniumViewController loadView]. Occurs in this loop:

        for (TiWindowProxy * thisWindowProxy in windowViewControllers)
               TiUIView * thisView = [thisWindowProxy view];
               [rootView addSubview:thisView];
               [thisWindowProxy reposition]; <---- BUG IS HERE

    Apparently, sometimes a TiWindowProxy is not really a TiWindowProxy. There's probably an initialization race condition somewhere: This bug only seems to appear if you IMMEDIATELY tap 'use' after the picture is processed.

    In this case, the thisWindowProxy is really a TiWindowViewController (the one for the tab group).

  3. Blain Hamon 2011-04-15


    windowViewControllers used to be an array of proxies, but I changed them into viewControllers. The fact that the [thisWindowProxy view] doesn't crash is due to viewControllers and proxies both having a method called that.

    With viewControllers wrapping proxies, that 'view' is a TiUIView. With viewControllers that aren't, like, say, the Camera, they're standard UIViews, which would not have a reposition method.

  4. Stephen Tramer 2011-04-15

    Re: Blain's comment -

    Turns out that this was fixed by Jeff as another bug (not sure which one). I'm marking it resolved - but if anyone can still reproduce it in the 1.2.0 freeze, here are instructions:

    Phone -> Camera -> Camera Basic
    Take a picture
    As soon as the 'use' button comes up, tap it IMMEDIATELY. The bug may show up if you tap it at other times, but this seemed to be the most reliable way to reproduce.

    Of course, re-open the bug if it can be reproduced and I will fix.

JSON Source