mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=10113
This commit is contained in:
parent
ce8ee60f72
commit
aad7a928b2
|
@ -635,7 +635,7 @@ static void handle_process_control_msg() {
|
|||
if (match_tag(buf, "<abort/>")) {
|
||||
boinc_status.abort_request = true;
|
||||
if (options.direct_process_action) {
|
||||
diagnostics_aborted_via_gui();
|
||||
diagnostics_set_aborted_via_gui();
|
||||
#if defined(_WIN32)
|
||||
// Cause a controlled assert and dump the callstacks.
|
||||
DebugBreak();
|
||||
|
@ -771,7 +771,7 @@ int set_worker_timer() {
|
|||
// Initialize the worker thread info for diagnostic
|
||||
// purposes.
|
||||
diagnostics_set_thread_name("Worker");
|
||||
|
||||
diagnostics_set_thread_worker();
|
||||
|
||||
// Use Windows multimedia timer, since it is more accurate
|
||||
// than SetTimer and doesn't require an associated event loop
|
||||
|
|
|
@ -540,6 +540,7 @@ void win_graphics_event_loop() {
|
|||
// Initialize the graphics thread info for diagnostic
|
||||
// purposes.
|
||||
diagnostics_set_thread_name("Graphics");
|
||||
diagnostics_set_thread_graphics();
|
||||
|
||||
// Register window class and graphics mode message
|
||||
reg_win_class();
|
||||
|
|
|
@ -4504,3 +4504,32 @@ David 5 May 2006
|
|||
client/
|
||||
gui_rpc_server.C
|
||||
net_xfer_curl.h
|
||||
|
||||
Rom 8 May 2006
|
||||
- Windows Runtime Debugger Update:
|
||||
|
||||
1. ERR_NESTED_UNHANDLED_EXCEPTIONS no longer exist.
|
||||
2. Stack overflow conditions no longer cause the exception
|
||||
handling code to blow up.
|
||||
|
||||
When a thread has an unhandled exception it stores the
|
||||
exception pointer record in the thread list, signals the
|
||||
unhandled exception monitor and then goes to sleep waiting
|
||||
on a mutex that it will never be and to aquire.
|
||||
|
||||
If any other threads throw an unhandled exception they'll
|
||||
store their exception records and go to sleep.
|
||||
|
||||
The unhandled exception monitor wakes up when signaled and
|
||||
suspends all the non-excempt threads and proceeds to dump
|
||||
all the information it has aquired on them to stderr.
|
||||
|
||||
api/
|
||||
boinc_api.C
|
||||
windows_opengl.C
|
||||
lib/
|
||||
diagnostics.C, .h
|
||||
diagnostics_win.C, .h
|
||||
error_numbers.h
|
||||
stackwalker_win.cpp
|
||||
|
||||
|
|
|
@ -73,10 +73,7 @@ static int aborted_via_gui;
|
|||
|
||||
|
||||
#ifdef _WIN32
|
||||
LONG CALLBACK boinc_catch_signal(EXCEPTION_POINTERS *ExceptionInfo);
|
||||
int __cdecl boinc_message_reporting(int reportType, char *szMsg, int *retVal);
|
||||
#else
|
||||
static void boinc_catch_signal(int signal);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -198,7 +195,8 @@ int diagnostics_init(
|
|||
// The data for this structure should be set by
|
||||
// boinc_init or boinc_init_graphics.
|
||||
diagnostics_init_thread_list();
|
||||
|
||||
|
||||
diagnostics_init_unhandled_exception_monitor();
|
||||
diagnostics_init_message_monitor();
|
||||
|
||||
#if defined(_DEBUG)
|
||||
|
@ -310,7 +308,7 @@ char* diagnostics_get_proxy() {
|
|||
|
||||
|
||||
// Set the value of the flag
|
||||
int diagnostics_aborted_via_gui() {
|
||||
int diagnostics_set_aborted_via_gui() {
|
||||
aborted_via_gui = 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -84,30 +84,37 @@ extern int diagnostics_is_proxy_enabled();
|
|||
extern char* diagnostics_get_proxy();
|
||||
|
||||
extern int diagnostics_is_aborted_via_gui();
|
||||
extern int diagnostics_aborted_via_gui();
|
||||
extern int diagnostics_set_aborted_via_gui();
|
||||
|
||||
// Log rotation
|
||||
extern int diagnostics_cycle_logs();
|
||||
|
||||
// Thread Tracking
|
||||
extern int diagnostics_init_thread_list();
|
||||
extern int diagnostics_finish_thread_list();
|
||||
extern int diagnostics_update_thread_list();
|
||||
extern int diagnostics_set_thread_name( char* name );
|
||||
extern int diagnostics_set_thread_exempt_suspend();
|
||||
extern int diagnostics_set_thread_graphics();
|
||||
extern int diagnostics_set_thread_worker();
|
||||
|
||||
// Message Monitoring
|
||||
extern int diagnostics_init_message_monitor();
|
||||
extern int diagnostics_message_monitor_dump();
|
||||
extern int diagnostics_finish_message_monitor();
|
||||
#ifdef _WIN32
|
||||
DWORD WINAPI diagnostics_message_monitor(LPVOID lpParameter);
|
||||
extern DWORD WINAPI diagnostics_message_monitor(LPVOID lpParameter);
|
||||
#endif
|
||||
|
||||
|
||||
// These are functions that are specific to Unix
|
||||
#ifndef _WIN32
|
||||
|
||||
// Unhandled exception monitor
|
||||
extern int diagnostics_init_unhandled_exception_monitor();
|
||||
extern int diagnostics_finish_unhandled_exception_monitor();
|
||||
#ifdef _WIN32
|
||||
extern DWORD WINAPI diagnostics_unhandled_exception_monitor(LPVOID lpParameter);
|
||||
extern LONG CALLBACK boinc_catch_signal(EXCEPTION_POINTERS *ExceptionInfo);
|
||||
#else
|
||||
extern void boinc_catch_signal(int signal);
|
||||
extern void boinc_set_signal_handler(int sig, void(*handler)(int));
|
||||
extern void boinc_set_signal_handler_force(int sig, void(*handler)(int));
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,139 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#ifndef _BOINC_DIAGNOSTICS_WIN_
|
||||
#define _BOINC_DIAGNOSTICS_WIN_
|
||||
|
||||
#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
|
||||
#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L)
|
||||
#define SystemProcessAndThreadInformation 5
|
||||
|
||||
typedef LONG NTSTATUS;
|
||||
|
||||
typedef LONG KPRIORITY;
|
||||
|
||||
typedef struct _CLIENT_ID {
|
||||
DWORD UniqueProcess;
|
||||
DWORD UniqueThread;
|
||||
} CLIENT_ID;
|
||||
|
||||
typedef struct _UNICODE_STRING {
|
||||
USHORT Length;
|
||||
USHORT MaximumLength;
|
||||
PWSTR Buffer;
|
||||
} UNICODE_STRING;
|
||||
|
||||
typedef struct _VM_COUNTERS {
|
||||
SIZE_T PeakVirtualSize;
|
||||
SIZE_T VirtualSize;
|
||||
ULONG PageFaultCount;
|
||||
SIZE_T PeakWorkingSetSize;
|
||||
SIZE_T WorkingSetSize;
|
||||
SIZE_T QuotaPeakPagedPoolUsage;
|
||||
SIZE_T QuotaPagedPoolUsage;
|
||||
SIZE_T QuotaPeakNonPagedPoolUsage;
|
||||
SIZE_T QuotaNonPagedPoolUsage;
|
||||
SIZE_T PagefileUsage;
|
||||
SIZE_T PeakPagefileUsage;
|
||||
} VM_COUNTERS;
|
||||
|
||||
typedef struct _SYSTEM_THREADS {
|
||||
LARGE_INTEGER KernelTime;
|
||||
LARGE_INTEGER UserTime;
|
||||
LARGE_INTEGER CreateTime;
|
||||
ULONG WaitTime;
|
||||
PVOID StartAddress;
|
||||
CLIENT_ID ClientId;
|
||||
KPRIORITY Priority;
|
||||
KPRIORITY BasePriority;
|
||||
ULONG ContextSwitchCount;
|
||||
LONG State;
|
||||
LONG WaitReason;
|
||||
} SYSTEM_THREADS, * PSYSTEM_THREADS;
|
||||
|
||||
typedef struct _SYSTEM_PROCESSES_NT4 {
|
||||
ULONG NextEntryDelta;
|
||||
ULONG ThreadCount;
|
||||
ULONG Reserved1[6];
|
||||
LARGE_INTEGER CreateTime;
|
||||
LARGE_INTEGER UserTime;
|
||||
LARGE_INTEGER KernelTime;
|
||||
UNICODE_STRING ProcessName;
|
||||
KPRIORITY BasePriority;
|
||||
ULONG ProcessId;
|
||||
ULONG InheritedFromProcessId;
|
||||
ULONG HandleCount;
|
||||
ULONG Reserved2[2];
|
||||
VM_COUNTERS VmCounters;
|
||||
SYSTEM_THREADS Threads[1];
|
||||
} SYSTEM_PROCESSES_NT4, *PSYSTEM_PROCESSES_NT4;
|
||||
|
||||
typedef struct _SYSTEM_PROCESSES {
|
||||
ULONG NextEntryDelta;
|
||||
ULONG ThreadCount;
|
||||
ULONG Reserved1[6];
|
||||
LARGE_INTEGER CreateTime;
|
||||
LARGE_INTEGER UserTime;
|
||||
LARGE_INTEGER KernelTime;
|
||||
UNICODE_STRING ProcessName;
|
||||
KPRIORITY BasePriority;
|
||||
ULONG ProcessId;
|
||||
ULONG InheritedFromProcessId;
|
||||
ULONG HandleCount;
|
||||
ULONG Reserved2[2];
|
||||
VM_COUNTERS VmCounters;
|
||||
IO_COUNTERS IoCounters;
|
||||
SYSTEM_THREADS Threads[1];
|
||||
} SYSTEM_PROCESSES, * PSYSTEM_PROCESSES;
|
||||
|
||||
typedef enum _THREAD_STATE {
|
||||
ThreadStateInitialized,
|
||||
ThreadStateReady,
|
||||
ThreadStateRunning,
|
||||
ThreadStateStandby,
|
||||
ThreadStateTerminated,
|
||||
ThreadStateWaiting,
|
||||
ThreadStateTransition
|
||||
} THREAD_STATE, *PTHREAD_STATE;
|
||||
|
||||
typedef enum _THREAD_WAIT_REASON {
|
||||
ThreadWaitReasonExecutive,
|
||||
ThreadWaitReasonFreePage,
|
||||
ThreadWaitReasonPageIn,
|
||||
ThreadWaitReasonPoolAllocation,
|
||||
ThreadWaitReasonDelayExecution,
|
||||
ThreadWaitReasonSuspended,
|
||||
ThreadWaitReasonUserRequest,
|
||||
ThreadWaitReasonWrExecutive,
|
||||
ThreadWaitReasonWrFreePage,
|
||||
ThreadWaitReasonWrPageIn,
|
||||
ThreadWaitReasonWrPoolAllocation,
|
||||
ThreadWaitReasonWrDelayExecution,
|
||||
ThreadWaitReasonWrSuspended,
|
||||
ThreadWaitReasonWrUserRequest,
|
||||
ThreadWaitReasonWrEventPairHigh,
|
||||
ThreadWaitReasonWrEventPairLow,
|
||||
ThreadWaitReasonWrLpcReceive,
|
||||
ThreadWaitReasonWrLpcReply,
|
||||
ThreadWaitReasonWrVirtualMemory,
|
||||
ThreadWaitReasonWrPageOut,
|
||||
ThreadWaitReasonMaximumWaitReason
|
||||
} THREAD_WAIT_REASON;
|
||||
|
||||
#endif
|
|
@ -111,7 +111,6 @@
|
|||
#define ERR_NO_EXIT_STATUS -162
|
||||
// exit_status not found in scheduler request
|
||||
#define ERR_FILE_MISSING -163
|
||||
#define ERR_NESTED_UNHANDLED_EXCEPTION_DETECTED -164
|
||||
#define ERR_SEMGET -165
|
||||
#define ERR_SEMCTL -166
|
||||
#define ERR_SEMOP -167
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include "boinc_win.h"
|
||||
#endif
|
||||
|
||||
#include "version.h"
|
||||
#include "stackwalker_win.h"
|
||||
#include "stackwalker_imports.h"
|
||||
|
||||
|
@ -97,17 +96,6 @@ static CRITICAL_SECTION g_csFileOpenClose = {0};
|
|||
// ##########################################################################################
|
||||
|
||||
|
||||
// Write Date/Time to specified file (will also work after 2038)
|
||||
void DebuggerWriteDateTime() {
|
||||
TCHAR pszTemp[11], pszTemp2[11];
|
||||
|
||||
_tstrdate( pszTemp );
|
||||
_tstrtime( pszTemp2 );
|
||||
|
||||
_ftprintf(stderr, _T("%s %s"), pszTemp, pszTemp2 );
|
||||
}
|
||||
|
||||
|
||||
bool DebuggerLoadLibrary(
|
||||
HINSTANCE* lphInstance, const std::string strBOINCLocation, const std::string strLibrary
|
||||
)
|
||||
|
@ -619,14 +607,6 @@ int DebuggerDisplayDiagnostics()
|
|||
lpDV = pIAV();
|
||||
pSGSP(g_hProcess, buf, TTBUFLEN);
|
||||
|
||||
_ftprintf( stderr, _T("\n\n"));
|
||||
_ftprintf( stderr, _T("BOINC Windows Runtime Debugger Version %s\n"), BOINC_VERSION_STRING);
|
||||
_ftprintf( stderr, _T("\n"));
|
||||
_ftprintf( stderr, _T("Dump Timestamp : "));
|
||||
DebuggerWriteDateTime();
|
||||
_ftprintf( stderr, _T("\n"));
|
||||
_ftprintf( stderr, _T("Current Process ID: %x\n"), GetCurrentProcessId());
|
||||
_ftprintf( stderr, _T("Current Thread ID : %x\n"), GetCurrentThreadId());
|
||||
_ftprintf( stderr, _T("Debugger Engine : %d.%d.%d.%d\n"), lpDV->MajorVersion, lpDV->MinorVersion, lpDV->Revision, lpDV->Reserved);
|
||||
_ftprintf( stderr, _T("Symbol Search Path: %s\n"), buf);
|
||||
_ftprintf( stderr, _T("\n\n"));
|
||||
|
@ -636,7 +616,7 @@ int DebuggerDisplayDiagnostics()
|
|||
_ftprintf(stderr, _T("SymEnumerateModules64(): GetLastError = %lu\n"), gle );
|
||||
}
|
||||
|
||||
_ftprintf( stderr, _T("\n"));
|
||||
_ftprintf( stderr, _T("\n\n"));
|
||||
|
||||
LeaveCriticalSection(&g_csFileOpenClose);
|
||||
|
||||
|
@ -717,6 +697,7 @@ static void ShowStackRM(HANDLE hThread, CONTEXT& Context)
|
|||
EnterCriticalSection(&g_csFileOpenClose);
|
||||
InterlockedIncrement((long*) &g_dwShowCount); // erhöhe counter
|
||||
|
||||
_ftprintf(stderr, _T("- Registers -\n"));
|
||||
|
||||
// Dump the Context data
|
||||
_ftprintf(stderr,
|
||||
|
@ -733,6 +714,7 @@ static void ShowStackRM(HANDLE hThread, CONTEXT& Context)
|
|||
);
|
||||
|
||||
// Stack Header
|
||||
_ftprintf(stderr, _T("- Callstack -\n"));
|
||||
_ftprintf(stderr, _T("ChildEBP RetAddr Args to Child\n"));
|
||||
fflush( stderr );
|
||||
|
||||
|
|
Loading…
Reference in New Issue