Crash Issues and Solution Help?....

Discussion in 'Public Game Developers Forum' started by bossman696, Oct 23, 2009.

  1. bossman696

    bossman696 Well-Known Member

    Sep 11, 2009
    76
    0
    0
    Graphic Designer, Commercial Printer
    Alabama
    This may not be the place for this, but I'm having an issue. I know I am in over my head as I am still learning to CODE. But my offshore developer has been very busy. To busy to work my bug issues into their schedule and my app is getting slammed with reviews all mentioning the same bug issue.

    Now, to elaborate, the bug does not crash the program, so there are no crash reports generated to send to my developer. It hangs up certain animations in the game and other animations keep playing in the background, but never causes the program to quit and exit.

    I am unable to reproduce this bug at all, but I will keep playing the game to see if it pops up at all after this posting. The developer says he has been unable to reproduce the crash as well.

    My question is, are there any little tricks I can tell me developer about to try and narrow down this issue to speed up the debugging process? What about tools from APPLE I could try and run the code through to search for trouble spots.

    I did notice while building the app, it would produce a lot of warning errors..

    Can anyone tell me if these might be a issue? The developer would have gotten the same warnings I would think as the built the program for testing etc... The screen shot below lists 57 errors which is down from 256 in the original builds of the APP.

    [​IMG]
     
  2. PixelthisMike

    PixelthisMike Well-Known Member

    Some of those errors are a little hard to read but it appears that most of them come from not tidying up the code but they are unlikely to be issues. For example "control reaches end of non-void function" means the function doesn't return anything even though the function header says it will return something. Of course if you then try and use the object that isn't being returned in another part of your code you would likely get run-time errors which could be part of your problem.

    But even if you fix all of those warnings you aren't going to know if you've fixed it since you are unable to replicate the bugs...
     
  3. ChaoticBox

    ChaoticBox Well-Known Member

    Oct 8, 2008
    878
    6
    18
    Male
    Developer
    Toronto Canada
    #3 ChaoticBox, Oct 23, 2009
    Last edited: Oct 23, 2009
    First, I agree with Mike - fix those warnings. If you're on Snow Leopard you might also want to build against the 3.x SDK and run the static analyzer - it can catch logic bugs that the compiler can't.

    If animations are hanging it's either a bug in the animating logic, or your timing code. For example, you should check for and skip frames with negative deltas (or really big deltas). This can happen if you're using CFAbsoluteTimeGetCurrent.
     
  4. I wouldn't much trust code from a developer that allows over 50 warnings to remain in a shipping product, let alone allowing over 250 in a development build. When I develop I NEVER allow even a single warning to stay like that.

    I always, always, always fix it immediately and rebuild until there are zero warnings and zero errors.

    In your case you've got a couple of ones that could be issues:

    • "Xxx may not respond to -yyy" can cause an exception

    • "Control reaches end of non-void function" can cause a totally invalid return value. Basically the value is whatever garbage happened to be on the stack at the time. The result on the code will depend on the type of the return value. If it is a BOOL or int return value you might notice actions being taken when they shouldn't or vice versa. If it is a pointer to an object, then it will most likely crash immediately when that pointer is next used.
    Focus on dealing with those first. This is the low hanging fruit of the debugging process.
     
  5. dawvee

    dawvee Well-Known Member

    Aug 14, 2009
    46
    0
    0
    iPhone Developer, DaVoid Digital
    Dublin, Ireland
    Best practice is to treat compiler warnings as errors and minimize them as much as possible. I agree with the previous comments, and I wouldn't want to see any warnings in a release build, let alone 50-200 of them. Fixing them might not fix the particular issue you're having, but it will rule it out as a possibility at least.
     
  6. bossman696

    bossman696 Well-Known Member

    Sep 11, 2009
    76
    0
    0
    Graphic Designer, Commercial Printer
    Alabama
    Thanks so much for the ADVICE....

    I will post a zoomed pic of some of the warning so that you guys can get a better look. If you haven't already picked up Flight Deck... would you be interested a few promo code for your help?

    Thanks again!
     
  7. bossman696

    bossman696 Well-Known Member

    Sep 11, 2009
    76
    0
    0
    Graphic Designer, Commercial Printer
    Alabama
    Better Warnings Pic....

    Hopefully this will give you a better view....

    [​IMG]
     
  8. mobile1up

    mobile1up Well-Known Member

    Nov 6, 2008
    754
    0
    16
    Technical Director
    Munich, Germany
    a few warnings you should definitely address:

    - warning: taking address of temporary
    - warning: reference to local variable 'xxxx' returned

    are definite bad programming style and since local variables are on the stack you could be trying to read values from memory that isn't no longer available (= crash). the following warnings would be nice to fix, because they can throw exceptions:

    - XXXXX may not respond to -xxxxx

    these can probably be fixed with better class definitions - declaring the function specification so that the compiler knows it exists.

    the other warnings:

    - control reaches end of non-void function
    - unused variable 'xxx'
    - deletiing 'void *' is undefined

    will not crash your application; but should be cleaned up. the first will not return any value; so, whatever is in the register that controls the return value will be used - this could give "weird" results, and can cause a crash if used to determine an array index or something of that type. the others are just simple warnings.

    you sould aim to never have any warnings - unless you are 100% sure they will be ok. i know sometimes there are hidden API's in the apple controls that you get a warning from but they work anyhow.. be sure to test that this code works as expected is a good rule as well.
     
  9. Also, sometimes these are just because the programmer forgot to include the header file for the object in question. If the object actually does handle that message, then nothing bad will happen.

    Other times you have type the method name wrong or given bad parameters. In those cases you'll get an exception.

    As another poster said, fix all of these warnings first so you can rule them out as causes of your problem.
     
  10. bossman696

    bossman696 Well-Known Member

    Sep 11, 2009
    76
    0
    0
    Graphic Designer, Commercial Printer
    Alabama
    Thanks again for all the help! I really do appreciate it. Hopefully we can get ahead of this problem quickly!
     

Share This Page