当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - Interpretation of XCode AddressSanitizer results

问题描述:

I have recently started using the XCode AddressSanitizer, which I think was introduced in XCode 7 (see e.g. Apple WWDC presentation), to help with a difficult to find strange error. The Sanitizer actually found a problem, but I have a hard time interpreting what it means.

Do you know of an overview of the type of errors that AddressSanitizer can report and an explanation of them?

In my specific case, the error is reported deep inside iOS libraries, eventually originating from my code:

[CATransaction commit];

The reported error is:

==820==ERROR: AddressSanitizer failed to allocate 0x4b8000 (4947968) bytes of LargeMmapAllocator (error code: 12)

==820==Process memory map follows:

0x0193820000-0x019383d000 /System/Library/CoreServices/Encodings/libJapaneseConverter.dylib

0x019fb17000-0x019fb17020 /System/Library/CoreServices/Encodings/libJapaneseConverter.dylib

... very long list of mapped memory ...

==820==End of process memory map.

==820==AddressSanitizer CHECK failed: /Library/Caches/com.apple.xbs/Sources/clang/clang-703.0.29/src/projects/compiler-rt/lib/sanitizer_common/sanitizer_common.cc:181 "((0 && "unable to mmap")) != (0)" (0x0, 0x0)

ERROR: Failed to mmap

AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.

(lldb) thread info -s

thread #1: tid = 0x993ca, 0x0000000100994010 libclang_rt.asan_ios_dynamic.dylib`__asan::AsanDie(), queue = 'com.apple.main-thread'

Does anybody know what this specific error means?

网友答案:

AddressSanitizer uses a custom memory allocator, and it runs out of memory in this particular case. This does not necessarily denote a problem in ASan itself or your program.

分享给朋友:
您可能感兴趣的文章:
随机阅读: