Skip to content
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

Dependency loss caused by not instrumenting the STL standard library. #665

Open
J1372628520 opened this issue Oct 17, 2024 · 4 comments
Open

Comments

@J1372628520
Copy link

Additionally, we have identified an issue: when the code makes extensive use of the STL standard library, such as smart pointers, if we do not instrument the STL template class libraries, dependency loss occurs. We look forward to your response.

@lukasrothenberger
Copy link
Collaborator

hello @J1372628520

this is, if i understand your correctly, expected behavior.

Since only data accesses originating from parts of the code which are instrumented are known to DiscoPoP, data accesses which are caused by other code sections (for example, the STL in your example) can not be known and thus lead to the missed dependencies.

Unfortunately, i do not see a reliable way around this. If you have any suggestions, please let me know!

@RainMolisa
Copy link

hello @J1372628520

this is, if i understand your correctly, expected behavior.

Since only data accesses originating from parts of the code which are instrumented are known to DiscoPoP, data accesses which are caused by other code sections (for example, the STL in your example) can not be known and thus lead to the missed dependencies.

Unfortunately, i do not see a reliable way around this. If you have any suggestions, please let me know!

I have a suggestion. When the pass find a STL function caller, just insert __dp_read __dp_write for the caller's parameters and skip the STL function's callee.

@lukasrothenberger
Copy link
Collaborator

Hi @RainMolisa
but in case of pointer accesses or similar, this will lead to missed data dependencies as well.

@RainMolisa
Copy link

Hi @RainMolisa but in case of pointer accesses or similar, this will lead to missed data dependencies as well.

yeah!It's true. However ,the data dependencies in STL case is prior knowledge.
For example, in following code you know the 'resize' will read 'b' and write 'vec' and no other data dependencies may lose. (Also, you don't know write 'vec' in where, but user don't care.)

vector<int> vec;
void B(int b)
{
    vec.resize(b);
}

In discopop version 3.2.1, the 'resize' will expand and make may data dependencies which the user don't care. however, if you set DP_PROJECT_ROOT_DIR, you will lose 'vec' 's data dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants