-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[Clang SA]: custom malloc/free checker #76861
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
Comments
@llvm/issue-subscribers-clang-static-analyzer Author: None (mat-c)
Hi,
today unix.malloc can be customized with attribute with But in some system there can be several allocator. I could be usefull to check that malloc_1 are free with free_1, malloc_2, free with free_2. Also how do you model custom realloc ? |
AFAIK CSA might accept, but for sure does not check the semantics of the attributes as expected. |
Hi! This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below. |
@llvm/issue-subscribers-good-first-issue Author: None (mat-c)
Hi,
today unix.malloc can be customized with attribute with But in some system there can be several allocator. I could be usefull to check that malloc_1 are free with free_1, malloc_2, free with free_2. Also how do you model custom realloc ? |
I would like to take this issue if this is available! And would appreciate if there can be some pointers how to get started. |
Hello, I am new to LLVM and would like to work on this issue. |
Hello, I have some experience in developing ClangSA and would like to work on this issue |
@cascades-sjtu: Just create pull request and mention it on this page. |
Hi, it's my first work in the LLVM project and I would like to try to fix this one. |
@junglipe are you working on this issue ? |
@mat-c does anyone is working on that issue? |
@steakhal , does this issue aim to explore the implementation of a custom realloc also? |
I suppose the changes need to be implemented in |
So to be clear about what needs to be done here, the code below should raise a warning that malloc_1 should be freed with free_1 only : But then how exactly are you identifying as to which free belongs to which user malloc implementation? Since these are just variables, or maybe we are limiting ourselves to names like _1 only.
|
) Summary: Add support for checking mismatched ownership_returns/ownership_takes attributes. Closes #76861 Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250804
Hi,
today unix.malloc can be customized with attribute with
__attribute((ownership_returns(malloc, size_pos))
__attribute((ownership_takes(malloc, free_ptr_pos)))
But in some system there can be several allocator. I could be usefull to check that malloc_1 are free with free_1, malloc_2, free with free_2.
Also how do you model custom realloc ?
The text was updated successfully, but these errors were encountered: