-
Notifications
You must be signed in to change notification settings - Fork 1k
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
==6220==ERROR: AddressSanitizer failed to deallocate 0x20000 (131072) bytes at address 0x00014fb34800 #849
Comments
Off the top of my head such a big chunk of memory is allocated using
mmap(), so the address should be page-aligned. Yours is not, so maybe
you're passing an invalid address to free() in your program?
On Aug 18, 2017 5:47 AM, "DaHuO" <[email protected]> wrote:
I'm trying to use address sanitizer in xcode debuging an iOS program.
However, it crashes with the following error:
==6220==ERROR: AddressSanitizer failed to deallocate 0x20000 (131072)
bytes at address 0x00014fb34800
==6220==AddressSanitizer CHECK failed:
/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-802.0.41/src/projects/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc:143
"(("unable to unmap" && 0)) != (0)" (0x0, 0x0)
#0 0x105820ddf in __asan::AsanCheckFailed(char const*, int, char
const*, unsigned long long, unsigned long long)
(/var/containers/Bundle/Application/22D6C50C-6989-4809-A309-41F754D6FE9F/shehui.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x54ddf)
Warning: hit breakpoint while running function, skipping commands and
conditions to prevent recursion.warning: could not execute support
code to read Objective-C class data in the process. This may reduce
the quality of type information available.
AddressSanitizer report breakpoint hit. Use 'thread info -s' to get
extended information about the report.
(lldb) thread info -s
thread #19: tid = 0x147c85, 0x0000000105820cac
libclang_rt.asan_ios_dynamic.dylib`__asan::AsanDie()
I think Address sanitizer has run for a while before it crashes, since I
can see the following log in front:
2017-08-17:15:39:29:315 -ATAPI- ConfigManager.m:113 ==6220==WARNING:
unexpected format specifier in printf interceptor: %@
@_@
==6220==WARNING: unexpected format specifier in printf interceptor: %@
Any idea what will cause " AddressSanitizer failed to deallocate"? Does the
crash mean there is a problem in ConfigManager.m:113 ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#849>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA3s83F-C9pgfSudxtK5lLzrVDIGjLjQks5sZQlfgaJpZM4O7EV2>
.
|
@ramosian-glider Since the app runs well most of the time, I think there should not be an invalid address to free(), otherwise it should crash every time. |
Hi, I ran into the same issue with code compiled on Red Hat Linux 6.7 and GCC 6.2.1.
|
@mzanini we will need much more info in order to help you. At least:
BTW, are you sure there is no bug in your code here? |
Yea... But this is nowhere near a small easy-to-try reproducer :( |
In my case, I cannot compile address sanitizer statically because I am dealing with C++ libraries. I have noticed that the error happens only if I LD_PRELOAD the address sanitizer library. If I do not preload the library, no error from address sanitizer is shown. However, if I preload it, some LeakSanitizer errors are shown and at the end the error that is the title of this issue terminates the program. |
I am not sure I understand the described problem. Please provide a minimized example. Also note that using asan via LD_PRELOAD is not something we officially support. |
Note that mzanini uses GCC where situation is the opposite... |
Even in GCC, the default way is to link in a dynamic library, not to use LD_PRELOAD. |
Closing. @mzanini: If the issue persists, please provide a minimal repro. |
Hi, @kcc @ramosian-glider I've been cooking a UE4 dedicated server on linux. Unfortunately, there's no luck, it ran into this issue infinitely :
Any help would be appreciated! |
3.9 is way too old. Does this reproduce with the fresh clang (or at least with 7.0)? |
The latest clang version UE4.18 supported is 5.0. I've tried clang 5.0, the same problem remains. |
Sorry, we can't provide any support for 5.0 |
@std-vector - saw the same problem with Clang 6.0 and UE 4.0 on Linux. After lot of debugging found a workaround by adding UnrealEngine also uses sigaltstack system call, thus breaking some ASAN runtime assumptions about alternate signal stack state. |
Note that the pointer in question is not aligned on 0x1000, therefore it's
probably a wild one (munmap only accepts page-aligned pointers).
…On Wed, Apr 10, 2019, 19:23 vchigrin ***@***.***> wrote:
@std-vector <https://github.com/std-vector> - saw the same problem with
Clang 6.0 and UE 4.0 on Linux. After lot of debugging found a workaround by
adding use_sigaltstack=0 to ASAN_OPTIONS.
UnrealEngine also uses sigaltstack system call, thus breaking some ASAN
runtime assumptions about alternate stack state.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#849 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA3s80uo-Cl9vDeKtGOsUtY6Ol9izBLvks5vfh4UgaJpZM4O7EV2>
.
|
Apparently LLVM's internal sigaltstack usage does not play well together with the sanitizers, see [1]. This leads to failed tests on our CI. Setting use_sigaltstack=0 as an ASAN_OPTION fixes this issue, which this patch here does. Sadly, we have to jump through some hoops to achieve this though. On one hand, we want to extend the ASAN_OPTIONS, not overwrite it. As such, we can't just set the ctest ENVIRONMENT property, as the CI sets a bunch of custom flags in the ASAN_OPTIONS env var. Users might have their own set of values there too. Once we can rely on CMake 3.22 or newer, we might use ENVIRONMENT_MODIFICATION. Furthermore, I could not get __asan_default_options() to work with GCC. So, instead for now we use some dirty hackery: We check whether the use_sigaltstack option is set in ASAN_OPTIONS. If not, we set it explicitly to 0 and then execve the test anew. This way we can be sure that the environment gets picked up properly. [1]: google/sanitizers#849
Embedded Python also uses |
Due to ASan's use of sigaltstack, it can crash with deallocation errors if instrumenting binaries that also use sigaltstack (directly or transitively). As LLVM has its own sigaltstack, this has caused integration failures in COIN (see related Jira issues). This is a known issue, see e.g: google/sanitizers#849 KDE/kdevelop@e306f3e Modify the test binary such that it sets or extends the `ASAN_OPTIONS` environment variable for QDoc's process environment, to avoid crash in ASan. Promote the existing QProcessEnvironment to a static that is shared between the `initTestCase` and `runQDocProcess` member functions, to avoid the cost of repeatedly creating the QPE object. Fixes: QTBUG-126116 Task-number: QTBUG-111580 Pick-to: 6.8 Change-Id: I25c7baed9ccec14aaad0c47512b58118a3a91d84 Reviewed-by: Topi Reiniö <[email protected]>
Due to ASan's use of sigaltstack, it can crash with deallocation errors if instrumenting binaries that also use sigaltstack (directly or transitively). As LLVM has its own sigaltstack, this has caused integration failures in COIN (see related Jira issues). This is a known issue, see e.g: google/sanitizers#849 KDE/kdevelop@e306f3e Modify the test binary such that it sets or extends the `ASAN_OPTIONS` environment variable for QDoc's process environment, to avoid crash in ASan. Promote the existing QProcessEnvironment to a static that is shared between the `initTestCase` and `runQDocProcess` member functions, to avoid the cost of repeatedly creating the QPE object. Fixes: QTBUG-126116 Task-number: QTBUG-111580 Change-Id: I25c7baed9ccec14aaad0c47512b58118a3a91d84 Reviewed-by: Topi Reiniö <[email protected]> (cherry picked from commit 31835b4) Reviewed-by: Qt Cherry-pick Bot <[email protected]>
I'm trying to use address sanitizer in xcode debuging an iOS program. However, it crashes with the following error:
I think Address sanitizer has run for a while before it crashes, since I can see the following log in front:
Any idea what will cause " AddressSanitizer failed to deallocate"? Does the crash mean there is a problem in ConfigManager.m:113 ?
The text was updated successfully, but these errors were encountered: