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

<vector>: Annotate vector for use with ASan #2030

Closed
cbezault opened this issue Jun 30, 2021 · 2 comments · Fixed by #2071
Closed

<vector>: Annotate vector for use with ASan #2030

cbezault opened this issue Jun 30, 2021 · 2 comments · Fixed by #2071
Labels
ASan Address Sanitizer enhancement Something can be improved fixed Something works now, yay!

Comments

@cbezault
Copy link
Contributor

ASan can be taught to understand the concept of an access to a contiguous container that is in a valid region of memory but not in a valid region of the container.

e.g.

std::vector<int> v;
v.push_back(1);
v.pop_back();
*v.data() = 1;

would not result in an ASan exception as things stand. However, we can add annotations to the ASan shadow memory using __sanitizer_annotate_contiguous_container which will allow ASan to detect the invalid access.

@cbezault cbezault added enhancement Something can be improved work in progress labels Jun 30, 2021
@AlexGuteniev
Copy link
Contributor

  • <string> ?

@StephanTLavavej
Copy link
Member

Linking #2071 (comment) here for the record - <string> changes are indeed planned.

@StephanTLavavej StephanTLavavej added the fixed Something works now, yay! label Dec 11, 2021
@StephanTLavavej StephanTLavavej added the ASan Address Sanitizer label Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASan Address Sanitizer enhancement Something can be improved fixed Something works now, yay!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants