App hanging and crash log.

Member
Posts: 749
Joined: 2003.01
Post: #1
Today my app hanged on me for the first time.

I force quit it and the crash log went like this

Code:
Date/Time:      2008-10-27 03:11:30 +0100
OS Version:     10.5.5 (Build 9F33)
Architecture:   i386
Report Version: 4

Command:        Rubber Ninjas
Path:           /Users/matteoguarnieri/Desktop/Rubber Ninjas in progress/67 85/build/Deployment/Rubber Ninjas.app/Contents/MacOS/Rubber Ninjas
Version:        2.0 (1.0)
Parent:         launchd [81]

PID:            1918
Event:          hang
Time:           9.91s
Steps:          72


Process:        Rubber Ninjas [1918]
Path:           /Users/matteoguarnieri/Desktop/Rubber Ninjas in progress/67 85/build/Deployment/Rubber Ninjas.app/Contents/MacOS/Rubber Ninjas

  ADDRESS         BINARY
  00001000        /Users/matteoguarnieri/Desktop/Rubber Ninjas in progress/67 85/build/Deployment/Rubber Ninjas.app/Contents/MacOS/Rubber Ninjas
  00078000        /Users/matteoguarnieri/Desktop/Rubber Ninjas in progress/67 85/build/Deployment/Rubber Ninjas.app/Contents/MacOS/../Frameworks/SDL.framework/Versions/A/SDL
  0c3bb000        /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLRendererFloat.bundle/GLRendererFloat
  0d6d3000        /System/Library/Frameworks/OpenGL.framework/Resources/GLEngine.bundle/GLEngine
  0d884000        /System/Library/Extensions/ATIRadeonX1000GLDriver.bundle/Contents/MacOS/ATIRadeonX1000GLDriver
  0ee06000        /System/Library/CoreServices/RawCamera.bundle/Contents/MacOS/RawCamera
  0f4e9000        /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn
  0f4f2000        /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn
  0f57c000        /Library/QuickTime/DivX Decoder.component/Contents/MacOS/DivX Decoder
  31000000        /Users/matteoguarnieri/Desktop/Rubber Ninjas in progress/67 85/build/Deployment/Rubber Ninjas.app/Contents/MacOS/../Frameworks/SDL_image.framework/Versions/A/SDL_image
  32000000        /Users/matteoguarnieri/Desktop/Rubber Ninjas in progress/67 85/build/Deployment/Rubber Ninjas.app/Contents/MacOS/../Frameworks/SDL_mixer.framework/Versions/A/SDL_mixer
  34000000        /Users/matteoguarnieri/Desktop/Rubber Ninjas in progress/67 85/build/Deployment/Rubber Ninjas.app/Contents/MacOS/../Frameworks/SDL_ttf.framework/Versions/A/SDL_ttf
  70000000        /System/Library/Components/CoreAudio.component/Contents/MacOS/CoreAudio

  Thread id:      da57208
  User stack:
    72 start + 41 (in Rubber Ninjas) [0x22f9]
      72 __start + 216 (in Rubber Ninjas) [0x23d2]
        72 _main + 240 (in Rubber Ninjas) [0x1a44b]
          72 _CustomApplicationMain + 365 (in Rubber Ninjas) [0x1a059]
            72 -[NSApplication run] + 795 (in AppKit) [0x920c4cdb]
              72 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128 (in AppKit) [0x920cbca0]
                72 __DPSNextEvent + 1189 (in AppKit) [0x920cc601]
                  72 _AEProcessAppleEvent + 38 (in HIToolbox) [0x90136b61]
                    72 _aeProcessAppleEvent + 177 (in AE) [0x92fee425]
                      72 __Z25dispatchEventAndSendReplyPK6AEDescPS_ + 44 (in AE) [0x92fee57e]
                        72 __Z20aeDispatchAppleEventPK6AEDescPS_mPh + 144 (in AE) [0x92fee648]
                          72 __NSAppleEventManagerGenericHandler + 223 (in Foundation) [0x90c9850f]
                            72 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 655 (in Foundation) [0x90c987ff]
                              72 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 98 (in AppKit) [0x920ced10]
                                72 -[NSApplication(NSAppleEventHandling) _handleAEOpen:] + 284 (in AppKit) [0x920cf517]
                                  72 -[NSApplication _sendFinishLaunchingNotification] + 77 (in AppKit) [0x92155971]
                                    72 -[NSApplication _postDidFinishNotification] + 125 (in AppKit) [0x92155a62]
                                      72 -[NSNotificationCenter postNotificationName:object:] + 56 (in Foundation) [0x90c79c88]
                                        72 -[NSNotificationCenter postNotificationName:object:userInfo:] + 128 (in Foundation) [0x90c70440]
                                          72 __CFXNotificationPostNotification + 179 (in CoreFoundation) [0x91499d93]
                                            72 ___CFXNotificationPost + 362 (in CoreFoundation) [0x91499aba]
                                              72 __nsnote_callback + 364 (in Foundation) [0x90c732dc]
                                                72 -[SDLMain applicationDidFinishLaunching:] + 64 (in Rubber Ninjas) [0x1a1e8]
                                                  72 _SDL_main + 60 (in Rubber Ninjas) [0x1a4ac]
                                                    72 __ZN4Game6dogameEv + 2338 (in Rubber Ninjas) [0x1b472]
                                                      72 __ZN5Level6DoLoopEv + 488 (in Rubber Ninjas) [0x14828]
                                                        72 __ZN5Level9DrawSceneEv + 68 (in Rubber Ninjas) [0x11ae4]
                                                          39 __Z10normAngle2f + 48 (in Rubber Ninjas) [0x3ee0]
                                                          23 __Z10normAngle2f + 55 (in Rubber Ninjas) [0x3ee7]
                                                          10 __Z10normAngle2f + 52 (in Rubber Ninjas) [0x3ee4]
  Kernel stack:
    71 _sysctl__net_inet_ip_dummynet_red_max_pkt_size + 56 [0x447f78]
      71 _panic_dialog_test + 2040 [0x1af933]
        71 _commpage_set_nanotime + 4288 [0x1a7fa8]
    1 _commpage_set_nanotime + 3972 [0x1a7e6c]
      1 _etimer_intr + 506 [0x12916c]
        1 _stack_alloc + 37 [0x136853]

And then other threads I dont know about.

I'm a total newb as for reading crash logs, I guess from the log that it probably got stuck at my function normAngle2 ?

my function normangle2 goes like this

Code:
float normAngle2(float angle) //returns an angle between -180 and 180
{
    while(angle<-180)
    {angle+=360;}
    while(angle>180)
    {angle-=360;}
    return angle;
}

which should work if i'm not missing something...

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Member
Posts: 320
Joined: 2003.06
Post: #2
if it hung, then that only tells you that you were in an infinite loop and that one of the things it was doing was in that function.

So your loop issue is probably above that function somewhere. Or possibly you are passing a really freekin huge float into that function and it's taking a long time to get to the -180 to 180 range?

Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
If you pass any suitably large negative or positive number (such that adding or subtracting 360 results in exactly the same float) or any NaN into that, it'll loop forever. Don't do those things Wink

Try using fmod() instead.
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #4
Oh right, it might have been a NaN problem...

And you're right, fmod does the same thing with constant time and no risks...

Thanks

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to check if data come in from the socket without hanging there!!! KingdomHeart 2 5,784 Nov 23, 2007 09:25 AM
Last Post: KittyMac