Build with ASAN #359
shamefulCake1
started this conversation in
1 New Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the idea
ASAN is a GCC/CLANG feature which is testing a program for memory errors and leaks. It is mostly just two compiler switches and two linker switches, plus a bit of fiddling with report files.
Fundamentally, it is maintaining a copy of a program's memory, so memory consumption grows twice, and speed usually falls twice, but on modern hardware this is usually imperceptible, and in this sense it is MUCH more convenient than the previous generation of dynamic memory analysers, such as valgrind. In fact, it is so fast that certain Android smartphone OEMs build their production Android systems with ASAN enabled and sell them like this.
ASAN is routinely used with Chrome CI.
It should be done because
C is powerful, fast, but dangerous language, having ASAN enabled at least on debug builds/CI would bring it on par in memory safety to a lot of modern "fancy" programming languages, without sacrificing the versatility and speed of C.
In addition, it is good at indicating "bad architecture" pieces of software, because those are naturally prone to memory errors.
What are the alternatives?
Additional context
Clang supports ASAN better than GCC, but GCC, especially in recent versions, can do it too.
Implementing this proposal should be quite easy, no specific physics, biology, software trickery knowledge required.
It would perform best with having a CI implemented.
Extra fields
Beta Was this translation helpful? Give feedback.
All reactions