2

システムで常に実行される ASAN 計装「デーモン」プロセスがあります。メモリ リークが報告されるのは、プロセスが終了したときのみです。プロセスを強制終了せずに LSAN にリーク レポートをダンプするように依頼する方法はありますか? リークを検出してダンプするために、プロセスに送信できる信号はありますか?

4

1 に答える 1

1

__lsan_do_leak_checkを使用します。

  // 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.
于 2020-03-11T02:52:37.587 に答える