File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -155,3 +155,21 @@ The default compiler optimisation level is -Os, or -Og if `DEBUG=1` is set.
155155Setting the variable ` COPT ` will explicitly set the optimisation level. For
156156example ` make [other arguments] COPT=-O0 DEBUG=1 ` will build a binary with no
157157optimisations, assertions enabled, and debug symbols.
158+
159+ ### Sanitizers
160+
161+ Sanitizers are extra runtime checks supported by gcc and clang. The CI process
162+ supports building with the "undefined behavior" (UBSan) or "address" (ASan)
163+ sanitizers. The script ` tools/ci.sh ` is the source of truth about how to build
164+ and run in these modes.
165+
166+ Several classes of checks are disabled via compiler flags:
167+
168+ * In the undefined behavior sanitizer, checks based on the presence of the
169+ ` non_null ` attribute are disabled because the code makes technically incorrect
170+ calls like ` memset(NULL, 0, 0) ` . A future C standard is likely to permit such
171+ calls.
172+ * In the address sanitizer, ` detect_stack_use_after_return ` is disabled. This
173+ check is intended to make sure locals in a "returned from" stack frame are not
174+ used. However, this mode interferes with various assumptions that
175+ MicroPython's stack checking, NLR, and GC rely on.
You can’t perform that action at this time.
0 commit comments