gdb: "exited with status value:101"

Discussion in 'iOS Programming' started by steve1717, Jun 16, 2008.

  1. steve1717 macrumors newbie

    Jul 18, 2007
    Attempting to debug an iPhone app and I keep having the program shut down randomly with an error message of:

    Program exited with status value:101.

    Does anyone know what exactly that means or where it is possible to lookup gdb exit codes?

  2. MrStevieP macrumors newbie

    Feb 27, 2008
    You could always download the GDB source code for your version of GDB and look it up from there. A google for GDB source revealed this site which may help?!
  3. steve1717 thread starter macrumors newbie

    Jul 18, 2007
    It seems weird that I'd have to do that. For as prevalent as gdb is, I'm amazed that these exit codes aren't posted somewhere online in a table. Has anyone else received exit code 101? This is causing an app to crash on the device but does not occur on the simulator. Many thanks...
  4. yeroen macrumors 6502a


    Mar 8, 2007
    Cambridge, MA
    Are you saying gdb itself exited with an exit status of 101 taking your app with it or your app exited with a 101 and gdb caught the termination status.

    Reading your post, it sounds as if we need to look into the latter scenario and not into gdb itself.
  5. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    I think that the program is exiting with 101, not gdb. As such, exit() is being called with 101 as its argument.

    I don't know if you'll be able to set a breakpoint on exit and get a backtrace or not in this situation, but this is likely something going wrong in some cocoa functions since I'm guessing you didn't write code that called exit(101).

  6. steve1717 thread starter macrumors newbie

    Jul 18, 2007
    Hi guys -- yes, the program itself is exiting with 101 and at random times too. Its unpredictable. The error doesn't occur on the simulator, just the device. :confused:
  7. yeroen macrumors 6502a


    Mar 8, 2007
    Cambridge, MA
    You could try registering an exit handler function in main() via atexit(3) or on_exit(3) and breaking in there and viewing the stack trace.

    As lee pointed out above, this error code is probably not being thrown by any code you wrote, else you'd recognize it. Most likely, the choke is due to some library or framework you're linked into. If you have no idea where, one way to find out is to run your program under some tracing utility (on linux I use ltrace/strace for this all the time). On Darwin/OSX there's dtrace and dtruss at the command line, and the Instruments GUI in the /Developer/Tools tree.
  8. ajv macrumors newbie

    Feb 22, 2008
    I was having the same issue, but it seemed to go away when I rebooted the phone.
  9. cg16 macrumors newbie

    Jul 16, 2008

    I too had the same issue: "Program exited with status value:101."
    I followed avj's advice and rebooted my phone.

    no more error.

    Thanks ajv.
  10. hnager macrumors newbie

    Sep 9, 2008
    This same bug is haunting me. I've tried restarting the phone but I see that 101 error haphazardly when testing on the device. I couldn't find any documentation on this error - any thoughts on what it means?

Share This Page