小编Lao*_*haw的帖子

valgrind asan 运行时不在初始库列表中排在第一位

我使用 GCC 10 标志构建-fsanitize=address并且可以很好地运行程序,但是如果我在 Valgrind 下运行它会显示 Asan 错误:

==477229== Memcheck, a memory error detector
==477229== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==477229== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==477229== Command: ./a.out
==477229== 
==477229==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
==477229== 
==477229== HEAP SUMMARY:
==477229==     in use at exit: 0 bytes in 0 …
Run Code Online (Sandbox Code Playgroud)

c gcc valgrind

6
推荐指数
1
解决办法
1259
查看次数

标签 统计

c ×1

gcc ×1

valgrind ×1