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

ASAN 与 内存池结合的问题 #380

Open
hnwyllmm opened this issue Apr 18, 2024 · 0 comments
Open

ASAN 与 内存池结合的问题 #380

hnwyllmm opened this issue Apr 18, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Needs help from a contributor

Comments

@hnwyllmm
Copy link
Collaborator

hnwyllmm commented Apr 18, 2024

Enhancement
ASAN可以非常方便的帮我们发现并排查很多内存泄露、越界等问题。但是当我们使用了内存池,ASAN无法识别一个对象的边界,此时如果出现内存越界,ASAN 无法发现问题。
需要找到使用内存池也能使用ASAN发现问题的方法。

当前的内存池实现是mem_pool.h,BPFrameManager 使用了内存池。

测试:可以写一个单测来模拟mem_pool越界行为,看是否能够暴露出问题。

一些参考资料:
代码库:https://github.com/google/sanitizers
ASAN的介绍文档:https://github.com/google/sanitizers/wiki/AddressSanitizer 附近会有一些相关内容
AddressSanitizerManualPoisoning
Manual Memory Poisoning with ASAN
Memory pool should be manually poisoned so that ASAN works with it 看起来参考这个文档,在申请内存和释放内存的时候,执行asan的posion和unposion接口就可以。

memorypool: fixed: unpoison memory for ASAN befor

@hnwyllmm hnwyllmm added enhancement New feature or request help wanted Needs help from a contributor labels Apr 18, 2024
@hnwyllmm hnwyllmm added the good first issue Good for newcomers label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Needs help from a contributor
Projects
None yet
Development

No branches or pull requests

1 participant