2013-03-18 134 views
1

我的程序正在經歷一個無限循環,我試圖找出原因。 (這不是我問的)。我通常會去GDB找出哪裏出了問題,但從字面上看,在我的程序開始的時候,它一直在崩潰。GDB不斷崩潰

__strcmp_ia32()在../sysdeps/i386/i686/multiarch/../strcmp.S:34

#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 

//Prototypes and linked lists here 

int debugMode(int argc, char** argv) 
{ 
    if(strcmp(argv[argc-1], "-d") == 0) // GDB stops right here. 
     return 1; 

    else 
     return 0; 
} 

int main(int argc, char** argv) 
{ 
    int debug, integer; 
    char choice; 
    node *head = NULL; 
    node *current; 

    debug = debugMode(argc, argv); 
    // stuff here 
} 

記住我有一個函數原型。謝謝你的幫助。

編輯:btw我沒有發送任何參數。我正在使用重定向來找出導致我的程序無限循環的原因。

+0

我沒有發送參數...抱歉,不清楚。我編輯了我的帖子。無論如何,我認爲我的gdb有些問題..我評論說部分出來,現在它隨機與另一部分崩潰。它不應該崩潰:\。 – juice 2013-03-18 09:40:56

+0

你編譯過哪個-g標誌嗎? – 2013-03-18 09:44:18

+0

是的,我做的是那麼糟糕? – juice 2013-03-18 09:44:38

回答

0

不斷崩潰此消息。

__strcmp_ia32() at ../sysdeps/i386/i686/multiarch/../strcmp.S:34 

你的glibc的版本有這個(最近固定的)錯誤:http://sourceware.org/bugzilla/show_bug.cgi?id=13786

(注:sourceware.org是本週下跌對硬件進行升級,如果你得到一個「無路線」來了,稍後再試。)