-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c++ stat crash in dr_client_main in Windows private libraries #7220
Comments
To ensure stability it is best to avoid external library routines in clients and use the DR API: here There likely are no team developer resources able to investigate whatever is going wrong in the Windows private libraries causing this issue with |
OK, I have used DynamoRIO for 2.5 years and I have read quite a few DynamoRIO source codes. My understanding of DynamoRIO is roughly sufficient to write a simple drwrap library by myself. Now it is difficult for me to dig deeply into DynamoRIO to figure out what happens to stat but I will keep trying to solve this issue. I will keep updating this post if I have made any progress. |
To get the file size, I do not want to open that file.
So, I use c++ "stat" function.
Here is the total function I use to get a file size without opening a file.
size_t get_file_size(const std::string& file_path)
{
size_t res = 0;
struct stat buf;
int result;
result = stat(file_path.c_str(), &buf);
if (result != 0) {
// cout << "file info error, file may not be existed." << endl;
}
else {
res = buf.st_size;
}
return res;
}
When I invoke this function in dr_client_main, the dynamorio crashes.
The crash point is when the stat is invoked.
I tested it in normal visual studio console applicaiton, the above function runs normally.
The Operating System is Windows 10.
DynamoRIO version is DynamoRIO-Windows-11.3.0-1.
Using -debug option, the output is:
Internal Error: DynamoRIO debug check failure: D:\a\dynamorio\dynamorio\core\win32\loader.c:777 !is_dynamo_address(dcontext->app_fls_data)
(Error occurred @0 frags in tid 27296)
version 11.3.0, build 1
It seems some loading dll error happens when I use "stat" function in client.
The text was updated successfully, but these errors were encountered: