Status: Accepted
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 360 by [email protected]: Using Obj-C blocks triggers a false-positive ODR violation
https://code.google.com/p/address-sanitizer/issues/detail?id=360

On OS X top-of-tree Clang+AddressSanitizer, the following produces a false positive ODR violation during initialization:

        void f() {
            int y = 7;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
                dispatch_sync(dispatch_get_main_queue(), ^{
                    printf("num = %d\n", y);
                });
            });
        }

        =================================================================
        ==98053==ERROR: AddressSanitizer: odr-violation (0x00010cb4ae20):
[1] size=1 'OBJC_CLASS_NAME_2' /tmp/llvm/projects/compiler-rt/test/asan/TestCases/Darwin/objc-odr.mm [2] size=1 'OBJC_CLASS_NAME_' /tmp/llvm/projects/compiler-rt/test/asan/TestCases/Darwin/objc-odr.mm
        These globals were registered at these points:
          [1]:
#0 0x10cb5989c (/tmp/llvm-cmake-debug/lib/clang/3.6.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x889c) #1 0x10cb4ac2b (/tmp/llvm-cmake-debug/projects/compiler-rt/test/asan/64bitConfig/TestCases/Darwin/Output/objc-odr.mm.tmp+0x100001c2b)
            #2 0x7fff67e5acea  (<unknown module>)
            #3 0x7fff67e5ae77  (<unknown module>)
          ...

Apparently, something changed in the way Obj-C globals are generated or instrumented. See the attached test case.


Attachments:
        objc-odr.mm  458 bytes

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to