Skip to content

Demo project demonstrating missing Xcode Address Sanitizer support in buildbuddy-io/rules_xcodeproj Xcode projects.

Notifications You must be signed in to change notification settings

tinder-cwybranowski/xcode-runtime-sanitizer-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xcode Runtime Sanitizer Demo

This project demonstrates an issue in buildbuddy-io/rules_xcodeproj whereby the Xcode Address Sanitizer feature does not seem to work as expected in BwB (Build-with-Bazel) mode. As described below, a buildbuddy-io/rules_xcodeproj Xcode project is compared to a yonaskolb/XcodeGen Xcode project to understand how a vanilla Xcode project behaves.

This project was created to add context and reproduction steps to the GitHub Issue opened here.

Configuration

These results were validated using the following configuration:

  • Host machine:
    • 16-inch MacBook Pro (2021)
    • Apple M1 Max
    • 32 GB memory
    • macOS 12.6 (Monterey)
  • Dependecies:
    • Xcode: 14.0.1
    • Bazel: 6.0.0
    • buildbuddy-io/rules_xcodeproj: 0.12.0

Setup

The Makefile contains two commands to demonstrate the issue:

Bazel Project

The following command produces a buildbuddy-io/rules_xcodeproj Xcode project:

make bazel_project

XcodeGen Project

The following command produces a yonaskolb/XcodeGen Xcode project:

make xcodegen_project

Issue

After performing the following steps:

  • make bazel_project
  • Enable Address Sanitizer via Product > Scheme > Edit Scheme > Run > Diagnostics > Address Sanitizer
  • Run App target
  • Tap Trigger Address Sanitizer button

We see that the Address Sanitizer does not work as expected in the buildbuddy-io/rules_xcodeproj project.

Expected Outcome

Application execution is halted, and a call-stack identifying the runtime issue is provided.

Screen Shot 2023-01-19 at 4 24 35 PM

Actual Outcome

Application execution continues without any halts or crashes.

Screen Shot 2023-01-19 at 4 26 22 PM

Notes

  • As confirmed here, Address Sanitizer works as expected in BwX mode (Build-with-Xcode).
  • As confirmed here, Address Sanitizer works as expected for a Swift implementation in BwB mode (Build-with-Bazel).
  • As confirmed here, Address Sanitizer works as expected for a different Objective-C implementation in BwB mode (Build-with-Bazel).

About

Demo project demonstrating missing Xcode Address Sanitizer support in buildbuddy-io/rules_xcodeproj Xcode projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published