Open FlyAs opened 7 years ago
Hmm, after some tests. I increase the DR's stack size to 512K by "-stack_size 512K" option, the svchost.exe process is not crashing anymore. Maybe it is because the default DR's stack size(56K) is too small.
UPDATE: The crash problem still exists at the second OS reboot:( Now it crash in dynamorio.dll:
What version of DynamoRIO are you using? DynamoRIO-Windows-7.0.0-RC1
Does the latest build from https://github.com/DynamoRIO/dynamorio/wiki/Latest-Build solve the problem? This is the latest
What operating system version are you running on? Windows XP SP3 EN 32Bit
What application are you running? The OS svchost.exe process.
Is your application 32-bit or 64-bit? 32-bit svchost.exe OS process.
How are you running the application under DynamoRIO? bin32\drconfig.exe -reg winlogon.exe -syswide_on -debug -global -c samples\bin32\wrap.dll
What happens when you run without any client? Without the drwrap extension, every process runs ok.
What happens when you run with debug build ("-debug" flag to drrun/drconfig/drinject)? The svchost.exe process crashes as well.
What steps will reproduce the problem? 1.In a clean windows xp sp3 virtual machine with DR deployed, run the following command: bin32\drconfig.exe -reg winlogon.exe -syswide_on -debug -global -c samples\bin32\wrap.dll 2.Reboot the OS. 3.After the desktop have showed, wait for the crash message box to be shown.
What is the expected output? What do you see instead? Is this an application crash, a DynamoRIO crash, a DynamoRIO assert, or a hang (see https://github.com/DynamoRIO/dynamorio/wiki/Bug-Reporting and set the title appropriately)? All process running under DR should runs ok. The drwrap extension crash.
Please provide any additional information below. I want to put all processes in the opeating system running under DR, so I config the winlogon.exe as system wide to running under DR. Without the drwrap extension, everything seems ok. I modify the "wrap" sample client's source code to following `
include "dr_api.h"
include "drmgr.h"
include "drwrap.h"
static app_pc app_base = NULL; static app_pc app_end = NULL;
static void wrap_pre(void *wrapcxt, OUT void **user_data) {
}
static void wrap_post(void wrapcxt, void user_data) {
}
static void iterate_exports(const module_data_t info, bool add) { dr_symbol_export_iterator_t exp_iter = dr_symbol_export_iterator_start(info->handle); while (dr_symbol_export_iterator_hasnext(exp_iter)) { dr_symbol_export_t *sym = dr_symbol_export_iterator_next(exp_iter); app_pc func = NULL; if (sym->is_code) func = sym->addr;
}
static void module_load_event(void drcontext, const module_data_t info, bool loaded) { if (info->start != app_base) iterate_exports(info, true); }
static void module_unload_event(void drcontext, const module_data_t info) { if (info->start != app_base) iterate_exports(info, false); }
static void event_exit(void) { drwrap_exit(); drmgr_exit(); }
DR_EXPORT void dr_client_main(client_id_t id, int argc, const char argv[]) { module_data_t appmod;
}
Build it and replace the DR's. Config it to run with command
bin32\drconfig.exe -reg winlogon.exe -syswide_on -debug -global -c samples\bin32\wrap.dll ` After rebooting the OS, you will find one of the svchost.exe process crashes showing as following This crashed svchost.exe process has many services running in it, so with many threads. The explorer.exe process crash somtimes, but not always. Is the drwrap extension failed to handle this situation?