摘要
针对可执行文件的动态内存管理容易产生的错误,设计并实现了一个Linux平台下针对C/C++语言的动态内存检测模块DDMEM,使用自定义的ddmemMalloc()函数改写动态分配函数malloc(),实现了一个共享库ddmem.so,可以检测内存泄漏、内存写溢出、释放野指针和内存管理函数的不匹配等问题。给出了函数不匹配的实例检测以验证方法的有效性。并与同类有代表性的检测工具memwatch进行了性能比较,证明该检测模块比memwatch整体更优。
A dynamic memory detection module DDMEM for C/C++ languages on Linux platform is designed to solve the errors of dynamic memory management. The malloc() dynamic distribution function is replaced by customized ddmemMalloc(). And a share library DDMEM is achieved. The module can detect memory leak, write overflow, free wild pointer and mismatch using of memory functions of the executable files. Finally, an instance to test functions mismatch and comparing between the DDMEM and a representational test tool Memwatch is carded to validate the effectiveness of method and module.
出处
《计算机工程》
CAS
CSCD
北大核心
2007年第1期74-76,79,共4页
Computer Engineering
基金
国家"863"计划基金资助项目(2003AA1Z2610)
关键词
动态内存检测
函数不匹配
内存泄漏
写溢出
野指针
Dynamic memory check
Functions mismatch
Memory leak
Write overflow
Wild pointer