drmemory icon indicating copy to clipboard operation
drmemory copied to clipboard

-src_whitelist command argument does not work with `..`

Open JoshSnek opened this issue 5 years ago • 1 comments

drmemory -src_whitelist "C:\Repo\**" myApp.exe behaves as expected, finding errors drmemory -src_whitelist "C:\Repo\subdir\..\**" myApp.exe finds no errors

JoshSnek avatar Feb 07 '20 15:02 JoshSnek

I'm guessing that you ran into the bug where github doesn't present our bug templates if you're just logging in. That being said, this seems like an easy enough issue that maybe it's not needed anyway.

I took a look at the source and afaict it appears that what you're requesting is simply not supported right now. Please feel free to send in a Pull Request if you'd like to add this functionality.

By my read, we check the src_whitelist here using text_matches_any_pattern:

https://github.com/DynamoRIO/drmemory/blob/d261a4dc254016355f64ebf5eff9187dccb34eb2/drmemory/report.c#L1274-L1290

And text_matches_any_pattern calls text_contains_any_string, which just uses strstr/strcasestr to compare the paths:

https://github.com/DynamoRIO/drmemory/blob/d261a4dc254016355f64ebf5eff9187dccb34eb2/common/utils.c#L625-L655

Carrotman42 avatar Feb 07 '20 16:02 Carrotman42