Sanitizers are a relatively recent trend in software engineering. They aim at automatically finding bugs in programs, and they are now commonly available to programmers as part of compiler toolchains. For example, the LLVM project includes out-of-the-box sanitizers to detect thread safety (tsan), memory (asan,msan,lsan), or undefined behaviour (ubsan) bugs. In this article, we present nsan, a new sanitizer for locating and debugging floating-point numerical issues, implemented inside the LLVM sanitizer framework. nsan puts emphasis on practicality. It aims at providing precise, and actionable feedback, in a timely manner. nsan uses compile-time instrumentation to augment each floating-point computation in the program with a higher-precision shadow which is checked for consistency during program execution. This makes nsan between 1 and 4 orders of magnitude faster than existing approaches, which allows running it routinely as part of unit tests, or detecting issues in large production applications.
翻译:清洁剂是软件工程中较近期的趋势。 它们的目标是自动发现程序中的错误, 现在程序员通常可以使用它们作为编译工具链的一部分。 例如, LLVM 项目包括了箱外消毒剂以检测线条安全( 桑)、 内存( san, msan, lsan) 或未定义的行为( ubsan) 错误。 在文章中, 我们展示了 Nsan, 用于定位和调试浮点数字问题的新清洁剂, 在 LLLVM 防污剂框架内实施。 nsan 强调了实用性。 它旨在及时提供准确和可操作的反馈。 nsan 使用编译时间仪器来增强程序中的每个浮点计算, 其光谱阴影在程序执行过程中要检查是否一致。 这使得 nsan 1 至 4 级的量级比现有方法更快, 从而可以作为单位测试的一部分例行运行, 或者在大型生产应用程序中探测问题 。