Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build with Address Sanitizer enabled #4653

Closed
charmingtoad opened this issue Dec 11, 2015 · 8 comments
Closed

Can't build with Address Sanitizer enabled #4653

charmingtoad opened this issue Dec 11, 2015 · 8 comments
Labels
s1:awaiting input Waiting for input from the original author t1:enhancement Enhancements that have not been picked up yet. Please comment if you plan to work on it

Comments

@charmingtoad
Copy link

I'm having the same issue as #4586. The resolution there was to turn off the address sanitizer, but it's a tool for debugging that I'd like to be able to use.

If I make a new project in Xcode, it builds with the address sanitizer enabled.

(To turn on the address sanitizer, go to "Edit Scheme" and check the box for "Enable Address Sanitizer".)

screen shot 2015-12-11 at 1 53 59 pm

screen shot 2015-12-11 at 1 54 28 pm

Once I add CocoaPods to the project (following the guide here: https://guides.cocoapods.org/using/using-cocoapods.html) the project no longer builds with address sanitizer enabled.

I get a long list of errors like this:

Undefined symbols for architecture x86_64:
  "___asan_init", referenced from:
      _asan.module_ctor in libObjectiveSugar.a(ObjectiveSugar-dummy.o)
      _asan.module_ctor in libObjectiveSugar.a(NSArray+ObjectiveSugar.o)
      _asan.module_ctor in libObjectiveSugar.a(NSDictionary+ObjectiveSugar.o)
      _asan.module_ctor in libObjectiveSugar.a(NSMutableArray+ObjectiveSugar.o)
      _asan.module_ctor in libObjectiveSugar.a(NSNumber+ObjectiveSugar.o)
      _asan.module_ctor in libObjectiveSugar.a(NSSet+ObjectiveSugar.o)
      _asan.module_ctor in libObjectiveSugar.a(NSString+ObjectiveSugar.o)

Are there any steps I can follow to fix this?

@neonichu
Copy link
Member

I'm guessing you have to ensure that all Pods are also build using the address sanitiser.

@charmingtoad
Copy link
Author

I tried editing the scheme for Pods and for ObjectiveSugar in my test project and turning on the address sanitizer for both of them, but I still get the same build errors for the main project. Anything else I might try?

@neonichu
Copy link
Member

Editing those schemes won't do anything, because you're not utilising them for the build. You have to dig up the right compiler settings and apply them to the other targets.

@fotiDim
Copy link

fotiDim commented Jan 9, 2016

The issue happens for me too

@marchy
Copy link

marchy commented Mar 10, 2016

Anyone figure this out?

@deemadden
Copy link

Looking for an answer on this one also. I'm seeing the same problem.

@mrackwitz mrackwitz added the t1:enhancement Enhancements that have not been picked up yet. Please comment if you plan to work on it label May 11, 2016
@RomanVolkov
Copy link

Still exists...

@stale stale bot added the s1:awaiting input Waiting for input from the original author label May 24, 2017
@stale stale bot closed this as completed Jul 13, 2017
@stale
Copy link

stale bot commented Jul 13, 2017

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s1:awaiting input Waiting for input from the original author t1:enhancement Enhancements that have not been picked up yet. Please comment if you plan to work on it
Projects
None yet
Development

No branches or pull requests

7 participants