Nasty bug in App Store version

Discussion in 'Public Game Developers Forum' started by micah, Nov 23, 2009.

  1. mobileben

    mobileben Well-Known Member

    Jul 17, 2009
    595
    0
    0
    Lumpy's Handler
    Zgrunturos and San Francisco
    Wow, that is strange. If it was me, I'd do a bit more research on it. I'd seriously try and see if a Release version has the same problem or if you can manage to get the Xcode working with the adhoc. The only reason I say this is what if this is just a symptom of another problem?

    So what happens if that function never gets called? will the app then "freeze" on the current screen? Or, maybe that routine is being called multiple times without you knowing. And on one of those instances, that is where manager is ill-defined.

    I'm not sure what is going on there, but it may pay to be safer...
     
  2. I never tried this, but perhaps if you toggle the "get-task-allow" value in your Entitlements.plist file it might let you run the Ad Hoc version. If this is false, as you normally want it to be, then the iPhone won't let a debugger connect to the task.
     
  3. I agree...I'd do some more investigation first. Mobileben, your suggestion that the function may be getting called more than once (and with a bad manager pointer) sounds good to me. The "if" would prevent that next line from running in the "bad" case.

    Maybe print out some traces of those values like manager before the if().

    It could also be timing specific. Perhaps you have an object that is not retained properly?
     
  4. micah

    micah Well-Known Member

    Aug 24, 2009
    362
    0
    0
    game developer
    San Francisco
    Well, I have managed to build with the ad-hoc configuration and the release configuration and test them both, and the crash isn't happening any more. And it is an interesting thought that possibly the function is getting called twice, but that can't be happening because I actually already put safeguards in to prevent that (the restartLevel function, which is the function that switches to the GSGameOver view, returns from the function if it was just called, to prevent accidentally restarting the level twice in a row).

    So I decided to go ahead and cross my fingers and submit the update. This bug has already been in the App Store for a couple weeks. And since this latest update included OpenFeint, the OF leaderboards are still blank because apparently no one has been able to die without crashing, so their scores haven't been getting submitted...
     
  5. mobileben

    mobileben Well-Known Member

    Jul 17, 2009
    595
    0
    0
    Lumpy's Handler
    Zgrunturos and San Francisco
    So did you get to see, if the code was not modified to

    (SkeletonKeyAppDelegate*)manager respondsToSelector:mad:selector(doStateChange:)]) {
    [(SkeletonKeyAppDelegate*)manager doStateChange:[GSGameOver class]];
    }

    that the release and the adhoc on Xcode crashed?

    If this is the case, modify your code to this:

    first declare a global function ... me be a C++ guy would do it this way

    void foo(void)
    {
    }

    If you are in release, you may need to do something "meaningful", so it won't get removed by the compiler.

    Then do:

    (SkeletonKeyAppDelegate*)manager respondsToSelector:mad:selector(doStateChange:)]) {
    [(SkeletonKeyAppDelegate*)manager doStateChange:[GSGameOver class]];
    }
    else
    foo();


    Set a breakpoint in foo or on that line calling foo. This will break your program and you can see when that problem occurs. Note, this will only work if you've proven the release or adhoc running on Xcode crashes without that fix.

    Another question. When, relative to you doing this, do you call your OpenFeint stuff (eg. submit to leaderboard)? Have you done that at this point or not?
     

Share This Page