Description
What are sanitizers?
Sanitizers are build options which can be used to identify programming errors in C++. They add overhead to the program, which is why it's not recommended to use in releases, but they can be valuable to find memory leaks and other potential crashes on our tests. V8 has ASAN buildbots which run on every CL, and they are working on making their code base UBSan compatible as well.
Cool, what do we need to make it happen?
Well, first thing, asan has to work on Node.js. We have --enable-asan
on configure
today, and the build will work on most computers (it requires a considerable amount of memory). But most of our tests will fail with it, because our code base is not ASAN clean. We might be also missing some ASAN flags: looking at V8 source code and build dependencies, they do one thing or two different.
There's also the memory issue: as of right now, we need a big machine to build with ASAN. GitHub Actions can't run an ASAN build because it "only" has 7Gb. Hopefully there's something we can tune in the build to use less memory. Otherwise, we'll need a custom machine for it (probably on Jenkins).
As for other sanitizers (like UBSan), upstream projects need to support those first, so we are blocked for now.
To Do List (ASAN)
- Investigate huge memory consumption during build
- Move gengjiawen/node-build to
nodejs/
org- Move repository
- Move Docker build to Node.js Docker hub
- Enable build on our CI (no tests)
- This will ensure we don't break the build moving forward
- Fix failing tests
- Once everything is working, enable tests on our CI
- Fix ASAN flags for OS X
- Fix ASASN flags for Windows
To Do List (UBSan)
- Wait for V8 to be UBSan compatible (v8:3770)
- Enable build on our CI (no tests)
- This will ensure we don't break the build moving forward
- Fix failing tests
- Once everything is working, enable tests on our CI
- Enable build on our CI (no tests)
We can list current failing tests here once we get rid of the most noisy ones.