{"id":35494,"date":"2025-05-27T20:04:30","date_gmt":"2025-05-27T20:04:30","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=35494"},"modified":"2025-05-27T22:10:33","modified_gmt":"2025-05-27T22:10:33","slug":"address-sanitizer-updates-for-visual-studio-2022-17-14","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/address-sanitizer-updates-for-visual-studio-2022-17-14\/","title":{"rendered":"Address Sanitizer Updates for Visual Studio 2022 Version 17.14"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>It has been an exciting few months for the <a href=\"https:\/\/learn.microsoft.com\/cpp\/sanitizers\/asan?view=msvc-170\">Address Sanitizer<\/a> (ASan) since our last update. In addition to our continuous focus on quality and correctness, our internal \u201cdogfooding\u201d (i.e. internal adoption) effort has reached several important milestones.<\/p>\n<p>In this update, I want to go over some of the quality improvements since <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/msvc-address-sanitizer-updates-in-visual-studio-2022-version-17-13\/\">Visual Studio 2022 version 17.13<\/a><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/msvc-address-sanitizer-updates-in-visual-studio-2022-version-17-13\/\">,<\/a> and to give a peek into how ASan is now protecting our C++ toolset against memory safety errors during development.<\/p>\n<h2>Some improvements in Visual Studio 2022 version 17.14<\/h2>\n<ul>\n<li>We increased the number of ASan flags that can be set through <code>__asan_default_options<\/code>, the alternative to the environment variable <code>ASAN_OPTIONS<\/code>. This was an adoption blocker for apps that, for security reasons, can\u2019t access the environment during execution.<\/li>\n<li>For <a href=\"https:\/\/developer.microsoft.com\/games\/articles\/2021\/07\/address-sanitizer-now-available-for-xbox-developers\/\">Xbox developers<\/a>, we now have automated testing ensuring that ASan\u2019s dependencies are compatible with the Xbox OS. This is important since we now integrate changes from upstream LLVM on a weekly basis, meaning that we need to actively guard against Xbox-incompatible changes.<\/li>\n<li>We fixed a <a href=\"https:\/\/developercommunity.visualstudio.com\/t\/Access-violation-call-stack-not-fully-di\/10827640\">regression<\/a> that corrupted the callstack displayed during error reporting in x64.<\/li>\n<li>Improved stability by removing the lazy loading of <code>DbgHelp<\/code> symbolization helpers, minimizing loader lock contention.<\/li>\n<li><a href=\"https:\/\/github.com\/microsoft\/STL\/pull\/5241\">In the STL<\/a>, we now allow ASan container annotations to be disabled on a per-allocator basis. This allows users to control container poisoning, which is useful when custom allocators (e.g. arenas) are in use.<\/li>\n<\/ul>\n<p>This release also contains several other improvements, many of which were contributed by the ASan open-source community in the <a href=\"https:\/\/github.com\/llvm\/llvm-project\">LLVM repo<\/a>. By contributing to LLVM upstream, you are also contributing to MSVC\u2019s ASan. We thank the entire LLVM ASan community for their efforts, and plan to continue contributing our improvements upstream as well.<\/p>\n<h2>Protecting the C++ toolchain<\/h2>\n<p>To protect the toolchain against memory safety errors, all PRs made against the MSVC toolset and libraries now need to pass ASan instrumentation tests. These are tests where the compiler itself is instrumented with ASan to catch memory safety violations while executing our compiler test suite.<\/p>\n<p>To be clear, this is different from compiling test programs with ASan, i.e. having the compiler run <code>\/fsanitize=address<\/code> on some <code>.cpp<\/code> file. Instead, the compiler itself is built with <code>\/fsanitize=address<\/code> before executing its test matrix so that ASan may monitor allocations during compilation.<\/p>\n<p>Through this process, we have learned a lot about how to adopt ASan in a large and historied codebase like MSVC and it\u2019s helped us drive several improvements in both the toolset as well as in ASan itself, so we\u2019re excited about the quality improvement cycle that dogfooding ASan within MSVC unlocks for us.<\/p>\n<h2>Let\u2019s harden our C++ code together!<\/h2>\n<p>The ASan team is proud to help you secure your C++ applications, and we would love to hear from you. If you\u2019re not using it already, download Visual Studio and give the Address Sanitizer a try. We can be reached out through the comments below and through our official support channels: <a href=\"https:\/\/developercommunity.visualstudio.com\/cpp\">Developer Community<\/a> or through Visual Studio by clicking <a href=\"https:\/\/learn.microsoft.com\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio?view=vs-2022\">Help &gt; Send Feedback &gt; Report A Problem \/ Provide a suggestion in the product.<\/a><\/p>\n<p>Until next time!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction It has been an exciting few months for the Address Sanitizer (ASan) since our last update. In addition to our continuous focus on quality and correctness, our internal \u201cdogfooding\u201d (i.e. internal adoption) effort has reached several important milestones. In this update, I want to go over some of the quality improvements since Visual Studio [&hellip;]<\/p>\n","protected":false},"author":182306,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,1],"tags":[],"class_list":["post-35494","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-cplusplus"],"acf":[],"blog_post_summary":"<p>Introduction It has been an exciting few months for the Address Sanitizer (ASan) since our last update. In addition to our continuous focus on quality and correctness, our internal \u201cdogfooding\u201d (i.e. internal adoption) effort has reached several important milestones. In this update, I want to go over some of the quality improvements since Visual Studio [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/35494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/182306"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=35494"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/35494\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=35494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=35494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=35494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}