示例#1
0
void sigabrtHandler(int)
{
    signal(SIGABRT, 0);
    signal(SIGSEGV, 0);
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
    std::cerr << "\n\n*************************************************************\n";
    std::cerr << "Catching SIGABRT, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n";
    std::cerr << "qBittorrent version: " << VERSION << std::endl;
    print_stacktrace();
#else
#ifdef STACKTRACE_WIN
    StraceDlg dlg;
    dlg.setStacktraceString(straceWin::getBacktrace());
    dlg.exec();
#endif
#endif
    raise(SIGABRT);
}
示例#2
0
void sigAbnormalHandler(int signum)
{
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
    const char str1[] = "\n\n*************************************************************\nCatching signal: ";
    const char *sigName = sysSigName[signum];
    const char str2[] = "\nPlease file a bug report at http://bug.qbittorrent.org and provide the following information:\n\n"
    "qBittorrent version: " QBT_VERSION "\n";
    write(STDERR_FILENO, str1, strlen(str1));
    write(STDERR_FILENO, sigName, strlen(sigName));
    write(STDERR_FILENO, str2, strlen(str2));
    print_stacktrace();  // unsafe
#endif // !defined Q_OS_WIN && !defined Q_OS_HAIKU
#ifdef STACKTRACE_WIN
    StraceDlg dlg;  // unsafe
    dlg.setStacktraceString(straceWin::getBacktrace());
    dlg.exec();
#endif // STACKTRACE_WIN
    signal(signum, SIG_DFL);
    raise(signum);
}
示例#3
0
void sigAbnormalHandler(int signum)
{
    const char *sigName = sysSigName[signum];
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
    const char msg[] = "\n\n*************************************************************\n"
        "Please file a bug report at http://bug.qbittorrent.org and provide the following information:\n\n"
        "qBittorrent version: " QBT_VERSION "\n\n"
        "Caught signal: ";
    reportToUser(msg);
    reportToUser(sigName);
    reportToUser("\n");
    print_stacktrace();  // unsafe
#endif // !defined Q_OS_WIN && !defined Q_OS_HAIKU
#ifdef STACKTRACE_WIN
    StraceDlg dlg;  // unsafe
    dlg.setStacktraceString(QLatin1String(sigName), straceWin::getBacktrace());
    dlg.exec();
#endif // STACKTRACE_WIN
    signal(signum, SIG_DFL);
    raise(signum);
}