cockroachdb / cockroachdb/cockroach

build: allow for building with asan / msan

Open
#97,246 6 comments 0 reactions 0 assignees View on GitHub
A-build-system A-storage C-enhancement
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Is your feature request related to a problem? Please describe.**

Memory and address sanitization is useful for identifying subtle issues that manifest only at runtime. The Go runtime supports both via the `-msan` and `-asan` build flags.

**Describe the solution you'd like**

Consider adding support for building Cockroach binaries with these features enabled. This will require some changes to the build system in order to support.

Given there is a performance penalty for running with these runtime features enabled, production binaries _should not_ be built with `-msan` / `-asan`. Instead, we could consider offering a debug binary and container image. Short of this, we already have the ability to produce one-off builds via TeamCity. The existing pipelines should have some way of enabling ASAN / MSAN in the resultant artifacts.

**Additional context**

More context can be found in this issue ([internal](https://github.com/cockroachlabs/support/issues/2063)) that possibly could have benefited from having address and memory sanitization, in order to narrow down the cause of some memory corruption encountered in the wild.

Jira issue: CRDB-24594

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.