Hang detection

  • My app hangs due to what appears to be two competing operations.  Appears because other possible reasons may exist.

    How do I snapshot, debug or otherwise detect and obtain a stack trace of the code causing the hang?

    Best regards,

    John MacMullin
  • The way I would do it, even though it may be old fashioned, would be to define an int (or NSNumber) in each of the operations that could be involved in the hang (race condition) that is assigned a value other than 0 that  uniquely represents the operation when it begins and set back to 0 when it ends. Then, in the code that is guaranteed to be executed when the hang occurs, check the values of the flag values to see which are executing at that point. Indication of 2 or more being in execution simultaneously identifies the culprits.
    On Jul 29, 2012, at 4:56 PM, John MacMullin wrote:

    > My app hangs due to what appears to be two competing operations.  Appears because other possible reasons may exist.
    >
    > How do I snapshot, debug or otherwise detect and obtain a stack trace of the code causing the hang?
    >
    > Best regards,
    >
    > John MacMullin

    Charlie Dickman
    <3tothe4th...>
  • Sample the process; see "man sample".

    On Jul 29, 2012, at 2:56 PM, John MacMullin wrote:

    > How do I snapshot, debug or otherwise detect and obtain a stack trace of the code causing the hang?

    --
    Scott Ribe
    <scott_ribe...>
    http://www.elevated-dev.com/
    (303) 722-0567 voice
  • On Jul 29, 2012, at 4:49 PM, Scott Ribe wrote:

    > Sample the process; see "man sample".
    >
    > On Jul 29, 2012, at 2:56 PM, John MacMullin wrote:
    >
    >> How do I snapshot, debug or otherwise detect and obtain a stack trace of the code causing the hang?

    I was assuming of course, that you can't just run it under Xcode and break when it locks up, or attach Xcode's debugger to it when it locks...

    --
    Scott Ribe
    <scott_ribe...>
    http://www.elevated-dev.com/
    (303) 722-0567 voice
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today