4 ms·
It's unfortunate that so many of these great tools (like `perf` and I believe `valgrind`) are basically not available locally on the Mac. And running in a cont
by whimsicalism 4y ago
It's unfortunate that so many of these great tools (like `perf` and I believe `valgrind`) are basically not available locally on the Mac.
And running in a container is not really a solution for most of these.
- wyldfire 4y agoSanitizers and electric fence are ultra portable, they're definitely available on macos. The feature set from valgrind is a bit richer but not by much.
- whimsicalism 4y agoI am not familiar with electric fence but I remember from my experience that there are definitely important things that I got from `perf` and `valgrind` that the alternative sanitizers did not provide. Can't recall what now of course.
- nyanpasu64 4y agoasan/ubsan do not detect uninitialized memory reads (though ubsan can detect when bools take on invalid bit patterns from uninitialized memory), and msan requires rebuilding the standard library or something, so I've never used msan. Valgrind is slow, but detects uninitialized memory reads properly, and doesn't require rebuilding the app (which is useful when running a complex or prebuilt app for short periods of time). On the topic of profiling, callgrind can count exact function calls and generate accurate call graphs, which I find useful for not only profiling, but tracing the execution of unfamiliary code. I just wish rr had similarly fast tooling (pernosco is close enough to be useful, but I think there's value in exploring different workflows than what they picked).
- 1over137 4y ago>msan requires rebuilding the standard library or something Yes, which is a PITA. But even then, macOS is not supported anyway: https://clang.llvm.org/docs/MemorySanitizer.html#supported-platforms https://clang.llvm.org/docs/MemorySanitizer.html#supported-p...
- dwroberts 4y agoValgrind does a lot of low level trickery so it hasn’t always supported the latest macOS releases straight away (or sometimes would support them with serious gotchas/limitations)
- glandium 4y agovalgrind is available on mac. From the homepage: "It runs on the following platforms: (...) X86/Darwin and AMD64/Darwin (Mac OS X 10.12).". There's a notable omission of ARM64/Darwin in there, and I don't think it's an oversight. What Mac is definitely lacking, though, is reverse debugging. Linux has rr, Windows has Time Travel Debugging. macOS still doesn't have an equivalent.
- saagarjha 4y agoValgrind, as I understand it, was essentially maintained by one engineer at Apple who has since left the company, so nobody has really updated it.
- 1over137 4y agoThat's my understanding too, and I believe you're referring Greg Parker: http://www.sealiesoftware.com/valgrind/ http://www.sealiesoftware.com/valgrind/
- plorkyeran 4y agoHe's still at Apple, but he works on the Swift runtime these days rather than C/C++ tooling.
- 1over137 4y agoThere have been 6 major releases since 10.12 (which was from late 2016). In other words, valgrind has basically stopped supporting macOS.