我正在尝试用C语言编写的程序检查内存泄漏。我正在运行MacOS Mojave。当我运行valgrind时,出现此错误:
$ valgrind --leak-check=full --show-reachable=yes ./shell.out
valgrind: mmap-FIXED(0x0, 520192) failed in UME (load_segment1) with error 12 (Cannot allocate memory).
答案 0 :(得分:0)
Valgrind可能与最新的macOS(10.14 Mojave)不兼容。 请检查:How to install Valgrind on macOS Mojave(10.14) with Homebrew?