首页 > 解决方案 > jetson nano 上的 valgrind 错误 m_execontext.c:411 (record_ExeContext_wrk2)

问题描述

我正在尝试使用 valgrind 跟踪我的 nvidia jetson nano 上的内存消耗,但我得到:

stiv@nano:~/jsoft/dgpu_core$ valgrind --tool=massif ./build/dgpu_core
==8379== Massif, a heap profiler
==8379== Copyright (C) 2003-2017, and GNU GPL'd, by Nicholas Nethercote
==8379== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==8379== Command: ./build/dgpu_core
==8379==

valgrind: m_execontext.c:411 (record_ExeContext_wrk2): Assertion 'n_ips >= 1 && n_ips <= VG_(clo_backtrace_size)' failed.

host stacktrace:
==8379==    at 0x5800A0A8: ??? (in /usr/lib/valgrind/massif-arm64-linux)

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable (lwpid 8379)
==8379==    at 0x4842E9C: malloc (in /usr/lib/valgrind/vgpreload_massif-arm64-linux.so)


Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.

If that doesn't help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what OS and version you are using.  Thanks.

这是什么意思?有一些已知的方法可以解决这个问题吗?

标签: ubuntuvalgrindnvidia-jetson

解决方案


您的问题是 Valgrind 看到的堆栈深度超出了预期的范围。

我的建议是

  1. 在使用其他 Valgrind 工具之前,请始终确保您的应用程序使用 memcheck 运行干净。
  2. 使用最新版本的 Valgrind(在 2020 年 7 月撰写本文时为 3.16.1)。

推荐阅读