DynamoRIO / DynamoRIO/dynamorio

[drmemtrace] process_memref errors not propagated if error_string_ not set

Open
#7,507 1 comment 0 reactions 0 assignees View on GitHub
Bug-ToolFail Component-DrMemtrace
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 18h
Merged PRs (30d)
30

Description

The documentation of `analysis_tool_t::process_memref` documents that:

```
* The return value indicates whether it was successful.
* On failure, get_error_string() returns a descriptive message.
```
where `get_error_string()` simply returns `error_string_`.

If drmemtrace analysis tools return false from `process_memref`, but forget to set `error_string_` to any non-empty value, the drmemtrace analyzer framework ends analysis, but does not report any error in `analyzer_t::run()` where the checks are based on the error string:
https://github.com/DynamoRIO/dynamorio/blob/43abef5e542a01d21e9390286984c74d9f792367/clients/drcachesim/analyzer.cpp#L1024

We should either enforce that tools set the error string if they return false in `process_memref` or `parallel_shard_memref`, or just add a prefix to the error string at
https://github.com/DynamoRIO/dynamorio/blob/43abef5e542a01d21e9390286984c74d9f792367/clients/drcachesim/analyzer.cpp#L619
and
https://github.com/DynamoRIO/dynamorio/blob/43abef5e542a01d21e9390286984c74d9f792367/clients/drcachesim/analyzer.cpp#L745

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.