Skip to content
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

native crash(null pointer dereference) use implementation project(':mmkv') #239

Closed
WinnieZy opened this issue Apr 11, 2019 · 7 comments
Closed

Comments

@WinnieZy
Copy link

The language of MMKV

Java

The version of MMKV

v1.0.18

The platform of MMKV

Android

The installation of MMKV

Git clone

What's the issue?

native crash when I use implementation project(':mmkv') to run the mmkvdemo
image

according to the native crash log I found the position where the crash orrured
image

MMKV\Android\MMKV\mmkv\src\main\cpp\aes\openssl\cfb128.c:110:25
MMKV\mmkv\src\main\cpp\MMKV.cpp:1386:24

注释掉这两句打印日志的代码之后就不会crash了,求问是什么问题
image

具体日志如下:
04-11 15:14:45.047 5577 5577 F DEBUG : Build fingerprint: 'Xiaomi/chiron/chiron:8.0.0/OPR1.170623.027/V10.2.2.0.ODECNXM:user/release-keys'
04-11 15:14:45.047 5577 5577 F DEBUG : Revision: '0'
04-11 15:14:45.047 5577 5577 F DEBUG : ABI: 'arm64'
04-11 15:14:45.047 5577 5577 F DEBUG : pid: 5544, tid: 5544, name: encent.mmkvdemo >>> com.tencent.mmkvdemo <<<
04-11 15:14:45.047 5577 5577 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1
04-11 15:14:45.047 5577 5577 F DEBUG : Cause: null pointer dereference
04-11 15:14:45.047 5577 5577 F DEBUG : x0 0000000000000001 x1 0000000000000003 x2 0000000000000004 x3 0000007ffee4def8
04-11 15:14:45.047 5577 5577 F DEBUG : x4 0000000000000001 x5 0000007ffee4e750 x6 0000007ffee4f029 x7 363930343a657a69
04-11 15:14:45.047 5577 5577 F DEBUG : x8 0101010101010101 x9 00000070951b14e6 x10 0000000000000001 x11 0000007ffee4df48
04-11 15:14:45.047 5577 5577 F DEBUG : x12 00000070951bb2b8 x13 0000000000000000 x14 00000070951bb614 x15 0000000000000000
04-11 15:14:45.047 5577 5577 F DEBUG : x16 00000070951d9190 x17 000000709512e350 x18 0000000000000020 x19 0000007ffee4e4f0
04-11 15:14:45.047 5577 5577 F DEBUG : x20 000000008000002f x21 0000000000000000 x22 00000070790c248f x23 0000007ffee4e4c0
04-11 15:14:45.047 5577 5577 F DEBUG : x24 0000007ffee4df60 x25 0000000000000073 x26 00000000ffffffff x27 0000000000000001
04-11 15:14:45.047 5577 5577 F DEBUG : x28 000000000ccccccc x29 0000007ffee4e4b0 x30 000000709516764c
04-11 15:14:45.047 5577 5577 F DEBUG : sp 0000007ffee4dd50 pc 000000709512e360 pstate 0000000080000000
04-11 15:14:45.057 5577 5577 F DEBUG :
04-11 15:14:45.057 5577 5577 F DEBUG : backtrace:
04-11 15:14:45.057 5577 5577 F DEBUG : #00 pc 000000000001d360 /system/lib64/libc.so (strlen+16)
04-11 15:14:45.057 5577 5577 F DEBUG : #1 pc 0000000000056648 /system/lib64/libc.so (__vfprintf+1032)
04-11 15:14:45.057 5577 5577 F DEBUG : #2 pc 0000000000075300 /system/lib64/libc.so (vsnprintf+208)
04-11 15:14:45.057 5577 5577 F DEBUG : #3 pc 0000000000021734 /system/lib64/libc.so (__vsnprintf_chk+68)
04-11 15:14:45.057 5577 5577 F DEBUG : #4 pc 0000000000007ca4 /system/lib64/liblog.so (__android_log_print+144)
04-11 15:14:45.057 5577 5577 F DEBUG : #5 pc 0000000000032400 /data/app/com.tencent.mmkvdemo-VdqFTEA-Vb_SNSFvztVeRw==/lib/arm64/libmmkv.so (_Z17_MMKVLogWithLevel12MMKVLogLevelPKcS1_iS1_z+1780)
04-11 15:14:45.057 5577 5577 F DEBUG : #6 pc 000000000001d5f0 /data/app/com.tencent.mmkvdemo-VdqFTEA-Vb_SNSFvztVeRw==/lib/arm64/libmmkv.so (_Z10initializev+468)
04-11 15:14:45.057 5577 5577 F DEBUG : #7 pc 000000000006774c /system/lib64/libc.so (pthread_once+168)
04-11 15:14:45.057 5577 5577 F DEBUG : #8 pc 000000000001d644 /data/app/com.tencent.mmkvdemo-VdqFTEA-Vb_SNSFvztVeRw==/lib/arm64/libmmkv.so (_ZN4MMKV14initializeMMKVERKNSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE+40)
04-11 15:14:45.057 5577 5577 F DEBUG : #9 pc 00000000000116cc /data/app/com.tencent.mmkvdemo-VdqFTEA-Vb_SNSFvztVeRw==/lib/arm64/libmmkv.so (Java_com_tencent_mmkv_MMKV_jniInitialize+180)
04-11 15:14:45.057 5577 5577 F DEBUG : #10 pc 0000000000517700 /system/lib64/libart.so (art_quick_generic_jni_trampoline+144)
04-11 15:14:45.057 5577 5577 F DEBUG : #11 pc 000000000050e638 /system/lib64/libart.so (art_quick_invoke_static_stub+600)
04-11 15:14:45.057 5577 5577 F DEBUG : #12 pc 00000000000d8e80 /system/lib64/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+260)
04-11 15:14:45.057 5577 5577 F DEBUG : #13 pc 0000000000283490 /system/lib64/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+352)
04-11 15:14:45.057 5577 5577 F DEBUG : #14 pc 000000000027db60 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+672)
04-11 15:14:45.057 5577 5577 F DEBUG : #15 pc 00000000004f7218 /system/lib64/libart.so (MterpInvokeStatic+468)
04-11 15:14:45.057 5577 5577 F DEBUG : #16 pc 00000000004fff94 /system/lib64/libart.so (ExecuteMterpImpl+14612)
04-11 15:14:45.057 5577 5577 F DEBUG : #17 pc 000000000025e8dc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+444)
04-11 15:14:45.057 5577 5577 F DEBUG : #18 pc 0000000000264fdc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+212)
04-11 15:14:45.057 5577 5577 F DEBUG : #19 pc 000000000027db40 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+640)
04-11 15:14:45.057 5577 5577 F DEBUG : #20 pc 00000000004f7218 /system/lib64/libart.so (MterpInvokeStatic+468)
04-11 15:14:45.057 5577 5577 F DEBUG : #21 pc 00000000004fff94 /system/lib64/libart.so (ExecuteMterpImpl+14612)
04-11 15:14:45.057 5577 5577 F DEBUG : #22 pc 000000000025e8dc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+444)
04-11 15:14:45.057 5577 5577 F DEBUG : #23 pc 0000000000264fdc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+212)
04-11 15:14:45.057 5577 5577 F DEBUG : #24 pc 000000000027db40 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+640)
04-11 15:14:45.057 5577 5577 F DEBUG : #25 pc 00000000004f5bf4 /system/lib64/libart.so (MterpInvokeVirtual+612)
04-11 15:14:45.057 5577 5577 F DEBUG : #26 pc 00000000004ffe14 /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-11 15:14:45.057 5577 5577 F DEBUG : #27 pc 000000000025e8dc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+444)
04-11 15:14:45.057 5577 5577 F DEBUG : #28 pc 0000000000264fdc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+212)
04-11 15:14:45.057 5577 5577 F DEBUG : #29 pc 000000000027db40 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+640)
04-11 15:14:45.057 5577 5577 F DEBUG : #30 pc 00000000004f5bf4 /system/lib64/libart.so (MterpInvokeVirtual+612)
04-11 15:14:45.057 5577 5577 F DEBUG : #31 pc 00000000004ffe14 /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-11 15:14:45.057 5577 5577 F DEBUG : #32 pc 000000000025e8dc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+444)
04-11 15:14:45.057 5577 5577 F DEBUG : #33 pc 0000000000264fdc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+212)
04-11 15:14:45.057 5577 5577 F DEBUG : #34 pc 000000000027db40 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+640)
04-11 15:14:45.057 5577 5577 F DEBUG : #35 pc 00000000004f5bf4 /system/lib64/libart.so (MterpInvokeVirtual+612)
04-11 15:14:45.057 5577 5577 F DEBUG : #36 pc 00000000004ffe14 /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-11 15:14:45.057 5577 5577 F DEBUG : #37 pc 000000000025e8dc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+444)
04-11 15:14:45.057 5577 5577 F DEBUG : #38 pc 0000000000264fdc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+212)
04-11 15:14:45.057 5577 5577 F DEBUG : #39 pc 000000000027db40 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+640)
04-11 15:14:45.057 5577 5577 F DEBUG : #40 pc 00000000004f6f60 /system/lib64/libart.so (MterpInvokeDirect+504)
04-11 15:14:45.058 5577 5577 F DEBUG : #41 pc 00000000004fff14 /system/lib64/libart.so (ExecuteMterpImpl+14484)
04-11 15:14:45.058 5577 5577 F DEBUG : #42 pc 000000000025e8dc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+444)
04-11 15:14:45.058 5577 5577 F DEBUG : #43 pc 0000000000264fdc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+212)
04-11 15:14:45.058 5577 5577 F DEBUG : #44 pc 000000000027db40 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+640)
04-11 15:14:45.058 5577 5577 F DEBUG : #45 pc 00000000004f6f60 /system/lib64/libart.so (MterpInvokeDirect+504)
04-11 15:14:45.058 5577 5577 F DEBUG : #46 pc 00000000004fff14 /system/lib64/libart.so (ExecuteMterpImpl+14484)
04-11 15:14:45.058 5577 5577 F DEBUG : #47 pc 000000000025e8dc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+444)
04-11 15:14:45.058 5577 5577 F DEBUG : #48 pc 0000000000264fdc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+212)
04-11 15:14:45.058 5577 5577 F DEBUG : #49 pc 000000000027db40 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+640)
04-11 15:14:45.058 5577 5577 F DEBUG : #50 pc 00000000004f7218 /system/lib64/libart.so (MterpInvokeStatic+468)
04-11 15:14:45.058 5577 5577 F DEBUG : #51 pc 00000000004fff94 /system/lib64/libart.so (ExecuteMterpImpl+14612)
04-11 15:14:45.058 5577 5577 F DEBUG : #52 pc 000000000025e8dc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+444)
04-11 15:14:45.058 5577 5577 F DEBUG : #53 pc 0000000000264fdc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+212)
04-11 15:14:45.058 5577 5577 F DEBUG : #54 pc 000000000027db40 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+640)
04-11 15:14:45.058 5577 5577 F DEBUG : #55 pc 00000000004f5bf4 /system/lib64/libart.so (MterpInvokeVirtual+612)
04-11 15:14:45.058 5577 5577 F DEBUG : #56 pc 00000000004ffe14 /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-11 15:14:45.058 5577 5577 F DEBUG : #57 pc 000000000025e8dc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+444)
04-11 15:14:45.058 5577 5577 F DEBUG : #58 pc 0000000000264fdc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+212)
04-11 15:14:45.058 5577 5577 F DEBUG : #59 pc 000000000027db40 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+640)
04-11 15:14:45.058 5577 5577 F DEBUG : #60 pc 00000000004f5bf4 /system/lib64/libart.so (MterpInvokeVirtual+612)
04-11 15:14:45.058 5577 5577 F DEBUG : #61 pc 00000000004ffe14 /system/lib64/libart.so (ExecuteMterpImpl+14228)
04-11 15:14:45.058 5577 5577 F DEBUG : #62 pc 000000000025e8dc /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+444)
04-11 15:14:45.058 5577 5577 F DEBUG : #63 pc 0000000000264fdc /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+212)

