File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
doc/manual/source/development Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,19 @@ It is also possible to build without debugging for faster build:
2424
2525(The first line is needed because ` fortify ` hardening requires at least some optimization.)
2626
27+ ## Building Nix with sanitizers
28+
29+ Nix can be built with [ Address] ( https://clang.llvm.org/docs/AddressSanitizer.html ) and
30+ [ UB] ( https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html ) sanitizers using LLVM
31+ or GCC. This is useful when debugging memory corruption issues.
32+
33+ ``` console
34+ [nix-shell]$ export mesonBuildType=debugoptimized
35+ [nix-shell]$ appendToVar mesonFlags "-Dlibexpr:gc=disabled" # Disable Boehm
36+ [nix-shell]$ appendToVar mesonFlags "-Dbindings=false" # Disable nix-perl
37+ [nix-shell]$ appendToVar mesonFlags "-Db_sanitize=address,undefined"
38+ ```
39+
2740## Debugging the Nix Binary
2841
2942Obtain your preferred debugger within the development shell:
You can’t perform that action at this time.
0 commit comments