Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
缓冲区溢出导致 gdb 以一种不稳定的方式运行,并且没有打印正确的日志。如何使gdb以正确的方式打印日志?
另外,有没有办法在多线程环境中检测运行时堆栈粉碎?
搜索-lmcheck但它不是线程安全的。
-lmcheck
如果您使用gcc,您可以尝试将选项-fstack-overflow与valgrind工具结合使用。
gcc
-fstack-overflow
valgrind