2016-06-02 10 views
1

私のアプリケーションでGoogleブレイクパッドを使用しようとしています。しかし、私はそうしている間buserrorになっています。Googleブレイクパッドを使用して例外ハンドラを登録しているときにバスエラーが発生しました

サンプル・アプリケーション:

#include<iostream> 
using namespace std; 

#include "client/linux/handler/exception_handler.h" 
static bool breakpadDumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded) 
{ 
    return succeeded; 
} 


int main() 
{ 
    cout << "Hello World! \n"; 

    //Adding changes for google breakpad 
    static google_breakpad::ExceptionHandler* excHandler = NULL; 
    cout << "Here-----------! \n"; 

    // delete excHandler; 

    excHandler = new google_breakpad::ExceptionHandler(google_breakpad::MinidumpDescriptor("/opt/minidumps/"), NULL, breakpadDumpCallback, NULL, true, -1); 

    cout << "Registered Google Breakpad exceptionHandler\n"; 

    int *x = NULL; 
    *x = 10; 

    return 0; 
} 

私はラインの下からエラーを取得しています:

excHandler = new google_breakpad::ExceptionHandler(google_breakpad::MinidumpDescriptor("/opt/minidumps/"), NULL, breakpadDumpCallback, NULL, true, -1); 

出力:

Hello World! 
Here-----------! 
Bus error (core dumped) 

私が間違って何をやっていますか? libbreakpad_client(静的ライブラリ http://fossies.org/linux/seafile-client/src/crash-handler.cpp

答えて

0

0

(正確に)可能な限り既存の実施例と一致し、それはまだ動作しない場合は、あなたのコードをしようと、この

google_breakpad::MinidumpDescriptor(std::string("/opt/minidumps/")) 

を試してみてください。 a)私が使用していたのは互換性のないものでした。それがバスエラーを示す理由です。私はそれを別のものに置き換え、それは期待どおりに働いています。

関連する問題