You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm always frustrated when debugging subtle and hard-to-diagnose issues in Nix due to undefined behavior and memory errors in the C++ codebase. These errors can cause unpredictable behavior and are difficult to trace and fix.
Describe the solution you'd like
I would like the Nix build process to include C++ sanitizers such as AddressSanitizer, UndefinedBehaviorSanitizer, and ThreadSanitizer. Enabling these sanitizers during the build can help detect and report errors related to memory usage, undefined behavior, and threading issues, making the code more robust and easier to maintain.
Describe alternatives you've considered
Running sanitizers manually on specific tests and components, but this is not as thorough or automated as including them in the build process.
Relying on static analysis tools, which are helpful but do not catch all runtime issues that sanitizers can detect.
Incorporating sanitizers only in a separate debugging build configuration, but this would still require additional maintenance and might be overlooked.
Additional context
Including sanitizers in the build process can be controlled via build options or environment variables, ensuring they are only enabled during development and testing phases, not in production builds. This would allow developers to benefit from the enhanced error detection without affecting production performance.
it does. there's a couple of flags you need to get UBSan to work properly on clang however, see lix meson.build. ASan is likely impossible without getting rid of Boost coroutines because even if you do the stuff they claim to make it work, the memory crimes it does still cause ASan to crash.
I've nonetheless found actual bugs with ASan outside of the region using boost coroutines, it's just there's false positives I've not managed to mark as ignored.
Another thing Lix did that you could absolutely take is the fact that our production builds ban signed overflow completely at no measurable performance cost. See our meson.build for that as well.
it does. there's a couple of flags you need to get UBSan to work properly on clang however, see lix meson.build
OK We'll look!
ASan is likely impossible without getting rid of Boost coroutines because even if you do the stuff they claim to make it work, the memory crimes it does still cause ASan to crash.
Certainly a good reason to reconsider using them! (I am also apprehensive how they will behave on Windows. Or with "anti virus" software.)
Another thing Lix did that you could absolutely take is the fact that our production builds ban signed overflow completely at no measurable performance cost. See our meson.build for that as well.
Is your feature request related to a problem? Please describe.
I'm always frustrated when debugging subtle and hard-to-diagnose issues in Nix due to undefined behavior and memory errors in the C++ codebase. These errors can cause unpredictable behavior and are difficult to trace and fix.
Describe the solution you'd like
I would like the Nix build process to include C++ sanitizers such as AddressSanitizer, UndefinedBehaviorSanitizer, and ThreadSanitizer. Enabling these sanitizers during the build can help detect and report errors related to memory usage, undefined behavior, and threading issues, making the code more robust and easier to maintain.
Describe alternatives you've considered
Additional context
Including sanitizers in the build process can be controlled via build options or environment variables, ensuring they are only enabled during development and testing phases, not in production builds. This would allow developers to benefit from the enhanced error detection without affecting production performance.
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: