ASAN_OPTIONS no longer settable when running tests within Xcode. (Regression)

Number:rdar://28103342 Date Originated:31-Aug-2016 11:30 PM
Status:Closed Resolved:Late 2016
Product:Developer Tools Product Version:8b6
Classification:Other Bug Reproducible:Always
Peter Steinberger31-Aug-2016 11:30 PM

I'm trying to set ASAN_OPTIONS as environment variable in Xcode based on

Specifically, I am trying to run without the new odr detection because this seems to be buggy:

>HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0

This is not passed to tests. But it works if the app is Run regularly. This is a regression from 7.3.1. Sample is attached that works on both Xcode versions.

Steps to Reproduce:
See attached sample project. Xcode correctly merges it's own ASAN settings with the settings in the environment variable when the app runs normally, but does not do that when I run tests.

I'm using following debug code to make displaying the env variables convenient:

+ (void)load {
NSLog(@"%@", NSProcessInfo.processInfo.environment);

Expected Results:
This ist the output when the app runs:

AddressSanitizer debugger support is active. Memory error breakpoint has been installed and you can now use the 'memory history' command.
2016-08-29 22:53:41.898 AsanOptionTest[98221:1438355] {
"ASAN_OPTIONS" = "abort_on_error=1:color=never:detect_odr_violation=0:asan_option_radar_test_setting=1";
"ASAN_TEST" = "asan-forwarding-works=1";

Actual Results:
This is the output when tests run:

2016-08-29 22:46:37.727 AsanOptionTest[97751:1426969] {
"ASAN_OPTIONS" = "abort_on_error=1:color=never";
"ASAN_TEST" = "asan-forwarding-works=1";

Xcode 7.3.1 and Xcode 8b6

A regular run correctly merges the default settings with custom settings - this does not happen for tests. This is a regression - it works as expected in Xcode 7.3.1.

I opened a DTS for this before because I wasn't sure it was a bug, but it was closed because Xcode is still beta software a few more days. (Number was 646910755)

Xcode 7.3.1 and Xcode 8b6

Sample available at


Fixed in Xcode 8.2


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!