我有一個反覆出現的間歇性EXC_BAD_ACCESS
崩潰記錄here。如何判斷崩潰是我的錯還是第三方的錯誤?
這個問題:我可以採取哪些步驟來確保這不是框架/ lib錯誤,而且實際上是我的代碼出錯? (除了顯而易見的,是的,嗯,這是我的代碼。)
我正在努力與儀器和獲取堆棧跟蹤;我應該使用哪些資源來了解這方面的編程?
編輯:我覺得這是一個堆棧跟蹤:
#0 0x0000cad8 in std::string ofToString<float>(float const&) at /Developer/of_007_iphone/libs/openFrameworks/utils/ofUtils.h:79
#1 0x000064ac in testApp::draw()()
#2 0x0036d78c in ofAppiPhoneWindow::timerLoop()()
#3 0x0037e698 in -[ofxiPhoneAppDelegate timerLoop]()
#4 0x3095cbde in __NSFireTimer()
#5 0x3579eca0 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__()
#6 0x3579e6ac in __CFRunLoopDoTimer()
#7 0x3576e300 in __CFRunLoopRun()
#8 0x3576dd7a in CFRunLoopRunSpecific()
#9 0x3576dc88 in CFRunLoopRunInMode()
#10 0x336ace8c in GSEventRunModal()
#11 0x318f0f94 in -[UIApplication _run]()
#12 0x318ee4d4 in UIApplicationMain()
#13 0x0036e9c4 in ofAppiPhoneWindow::runAppViaInfiniteLoop(ofBaseApp*)()
#14 0x003a6804 in ofRunApp(ofBaseApp*)()
#15 0x00002b34 in main()
好了,另一個。甚至不知道這是一個單獨的錯誤:
#0 0x00019244 in std::vector<std::complex<float>, std::allocator<std::complex<float> > >::capacity() const at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/c++/4.2.1/bits/stl_vector.h:434
#1 0x00026608 in std::vector<std::complex<float>, std::allocator<std::complex<float> > >::operator=(std::vector<std::complex<float>, std::allocator<std::complex<float> > > const&) at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/c++/4.2.1/bits/vector.tcc:137
#2 0x00018708 in Analyzer::calcFFT() at /Developer/of_007_iphone/apps/cwi007/iTicTacToe/src/gameplay/pitch.cc:86
#3 0x0001881c in Analyzer::process() at /Developer/of_007_iphone/apps/cwi007/iTicTacToe/src/gameplay/pitch.cc:197
#4 0x00004378 in testApp::audioIn(float*, int, int) at /Developer/of_007_iphone/apps/cwi007/iTicTacToe/src/testApp.mm:362
#5 0x004a3fa0 in recordingCallback(void*, unsigned long*, AudioTimeStamp const*, unsigned long, unsigned long, AudioBufferList*) at /Developer/of_007_iphone/libs/openFrameworks/sound/ofxiPhoneSoundStream.mm:143
#6 0x361ccae0 in AUIOHelper::NotifyInputAvailable(AudioTimeStamp const&, unsigned long, AudioBufferList const&)()
#7 0x361b9b90 in AURemoteIO::PerformIO(unsigned int, unsigned int, XAudioTimeStamp const&, XAudioTimeStamp const&, int&)()
#8 0x361b9cfc in AURIOCallbackReceiver_PerformIO()
#9 0x361b0fcc in _XPerformIO()
#10 0x360dccbc in mshMIGPerform()
#11 0x36173850 in MSHMIGDispatchMessage()
#12 0x361c0b5c in AURemoteIO::IOThread::Entry(void*)()
#13 0x3609ebb4 in CAPThread::Entry(CAPThread*)()
#14 0x33c14684 in _pthread_start()
當在Debug模式下使用Xcode,並且您的應用程序與EXC_BAD_ACCESS一起崩潰時,Xcode中是否沒有堆棧跟蹤? – whg
這是一個堆棧跟蹤。 –
我對xcode一無所知,但是有一個名爲valgrind的工具,你可以使用,它會經常告訴你是什麼導致了崩潰。如果你的程序被稱爲'foo',那麼你只需運行'valgrind foo',當程序崩潰時,它會告訴你什麼內存被錯誤地訪問。 –