DynamoRIO / DynamoRIO/dynamorio
Drcov produces empty logfile
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
**Describe the bug**
DrCov produces blank log file. I found this while trying differential coverage tracing on a straight forward windows function relating to mark of the web.
```
#include
#include // IAttachmentExecute
#include
int main() {
HRESULT hr;
Sleep(1000);
// 1. Initialize COM
hr = CoInitialize(NULL);
if (FAILED(hr)) {
std::cout << "COM init failed\n";
return 1;
}
IAttachmentExecute* pAttach = nullptr;
// 2. Create the Attachment Services object
hr = CoCreateInstance(
CLSID_AttachmentServices,
NULL,
CLSCTX_INPROC_SERVER,
IID_IAttachmentExecute,
(void**)&pAttach
);
if (FAILED(hr)) {
std::cout << "CoCreateInstance failed\n";
CoUninitialize();
return 1;
}
// 3. Set file path
pAttach->SetLocalPath(L"C:\\Users\\[user]\\Desktop\\calc.exe");
// 4. Set source UR THIS is what you asked about
pAttach->SetSource(L"http://example.com");
// 5. (Optional) Set referrer
pAttach->SetReferrer(L"https://example.com");
// 6. Commit (this writes Zone.Identifier!)
hr = pAttach->Save();
if (SUCCEEDED(hr)) {
std::cout << "MotW applied successfully\n";
Sleep(1000);
} else {
std::cout << "Save failed\n";
}
// 7. Cleanup
pAttach->Release();
CoUninitialize();
return 0;
}
```
**To Reproduce**
Steps to reproduce the behavior:
1. Compile the above code to exe
2. Run drcov via drrun -t drcov -- [name].exe
3. Note this does not usually produce a log file, it rarely does however
Please also answer these questions:
- What happens when you run without any client?
- What happens when you run with debug build ("-debug" flag to drrun/drconfig/drinject)?
Please provide a symbolized callstack of any crash or assert so we do not have to speculate or guess as to where it is occurring (see our [Linux gdb instructions](https://dynamorio.org/page_debugging.html#autotoc_md146) and [Windows windbg instructions](https://dynamorio.org/page_debugging.html#autotoc_md157) to see how to load DynamoRIO symbols for a callstack).
**Expected behavior**
Generates a logfile, drcov however works fine with something like calc.exe
**Versions**
- What version of DynamoRIO are you using? I am using the latest build
- Does the latest build from https://github.com/DynamoRIO/dynamorio/releases solve the problem? no
- What operating system version are you running on? ("Windows 10" is *not* sufficient: give the release number.) Windows 10 pro 22H2 19045.6466
- Is your application 32-bit or 64-bit? 64 bit
Contributor guide
Assessment
This issue has not been assessed yet.