@lingol
Copy link
Collaborator

lingol commented Apr 11, 2019

04-11 15:14:45.057 5577 5577 F DEBUG : #4 pc 0000000000007ca4 /system/lib64/liblog.so (__android_log_print+144)

Looks like there's some bug inside __android_log_print. I don't have any clue.

@lingol
Copy link
Collaborator

lingol commented Apr 11, 2019

 __android_log_print(MMKVLogLevelDesc(level), APPNAME, "<%s:%d::%s> %s", file, line,
                                func, message.c_str());

Would you set a breakpoint and check each of these variable is equal to null? aka, APPNAME, file, func, message.

@WinnieZy
Copy link
Author

image
Looks like nothing is null,I use android-ndk-r16b which contains the __android_log_print method.

I change nothing but open
implementation project(':mmkv')
and close
// implementation 'com.tencent:mmkv:1.0.18'

I wonder if you can reproduce this bug and help me to see what's wrong with it. Thanks a lot!

@lingol
Copy link
Collaborator

lingol commented Apr 11, 2019

No. Can't reproduce it.

@jiaopen
Copy link

jiaopen commented Apr 12, 2019

不是说英语技能不重要,但是双方中国人何必还要用英语沟通。。

@lingol
Copy link
Collaborator

lingol commented Apr 12, 2019

It's for other readers that don't understand Chinese.

不是说英语技能不重要,但是双方中国人何必还要用英语沟通。。

@lingol
Copy link
Collaborator

lingol commented Apr 19, 2019

Close due to inactive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants