在编译时加入-fsanitize=address来进行内存错误检测
-fsanitize=address
AddressSanitizer
Address Sanitizer 用法
原文:https://www.cnblogs.com/GavinZheng/p/12127924.html