[問題] stack smashing detected如何解決?
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Linux uBuntu 10.04 gcc 4.4.3
問題(Question):
程式跑到一半出現stact smashing detected 被強迫中止
有問題的程式碼大致如下
void myclass::0nIdle(wxIdleEvent& event)
{
function_a(); // a b 都是myclass的function
printf("test2\n"); // 後來加上去的
function_b();
...
}
void myclass::function_a(){
宣告變數
while(mPathgGuiStream->CanRead() == true)
{
...
}
printf("test1\n");
}
function_a() 與 function_b() 執行多次後出現問題
於是我加了兩個printf測試
發現程式最後test1有印出來
接著stack smashing detected
test2沒有印出來
這樣是指在離開function_a()的時候出現錯誤嗎?
請問有人有類似經驗嗎?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.42.145
推
05/11 13:24, , 1F
05/11 13:24, 1F
→
05/11 13:25, , 2F
05/11 13:25, 2F
→
05/12 09:24, , 3F
05/12 09:24, 3F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章