[compiler-rt] [asan] Switch allocator to dynamic base address (PR #98511)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 07:41:43 PDT 2024


zmodem wrote:

We're seeing a test failure on Mac that started right around this change, see https://crbug.com/360160858#comment6 Does that make any sense to you?

```
 FAIL: LeakSanitizer-AddressSanitizer-x86_64 :: TestCases/Darwin/trampoline.mm (75525 of 80517)
 ******************** TEST 'LeakSanitizer-AddressSanitizer-x86_64 :: TestCases/Darwin/trampoline.mm' FAILED ********************
 Exit Code: 1
 
 Command Output (stdout):
 --
 
 =================================================================
 ==78889==ERROR: LeakSanitizer: detected memory leaks
 
 Direct leak of 64 byte(s) in 1 object(s) allocated from:
     #0 0x0001090c8287 in calloc+0x87 (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x55287)
     #1 0x7ff803b8bd73 in _dispatch_continuation_alloc_from_heap+0x47 (libdispatch.dylib:x86_64+0x30d73)
     #2 0x7ff803b6ec88 in _dispatch_apply_with_attr_f+0x459 (libdispatch.dylib:x86_64+0x13c88)
     #3 0x7ff803b6eeae in dispatch_apply+0x2c (libdispatch.dylib:x86_64+0x13eae)
     #4 0x7ff803efb0f1 in __103-[CFPrefsSearchListSource synchronouslySendSystemMessage:andUserMessage:andDirectMessage:replyHandler:]_block_invoke.75+0x60 (CoreFoundation:x86_64h+0x19b0f1)
     #5 0x7ff803d931c2 in CFPREFERENCES_IS_WAITING_FOR_SYSTEM_AND_USER_CFPREFSDS+0x48 (CoreFoundation:x86_64h+0x331c2)
     #6 0x7ff803efa4bb in -[CFPrefsSearchListSource synchronouslySendSystemMessage:andUserMessage:andDirectMessage:replyHandler:]+0xb7 (CoreFoundation:x86_64h+0x19a4bb)
     #7 0x7ff803d91604 in -[CFPrefsSearchListSource alreadylocked_generationCountFromListOfSources:count:]+0xd9 (CoreFoundation:x86_64h+0x31604)
     #8 0x7ff803d9132d in -[CFPrefsSearchListSource alreadylocked_getDictionary:]+0x196 (CoreFoundation:x86_64h+0x3132d)
     #9 0x7ff803d90ed9 in -[CFPrefsSearchListSource alreadylocked_copyValueForKey:]+0x95 (CoreFoundation:x86_64h+0x30ed9)
     #10 0x7ff803d90e27 in -[CFPrefsSource copyValueForKey:]+0x2e (CoreFoundation:x86_64h+0x30e27)
     #11 0x7ff803d90ddf in __76-[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:]_block_invoke+0x1f (CoreFoundation:x86_64h+0x30ddf)
     #12 0x7ff803d89a39 in __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke+0x167 (CoreFoundation:x86_64h+0x29a39)
     #13 0x7ff803efb86f in -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:]+0x15c (CoreFoundation:x86_64h+0x19b86f)
     #14 0x7ff803d89471 in -[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:]+0x7b (CoreFoundation:x86_64h+0x29471)
     #15 0x7ff803d893b7 in _CFPreferencesCopyAppValueWithContainerAndConfiguration+0x64 (CoreFoundation:x86_64h+0x293b7)
     #16 0x7ff803da157b in _CFPreferencesGetAppBooleanValueWithContainer+0x10 (CoreFoundation:x86_64h+0x4157b)
     #17 0x7ff804d37e6f in -[NSUserDefaults(NSUserDefaults) boolForKey:]+0x5f (Foundation:x86_64+0x8e6f)
     #18 0x7ff80740fff0 in NSViewDebugInitializeMetricsOverlayDebugging+0x3b (AppKit:x86_64+0xcff0)
     #19 0x7ff80740fdbf in +[NSView initialize]+0x3e (AppKit:x86_64+0xcdbf)
     #20 0x7ff80393322b in CALLING_SOME_+initialize_METHOD+0x10 (libobjc.A.dylib:x86_64h+0x822b)
     #21 0x7ff803932f6a in initializeNonMetaClass+0x1fe (libobjc.A.dylib:x86_64h+0x7f6a)
     #22 0x7ff803949434 in initializeAndMaybeRelock(objc_class*, objc_object*, locker_mixin<lockdebug::lock_mixin<objc_lock_base_t>>&, bool)+0xe6 (libobjc.A.dylib:x86_64h+0x1e434)
     #23 0x7ff803932aa9 in lookUpImpOrForward+0x312 (libobjc.A.dylib:x86_64h+0x7aa9)
     #24 0x7ff8039321da in _objc_msgSend_uncached+0x4a (libobjc.A.dylib:x86_64h+0x71da)
     #25 0x0001088fcd5a in main trampoline.mm:14
     #26 0x7ff803973365 in start+0x795 (dyld:x86_64+0xfffffffffff5c365)
 
 Objects leaked above:
 0x006109f038c0 (64 bytes)
 
 SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s).
 
 --
 Command Output (stderr):
 --
 RUN: at line 5: /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/./bin/clang  --driver-mode=g++ -O0  -arch x86_64 -stdlib=libc++ -mmacosx-version-min=10.12 -isysroot /Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -mlinker-version=1053.12  -gline-tables-only -fsanitize=address -I/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/lsan/../ /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/lsan/TestCases/Darwin/trampoline.mm  -o /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/runtimes/runtimes-bins/compiler-rt/test/lsan/X86_64AsanConfig/TestCases/Darwin/Output/trampoline.mm.tmp -framework Cocoa -fno-objc-arc
 + /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/./bin/clang --driver-mode=g++ -O0 -arch x86_64 -stdlib=libc++ -mmacosx-version-min=10.12 -isysroot /Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -mlinker-version=1053.12 -gline-tables-only -fsanitize=address -I/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/lsan/../ /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/lsan/TestCases/Darwin/trampoline.mm -o /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/runtimes/runtimes-bins/compiler-rt/test/lsan/X86_64AsanConfig/TestCases/Darwin/Output/trampoline.mm.tmp -framework Cocoa -fno-objc-arc
 RUN: at line 6: env LSAN_OPTIONS=abort_on_error=0:log_to_syslog=0:detect_leaks=1:abort_on_error=0:log_to_syslog=0:"report_objects=1"  /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/runtimes/runtimes-bins/compiler-rt/test/lsan/X86_64AsanConfig/TestCases/Darwin/Output/trampoline.mm.tmp 2>&1  && echo "" | FileCheck /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/lsan/TestCases/Darwin/trampoline.mm
 + env LSAN_OPTIONS=abort_on_error=0:log_to_syslog=0:detect_leaks=1:abort_on_error=0:log_to_syslog=0:report_objects=1 /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/runtimes/runtimes-bins/compiler-rt/test/lsan/X86_64AsanConfig/TestCases/Darwin/Output/trampoline.mm.tmp
 
 --
```

https://github.com/llvm/llvm-project/pull/98511


More information about the llvm-commits mailing list