-
Notifications
You must be signed in to change notification settings - Fork 1.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
freed and allocated stack it's short, Only 2 frames. How to increase into 5 frames? #982
Comments
Three options:
|
I verify on android O,
06-28 03:56:45.502 6462 6462 F DEBUG : #7 pc 0007c738 /system/lib/vndk-sp/libc++.so (unw_set_fpreg+53) |
Interesting. This looks like a libunwind bug, but the stack is missing some
frames between #7 and #8. It might help to add -fno-omit-frame-pointer
globally (somewhere under build/soong) and then add fast_unwind_on_fatal=1
to asan options.
Does it reproduce on AOSP? Could you provide exact instructions?
…On Mon, Jul 2, 2018 at 7:29 PM, TyphoonWu ***@***.***> wrote:
I verify on android O,
Only add 'fast_unwind_on_malloc=0' or both add 'fast_unwind_on_malloc=0'
and 'malloc_context_size=5', ASAN SEGV.
Here is my changes:
1. Android.bp
-
cflags: [
-
"-Wno-error",
-
"-fno-omit-frame-pointer",
-
"-O0",
-
"-Wno-frame-larger-than=",
-
"-fsanitize-recover=address"
-
],
-
clang: true,
-
sanitize: {
-
address: true,
-
},
1. ASAN_OPTIONS in device:
C:\Users\guanping>adb shell cat system/asan.options
allow_user_segv_handler=1
detect_odr_violation=0
alloc_dealloc_mismatch=0
allocator_may_return_null=1
detect_container_overflow=0
abort_on_error=1
halt_on_error=0
verbosity=1
fast_unwind_on_malloc=0
malloc_context_size=2
include_if_exists=/system/asan.options.%b
2. logs, Only 2 frames:
06-28 03:53:54.885 4723 4723 I : freed by thread T0 here:
06-28 03:53:54.885 4723 4723 I :
06-28 03:53:54.885 4723 4723 I : #0 0xf2780ad3 (/system/lib/
libclang_rt.asan-arm-android.so
<http://libclang_rt.asan-arm-android.so>+0x98ad3)
06-28 03:53:54.885 4723 4723 I :
06-28 03:53:54.885 4723 4723 I : #1
<#1> 0xef11e4c3
***@***.***+0x1d4c3)
06-28 03:53:54.885 4723 4723 I :
06-28 03:53:54.885 4723 4723 I :
06-28 03:53:54.886 4723 4723 I : previously allocated by thread T0
here:
06-28 03:53:54.886 4723 4723 I :
06-28 03:53:54.886 4723 4723 I : #0 0xf278044f (/system/lib/
libclang_rt.asan-arm-android.so
<http://libclang_rt.asan-arm-android.so>+0x9844f)
06-28 03:53:54.886 4723 4723 I :
06-28 03:53:54.886 4723 4723 I : #1
<#1> 0xef11e4a9
***@***.***+0x1d4a9)
3. When I set the malloc_context_size=3, ASAN SEGV.
06-28 03:56:42.099 6233 6233 I :
06-28 03:56:42.099 6233 6233 I :
06-28 03:56:42.099 6233 6233 I : redzone=16
06-28 03:56:42.099 6233 6233 I :
06-28 03:56:42.099 6233 6233 I : max_redzone=2048
06-28 03:56:42.099 6233 6233 I :
06-28 03:56:42.099 6233 6233 I : quarantine_size_mb=16M
06-28 03:56:42.099 6233 6233 I :
06-28 03:56:42.099 6233 6233 I : thread_local_quarantine_size_kb=64K
06-28 03:56:42.099 6233 6233 I :
06-28 03:56:42.099 6233 6233 I : malloc_context_size=3
06-28 03:56:42.099 6233 6233 I :
06-28 03:56:42.099 6233 6233 I : SHADOW_SCALE: 3
06-28 03:56:42.099 6233 6233 I :
06-28 03:56:42.100 6233 6233 I : SHADOW_GRANULARITY: 8
06-28 03:56:42.100 6233 6233 I :
06-28 03:56:42.100 6233 6233 I : SHADOW_OFFSET: 0x0
06-28 03:56:45.348 6233 6233 I :
06-28 03:56:45.348 6233 6233 I : ==6233==ERROR: AddressSanitizer: SEGV
on unknown address 0x0000001f (pc 0xe741273c bp 0xff983e20 sp 0xff9836b8 T0)
06-28 03:56:45.348 6233 6233 I :
06-28 03:56:45.348 6233 6233 I :
06-28 03:56:45.348 6233 6233 I : ==6233==The signal is caused by a
READ memory access.
06-28 03:56:45.348 6233 6233 I :
06-28 03:56:45.348 6233 6233 I : ==6233==Hint: address points to the
zero page.
06-28 03:56:45.348 6233 6233 I :
06-28 03:56:45.381 6233 6233 I :
06-28 03:56:45.382 6233 6233 I :
06-28 03:56:45.382 6233 6233 I :
06-28 03:56:45.382 6233 6233 I : AddressSanitizer can not provide
additional info.
06-28 03:56:45.382 6233 6233 I :
06-28 03:56:45.382 6233 6233 I : SUMMARY: AddressSanitizer: SEGV
06-28 03:56:45.382 6233 6233 I :
06-28 03:56:45.383 6233 6233 I : ==6233==ABORTING
06-28 03:56:45.383 6233 6233 I :
06-28 03:56:45.383 6233 6233 F libc : Fatal signal 6 (SIGABRT), code
-6 in tid 6233 (android.hardwar), pid 6233 (android.hardwar)
......
06-28 03:56:45.483 6462 6462 F DEBUG : ABI: 'arm'
06-28 03:56:45.483 6462 6462 F DEBUG : pid: 6233, tid: 6233, name:
android.hardwar >>> /vendor/bin/hw/android.
***@***.*** <<<
06-28 03:56:45.483 6462 6462 F DEBUG : signal 6 (SIGABRT), code -6
(SI_TKILL), fault addr --------
06-28 03:56:45.483 6462 6462 F DEBUG : r0 00000000 r1 00001859 r2
00000006 r3 00000008
06-28 03:56:45.483 6462 6462 F DEBUG : r4 00001859 r5 00001859 r6
e7d5b244 r7 0000010c
06-28 03:56:45.483 6462 6462 F DEBUG : r8 00000000 r9 e776ece8 sl
00000000 fp ff983e20
06-28 03:56:45.483 6462 6462 F DEBUG : ip e7d5bc90 sp e7d5b230 lr
e746b781 pc e7465438 cpsr 20070030
06-28 03:56:45.501 6462 6462 F DEBUG :
06-28 03:56:45.501 6462 6462 F DEBUG : backtrace:
06-28 03:56:45.502 6462 6462 F DEBUG : #00 pc 0001a438
/system/lib/libc.so (abort+63)
06-28 03:56:45.502 6462 6462 F DEBUG : #1
<#1> pc 000a18b3
/system/lib/libclang_rt.asan-arm-android.so (__sanitizer::Abort()+40)
06-28 03:56:45.502 6462 6462 F DEBUG : #2
<#2> pc 000a6449
/system/lib/libclang_rt.asan-arm-android.so (__sanitizer::Die()+60)
06-28 03:56:45.502 6462 6462 F DEBUG : #3
<#3> pc 0008ffc0
/system/lib/libclang_rt.asan-arm-android.so
(__asan::ScopedInErrorReport::~ScopedInErrorReport()+352)
06-28 03:56:45.502 6462 6462 F DEBUG : #4
<#4> pc 000900b8
/system/lib/libclang_rt.asan-arm-android.so
(__asan::ReportDeadlySignal(int, __sanitizer::SignalContext
const&)+160)
06-28 03:56:45.502 6462 6462 F DEBUG : #5
<#5> pc 0008f0fc
/system/lib/libclang_rt.asan-arm-android.so
(__asan::AsanOnDeadlySignal(int, void*, void*)+188)
06-28 03:56:45.502 6462 6462 F DEBUG : #6
<#6> pc 00018a08
/system/lib/libc.so
06-28 03:56:45.502 6462 6462 F DEBUG : #7
<#7> pc 0007c738
/system/lib/vndk-sp/libc++.so (unw_set_fpreg+53)
06-28 03:56:45.502 6462 6462 F DEBUG : #8
<#8> pc 00053968
/system/lib/vndk-sp/libc++.so (std::__1::ios_base::clear(unsigned
int)+115)
06-28 03:56:45.503 6462 6462 F DEBUG : #9
<#9> pc 0001f70c
[stack:ff964000]
06-28 03:56:45.502 6462 6462 F DEBUG : #7
<#7> pc 0007c738
/system/lib/vndk-sp/libc++.so (unw_set_fpreg+53)
06-28 03:56:45.502 6462 6462 F DEBUG : #8
<#8> pc 00053968
/system/lib/vndk-sp/libc++.so (std::__1::ios_base::clear(unsigned
int)+115)
It's at AOSP code:
external/libunwind_llvm/src/libunwind.cpp:223
external/libcxx/src/ios.cpp:274 (discriminator 3)
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#982 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZuSiXJkvCOgTi_WrTRAGzgCQrkhOAIks5uCtcJgaJpZM4U-mdC>
.
|
@eugenis Thanks for you input. /system/lib/vndk-sp/libc++.so it's AOSP code, May be have bug on it. |
@TyphoonWu @eugenis |
freed and allocated stack it's short, Only 2 frames. How to increase into 5 frames?
06-28 02:53:44.196 4831 4831 I : freed by thread T0 here:
06-28 02:53:44.196 4831 4831 I :
06-28 02:53:44.196 4831 4831 I : #0 0xf087ead3 (/system/lib/libclang_rt.asan-arm-android.so+0x98ad3)
06-28 02:53:44.196 4831 4831 I :
06-28 02:53:44.196 4831 4831 I : #1 0xed5254c3 (/data/asan/vendor/lib/hw/[email protected]+0x1d4c3)
06-28 02:53:44.196 4831 4831 I :
06-28 02:53:44.197 4831 4831 I :
06-28 02:53:44.197 4831 4831 I : previously allocated by thread T0 here:
06-28 02:53:44.197 4831 4831 I :
06-28 02:53:44.197 4831 4831 I : #0 0xf087e44f (/system/lib/libclang_rt.asan-arm-android.so+0x9844f)
06-28 02:53:44.197 4831 4831 I :
06-28 02:53:44.197 4831 4831 I : #1 0xed5254a9 (/data/asan/vendor/lib/hw/[email protected]+0x1d4a9)
06-28 02:53:44.197 4831 4831 I :
The text was updated successfully, but these errors were encountered: