Introduction

Address Sanitizer (ASan) is a valuable tool for lighting up hard-to-find memory bugs. Since the MSVC release in Visual Studio version 16.9, we’ve been working with our partners to bring ASan to the Xbox platform.

With the recent release of the June Xbox GDK, we are happy to announce Address Sanitizer is available in “early release” form.

In this blog post, we will showcase how to get ASan working with the Xbox platform.

Building with Address Sanitizer

Setting up an Xbox project for ASan should follow the same guidelines as the PC version, with the Address Sanitizer being integrated into the usual Visual Studio debugging experience. However, there are some specific use-cases for Xbox developers that were not supported by default under ASan.

Modern games consist of highly complicated, multi-threaded code whose goal is to run as fast as possible while holding a target frame rate. This means that the code is tested frequently through development by means of an automated build and test setup. These server machines may build the code, deploy it to a console, and run the game without a debugger connection meaning that they might miss any ASan error reports shown in the debug output. Ideally, the test server could collect crash dumps from any Asan errors, but due to differences in the Xbox GDK, extra steps must be taken to extract Address Sanitizer crash dump information from automated runs.

Enhanced Debugger Support

MSVC’s ASan implementation can create a crash dump with detailed exception information, but this could only be enabled from an environment variable which isn’t supported on Xbox. To get crash dumps on Xbox, developers must specify a function in their code to supply the dump filename.

#c++ #address sanitizer #debugging #dump #memory #xbox

Address Sanitizer Now in “Early Release” for Xbox Developers
1.15 GEEK