我正在尝试检查我在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).
Valgrind可能与最新的macOS(10.14 Mojave)不兼容。请检查一下:How to install Valgrind on macOS Mojave(10.14) with Homebrew?