• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Address Sanitizer "odr-violation" with string literals
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Address Sanitizer "odr-violation" with string literals


  • Subject: Address Sanitizer "odr-violation" with string literals
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 09 Aug 2016 11:22:08 -0700

I’ve hit a weird Address Sanitizer error in Xcode 8 beta 4. Apparently “odr-violation” means a symbol that’s been defined twice (which I would think would already be a link error, but whatever.) The strange thing is that the symbol in question is a C string literal, "\””, that simply appears inline in expressions in two source files, which are compiled into the same target.

As far as I can tell this is a false warning; anyone have any idea about it? I’ll probably set the environment variable to suppress it, and file a Radar…

—Jens

=================================================================
==98972==ERROR: AddressSanitizer: odr-violation (0x000100090cc0):
  [1] size=2 '<string literal>’ /xxx/fleece/Tests/FleeceTests.cc:31:17
  [2] size=2 '<string literal>’ /xxx/fleece/Tests/EncoderTests.cc:378:30
These globals were registered at these points:
  [1]:
    #0 0x10014191a in __asan_register_globals (libclang_rt.asan_osx_dynamic.dylib+0xc91a)
    #1 0x10002f54b in asan.module_ctor.2 (Test+0x10002f54b)
    #2 0x7fff5fc13283  (<unknown module>)
    #3 0x7fff5fc0f8bc  (<unknown module>)
    #4 0x7fff5fc0f742  (<unknown module>)
    #5 0x7fff5fc0f9b2  (<unknown module>)
    #6 0x7fff5fc020f0  (<unknown module>)
    #7 0x7fff5fc05d97  (<unknown module>)
    #8 0x7fff5fc01275  (<unknown module>)
    #9 0x7fff5fc01035  (<unknown module>)

  [2]:
    #0 0x10014191a in __asan_register_globals (libclang_rt.asan_osx_dynamic.dylib+0xc91a)
    #1 0x1000038fb in asan.module_ctor (Test+0x1000038fb)
    #2 0x7fff5fc13283  (<unknown module>)
    #3 0x7fff5fc0f8bc  (<unknown module>)
    #4 0x7fff5fc0f742  (<unknown module>)
    #5 0x7fff5fc0f9b2  (<unknown module>)
    #6 0x7fff5fc020f0  (<unknown module>)
    #7 0x7fff5fc05d97  (<unknown module>)
    #8 0x7fff5fc01275  (<unknown module>)
    #9 0x7fff5fc01035  (<unknown module>)

==98972==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global '<string literal>' at /xxx/fleece/Tests/FleeceTests.cc:31:17
==98972==ABORTING

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Address Sanitizer "odr-violation" with string literals
      • From: Chris Cleeland <email@hidden>
  • Prev by Date: Re: Can't set breakpoint on specific C++ exception class
  • Next by Date: Xcode error during diff operation
  • Previous by thread: Re: Can't set breakpoint on specific C++ exception class
  • Next by thread: Re: Address Sanitizer "odr-violation" with string literals
  • Index(es):
    • Date
    • Thread