- Buffer overflow
- Use After free:
For example, return a pointer on a stack.
- Memory leak:
- Double free
- Free unallocated memory
free string;
- Heap overflow
strncpy(p,mystr,MAX_LENGTH)
use mcheck and mprobe MALLOC_CHECK_
- Race condition
count++;
(1) Read into register
(2) increase to one
(3) write back the new value into memory
- Deadlock
- Compiler optimization
memory barrier
asm volatile ("" : : : "memory")
write back all the data from register back to the memory.
- CPU optimization
- Signal Handler
- Tips for troubleshooting
(bash) logger -p err "test"
syslog()
change syslog level by modify the /etc/syslog.conf
disable assert() using NDEBUG
Function to print backtrace
#include
int backtrace(int **buffer, int size)
POSIX threads trace toolkit
use ar to create static library and ln to create a dynamic library
No comments:
Post a Comment