Memory leaks 如何启用LSAN在运行时检测内存泄漏,而不是等到进程结束
我有一个ASAN指令化的“deamon”进程,它总是在我的系统中运行。我看到只有当进程退出时才会报告内存泄漏。我是否可以要求LSAN在不中断流程的情况下转储泄漏报告?是否有任何信号可以发送到process,以便它检测并转储泄漏?使用:Memory leaks 如何启用LSAN在运行时检测内存泄漏,而不是等到进程结束,memory-leaks,clang,address-sanitizer,leak-sanitizer,Memory Leaks,Clang,Address Sanitizer,Leak Sanitizer,我有一个ASAN指令化的“deamon”进程,它总是在我的系统中运行。我看到只有当进程退出时才会报告内存泄漏。我是否可以要求LSAN在不中断流程的情况下转储泄漏报告?是否有任何信号可以发送到process,以便它检测并转储泄漏?使用: // Check for leaks now. This function behaves identically to the default // end-of-process leak check. In particular, it will te
// Check for leaks now. This function behaves identically to the default
// end-of-process leak check. In particular, it will terminate the process if
// leaks are found and the exitcode runtime flag is non-zero.
// Subsequent calls to this function will have no effect and end-of-process
// leak check will not run. Effectively, end-of-process leak check is moved to
// the time of first invocation of this function.
// By calling this function early during process shutdown, you can instruct
// LSan to ignore shutdown-only leaks which happen later on.