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

Signal 11(SIGSEGV), Code 2(SEGV_ACCERR) #1440

Open
wuangruaingzua opened this issue Nov 26, 2024 · 12 comments
Open

Signal 11(SIGSEGV), Code 2(SEGV_ACCERR) #1440

wuangruaingzua opened this issue Nov 26, 2024 · 12 comments

Comments

@wuangruaingzua
Copy link

wuangruaingzua commented Nov 26, 2024

Note:

The language of MMKV

Java

The version of MMKV

v1.3.9

Note: For versions older than the latest version, please upgrade before posting any issue.
We don't have much time for old version tech support.

The platform of MMKV

Android

The installation of MMKV

Maven

What's the issue?

Signal 11(SIGSEGV), Code 2(SEGV_ACCERR)
00 pc 000000000004d390 /data/app/~~L_ekTp14n5g64eXqslBD1A==/com.xxx.xxx-9fByeNZL54cd2P10Ej2uRw==/lib/arm64/libmmkv.so
#1 pc 000000000004cf54 /data/app/~~L_ekTp14n5g64eXqslBD1A==/com.xxx.xxx-9fByeNZL54cd2P10Ej2uRw==/lib/arm64/libmmkv.so
#2 pc 0000000000050070 /data/app/~~L_ekTp14n5g64eXqslBD1A==/com.xxx.xxx-9fByeNZL54cd2P10Ej2uRw==/lib/arm64/libmmkv.so
#3 pc 000000000004f7f0 /data/app/~~L_ekTp14n5g64eXqslBD1A==/com.xxx.xxx-9fByeNZL54cd2P10Ej2uRw==/lib/arm64/libmmkv.so
#4 pc 000000000004f4f8 /data/app/~~L_ekTp14n5g64eXqslBD1A==/com.xxx.xxx-9fByeNZL54cd2P10Ej2uRw==/lib/arm64/libmmkv.so
#5 pc 0000000000041090 /data/app/~~L_ekTp14n5g64eXqslBD1A==/com.xxx.xxx-9fByeNZL54cd2P10Ej2uRw==/lib/arm64/libmmkv.so
#6 pc 0000000000041278 /data/app/~~L_ekTp14n5g64eXqslBD1A==/com.xxx.xxx-9fByeNZL54cd2P10Ej2uRw==/lib/arm64/libmmkv.so
#7 pc 0000000000039b04 /data/app/~~L_ekTp14n5g64eXqslBD1A==/com.xxx.xxx-9fByeNZL54cd2P10Ej2uRw==/lib/arm64/libmmkv.so
#8 pc 00000000003f7e90 /data/app/~~L_ekTp14n5g64eXqslBD1A==/com.xxx.xxx-9fByeNZL54cd2P10Ej2uRw==/oat/arm64/base.odex (art_jni_trampoline+144)
at com.tencent.mmkv.MMKV.encodeString(Native method)
at com.tencent.mmkv.MMKV.encode(MMKV.java:11)

@lingol
Copy link
Collaborator

lingol commented Nov 26, 2024

Please provide Logs from MMKV.

@lingol
Copy link
Collaborator

lingol commented Nov 26, 2024

And symbolize your call stacks.

@wuangruaingzua
Copy link
Author

wuangruaingzua commented Nov 26, 2024

MMKV Logs

106
11-26 15:40:06.987
25250 25250
INFO
MMKV Disable checkProcessMode()
107
11-26 15:40:06.988
25250 25250
INFO
MMKV current API level = 33, libc++_shared=0
108
11-26 15:40:06.988
25250 25250
INFO
MMKV MMKV.cpp:166::initialize version v1.3.9, page size 4096, arch arm64-v8a
109
11-26 15:40:06.988
25250 25250
INFO
MMKV MMKV.cpp:177::initialize armv8 AES instructions is supported
110
11-26 15:40:06.988
25250 25250
INFO
MMKV MMKV.cpp:185::initialize armv8 CRC32 instructions is supported
111
11-26 15:40:06.988
25250 25250
INFO
MMKV MMKV.cpp:225::initializeMMKV root dir: /data/user/0/com.xxxx.xx.xxxx/files/mmkv
118
11-26 15:40:06.990
25250 29005
INFO
MMKV <MMKV_IO.cpp:89::loadFromFile> loading [mmkv.default] with crc 619788797 sequence 188 version 4
119
11-26 15:40:06.991
25250 29005
INFO
MMKV <MMKV_IO.cpp:133::loadFromFile> loaded [mmkv.default] with 632 key-values
782
11-26 15:40:11.924
25250 29200
INFO
MMKV <MMKV_IO.cpp:1787::filterExpiredKeys> filtering expired keys inside [mmkv.default] now: 1732606811, m_expiredInSeconds: 0
783
11-26 15:40:11.924
25250 29200
INFO
MMKV <MMKV_IO.cpp:1830::filterExpiredKeys> deleting expired key [APEPE], due date 1145393734
784
11-26 15:40:11.924
25250 29200
INFO
MMKV <MMKV_IO.cpp:1830::filterExpiredKeys> deleting expired key [ASI], due date 1497646145
785
11-26 15:40:11.924
25250 29200
INFO
MMKV <MMKV_IO.cpp:1830::filterExpiredKeys> deleting expired key [RIFSOL], due date 1279350100
786
11-26 15:40:11.924
25250 29200
INFO
MMKV <MMKV_IO.cpp:1830::filterExpiredKeys> deleting expired key [SCIHUB], due date 1096436044
787
11-26 15:40:11.924
25250 29200
INFO
MMKV <MMKV_IO.cpp:1830::filterExpiredKeys> deleting expired key [OL], due date 1095649608

Stacks

at com.tencent.mmkv.MMKV.encodeString(Native method)
2
at com.tencent.mmkv.MMKV.encode(MMKV.java:11)
3
at com.lib.storage.mmvk.GTMMVKManager.save(GTMMVKManager.kt:4)

@lingol
Copy link
Collaborator

lingol commented Nov 26, 2024

  1. In your logs there are no error or warning logs. Are you sure they are the complete logs?
  2. Your native call stacks are not symbolized. Download the so with debug info(aka mmkv-xxx-so-symbols.jar) from the maven central and try again.

@wuangruaingzua
Copy link
Author

wuangruaingzua commented Nov 27, 2024

signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x71f61ab22b
x0 0000000000000001 x1 00000073f9b7dd44 x2 00000073f9b7dd44 x3 000000701f290d48
x4 0000000000000060 x5 4080001000404000 x6 6e7265622e000000 x7 0000002e6265726e
x8 00000070f61ab22c x9 00000000ffffffff x10 0000000000000005 x11 000000000000000e
x12 0000000000000000 x13 0000000000000000 x14 ffffffffffffffff x15 0000000000000028
x16 0000000000000001 x17 00000073f98904b8 x18 000000701f290d41 x19 b400007141020270
x20 0000000000000000 x21 000000006746a99c x22 00000070f6180004 x23 000000701f292000
x24 00000070a65860e1 x25 00000070a658592c x26 b400007191044690 x27 0000000000000000
x28 00000070a6588e3c x29 000000701f290f80
sp 000000701f290ef0 lr 00000070a65b7134 pc 00000070a65b7390

backtrace:
    #00 pc 000000000004d390 /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
           MMKV::filterExpiredKeys() at MMKV_IO.cpp:1822
           
    #01 pc 000000000004cf54 /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
           MMKV::ensureMemorySize(unsigned long) at MMKV_IO.cpp:404
           
    #02 pc 0000000000050070 /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
           MMKV::doAppendDataWithKey(mmkv::MMBuffer const&, mmkv::MMBuffer const&, bool, unsigned int) at MMKV_IO.cpp:829
           
    #03 pc 000000000004f7f0 /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
           MMKV::appendDataWithKey(mmkv::MMBuffer const&, std::__ndk1::basic_string_view<char, std::__ndk1::char_traits<char> >, bool) at MMKV_IO.cpp:981
           
    #04 pc 000000000004f4f8 /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
           MMKV::setDataForKey(mmkv::MMBuffer&&, std::__ndk1::basic_string_view<char, std::__ndk1::char_traits<char> >, bool) at MMKV_IO.cpp:701
           
    #05 pc 0000000000041090 /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
           MMKV::setDataForKey(mmkv::MMBuffer&&, std::__ndk1::basic_string_view<char, std::__ndk1::char_traits<char> >, unsigned int) at MMKV.cpp:617
           
    #06 pc 0000000000041278 /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
           MMKV::set(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string_view<char, std::__ndk1::char_traits<char> >, unsigned int) at MMKV.cpp:641
            (inlined by) MMKV::set(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string_view<char, std::__ndk1::char_traits<char> >) at MMKV.cpp:634
           
    #07 pc 0000000000039b04 /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
           mmkv::encodeString(_JNIEnv*, _jobject*, long, _jstring*, _jstring*) at native-bridge.cpp:549
           
    #08 pc 00000000002184d0 /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/oat/arm64/base.odex
           art_jni_trampoline+144

build id:
    [anon:scudo:primary_reserve] (BuildId: unknown)
    /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so (BuildId: 327ebdcc258dd5a87fdd771350aa1f0a7490ffff)
    /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/oat/arm64/base.odex (BuildId: 1354c001097c272a5493a773db79e774)

stack:
         000000701f290e70  000000701f292000  [anon:stack_and_tls:6655]
         000000701f290e78  6e697265746c6966
         000000701f290e80  0072697078652067
         000000701f290e88  87e3fe8cc86e0888
         000000701f290e90  000000701f290f80  [anon:stack_and_tls:6655]
         000000701f290e98  00000070a65b7134  /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
         000000701f290ea0  b4000073210219d0
         000000701f290ea8  b4000072b13e0bc0
         000000701f290eb0  000000000000001a
         000000701f290eb8  000000701f291100  [anon:stack_and_tls:6655]
         000000701f290ec0  b400007321021ed0
         000000701f290ec8  000000701f292000  [anon:stack_and_tls:6655]
         000000701f290ed0  000000701f291240  [anon:stack_and_tls:6655]
         000000701f290ed8  000000006746a99c  [anon:dalvik-main space (region space)]
         000000701f290ee0  b400007141020289
         000000701f290ee8  b400007141020270
    #00  000000701f290ef0  0000000000000002
         000000701f290ef8  b400007141020289
         000000701f290f00  b400007321021ed0
         000000701f290f08  000000701f292000  [anon:stack_and_tls:6655]
         000000701f290f10  000000701f292000  [anon:stack_and_tls:6655]
         000000701f290f18  000000701f290f21  [anon:stack_and_tls:6655]
         000000701f290f20  0000000000000001
         000000701f290f28  0000000000000034
         000000701f290f30  b4000071f100e190
         000000701f290f38  b40000724117b0b0
         000000701f290f40  000000701f292000  [anon:stack_and_tls:6655]
         000000701f290f48  0000000000000000
         000000701f290f50  000000001f290f80  [anon:dalvik-main space (region space)]
         000000701f290f58  b400007321021ed0
         000000701f290f60  000000701f291028  [anon:stack_and_tls:6655]
         000000701f290f68  007876711a504c74
         ........  ........
    #01  000000701f290fe0  6f1593e800000001
         000000701f290fe8  4117b0b000000001
         000000701f290ff0  00000000b4000072
         000000701f290ff8  0000000000000003
         000000701f291000  00000000141b75a8  [anon:dalvik-main space (region space)]
         000000701f291008  00000000709bd938  /system/framework/arm64/boot.oat (java.io.StringWriter.write+104)
         000000701f291010  000000006f2d8848  [anon:dalvik-/system/framework/boot.art]
         000000701f291018  87e3fe8cc86e0888
         000000701f291020  000000701f291030  [anon:stack_and_tls:6655]
         000000701f291028  00556af3f98ce808
         000000701f291030  000000701f291170  [anon:stack_and_tls:6655]
         000000701f291038  87e3fe8cc86e0888
         000000701f291040  000000701f2910a0  [anon:stack_and_tls:6655]
         000000701f291048  00000070a65ba074  /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
         000000701f291050  000000701f291240  [anon:stack_and_tls:6655]
         000000701f291058  0000000000008ccc
         ........  ........
    #02  000000701f291070  0000001a1f2911b0
         000000701f291078  000000701f292000  [anon:stack_and_tls:6655]
         000000701f291080  00000000141b6b38  [anon:dalvik-main space (region space)]
         000000701f291088  00000070a049c234  /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/oat/arm64/base.odex (com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write+1444)
         000000701f291090  b4000073210219d0
         000000701f291098  87e3fe8cc86e0888
         000000701f2910a0  000000701f291120  [anon:stack_and_tls:6655]
         000000701f2910a8  00000070a65b97f4  /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
         000000701f2910b0  000000701f291500  [anon:stack_and_tls:6655]
         000000701f2910b8  000000701f2914b0  [anon:stack_and_tls:6655]
         000000701f2910c0  b4000073210219d0
         000000701f2910c8  000000701f292000  [anon:stack_and_tls:6655]
         000000701f2910d0  000000701f291240  [anon:stack_and_tls:6655]
         000000701f2910d8  b400007191044320
         000000701f2910e0  000000701f292000  [anon:stack_and_tls:6655]
         000000701f2910e8  b400007141020270
         ........  ........
    #03  000000701f291100  00000000001a0101
         000000701f291108  0072b13fbd700000
         000000701f291110  000000701f29b400  [anon:stack_and_tls:6653]
         000000701f291118  87e3fe8cc86e0888
         000000701f291120  000000701f2911d0  [anon:stack_and_tls:6655]
         000000701f291128  00000070a65b94fc  /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
         000000701f291130  0000000000000000
         000000701f291138  000000701f291240  [anon:stack_and_tls:6655]
         000000701f291140  b400007141020270
         000000701f291148  b40000722102cd90
    #04  000000701f291150  0000000000000000
         000000701f291158  0000000000000000
         000000701f291160  000000701f2911c0  [anon:stack_and_tls:6655]
         000000701f291168  b4000073210219d0
         000000701f291170  b40000722102cd90
         000000701f291178  b4000072b13fbd70
         000000701f291180  000000000000001a
         000000701f291188  000000701f292000  [anon:stack_and_tls:6655]
         000000701f291190  000000701f291240  [anon:stack_and_tls:6655]
         000000701f291198  000000701f2912b0  [anon:stack_and_tls:6655]
         000000701f2911a0  0000000000000000
         000000701f2911a8  0000000000000000
         000000701f2911b0  b400000000000000
         000000701f2911b8  87e3fe8cc86e0888
         000000701f2911c0  000000701f2911f0  [anon:stack_and_tls:6655]
         000000701f2911c8  87e3fe8cc86e0888
         ........  ........
    #05  000000701f291220  000000701f291280  [anon:stack_and_tls:6655]
         000000701f291228  b4000071b120d210
         000000701f291230  0000000000008ccc
         000000701f291238  0000000000008ccc
         000000701f291240  000000008ccc0001  [anon:dalvik-free list large object space]
         000000701f291248  0071b120d2100000
         000000701f291250  b4000071b117b400
         000000701f291258  87e3fe8cc86e0888
         000000701f291260  000000701f2912d0  [anon:stack_and_tls:6655]
         000000701f291268  00000070a65ab27c  /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
         000000701f291270  000000701f2914b0  [anon:stack_and_tls:6655]
         000000701f291278  00000071b120d210  [anon:scudo:primary]
         000000701f291280  00000000aaaf37f8
         000000701f291288  000000701f292000  [anon:stack_and_tls:6655]
         000000701f291290  0000000000000000
         000000701f291298  b400007141020270
         ........  ........
    #06  000000701f2912b0  000000008cc50101  [anon:dalvik-free list large object space]
         000000701f2912b8  0071b117d1800000
         000000701f2912c0  000000701f29b400  [anon:stack_and_tls:6653]
         000000701f2912c8  87e3fe8cc86e0888
         000000701f2912d0  000000701f291350  [anon:stack_and_tls:6655]
         000000701f2912d8  00000070a65a3b08  /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
         000000701f2912e0  000000701f292000  [anon:stack_and_tls:6655]
         000000701f2912e8  000000701f292000  [anon:stack_and_tls:6655]
         000000701f2912f0  b4000071410df670
         000000701f2912f8  000000701f291458  [anon:stack_and_tls:6655]
         000000701f291300  000000701f291330  [anon:stack_and_tls:6655]
         000000701f291308  b400007141020270
    #07  000000701f291310  00000000141b6b00  [anon:dalvik-main space (region space)]
         000000701f291318  0000000000008cd1
         000000701f291320  0000000000008cc5
         000000701f291328  b4000071b117d180
         000000701f291330  0000000000000021
         000000701f291338  000000000000001a
         000000701f291340  b4000072b13fbd70
         000000701f291348  87e3fe8cc86e0888
         000000701f291350  000000701f2914d8  [anon:stack_and_tls:6655]
         000000701f291358  00000070a00184d4  /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/oat/arm64/base.odex (art_jni_trampoline+148)
         000000701f291360  0000000000000000
         000000701f291368  000000711a307900  /apex/com.android.art/lib64/libart.so (nterp_op_nop)
         000000701f291370  b4000071410df670
         000000701f291378  b40000724117b178
         000000701f291380  0000000000000000
         000000701f291388  b40000724117b0b0
    #08  000000701f291390  00000000aaaf37f8
         000000701f291398  b400007088eb8c58
         000000701f2913a0  0000000000000001
         000000701f2913a8  0000000000000000
         000000701f2913b0  0000000000000000
         000000701f2913b8  0000000000000000
         000000701f2913c0  0000000000000000
         000000701f2913c8  0000000000000000
         000000701f2913d0  0000000000000000
         000000701f2913d8  0000000000000000
         000000701f2913e0  b40000724117b0b0
         000000701f2913e8  0000000000000000
         000000701f2913f0  b40000724117b178
         000000701f2913f8  000000001cb6a660  [anon:dalvik-main space (region space)]
         000000701f291400  00000000aa960348
         000000701f291408  000000007b055000  [anon:dalvik-free list large object space]

memory near x1:
    00000073f9b7dd20 0000000000000000 0000000000000000  ................
    00000073f9b7dd30 0000000000000000 0000000000000000  ................
    00000073f9b7dd40 0000000000000004 0000000000000000  ................
    00000073f9b7dd50 0000000000000000 0000000000000000  ................
    00000073f9b7dd60 0000000000000000 0000000000000000  ................
    00000073f9b7dd70 0000000000000000 0000000000000000  ................
    00000073f9b7dd80 00000000001a0006 0000000000000000  ................
    00000073f9b7dd90 0000887800008448 0000ae0c00004da0  H...x....M......
    00000073f9b7dda0 00006830000062f0 0000974800006bdc  .b..0h...k..H...
    00000073f9b7ddb0 00004cf000000d54 00004e1c00004464  T....L..dD...N..
    00000073f9b7ddc0 0000b14800000e20 0000668400008838   ...H...8....f..
    00000073f9b7ddd0 000087640000a938 00009490000066cc  8...d....f......
    00000073f9b7dde0 000088c00000b0fc 0000967c000066d4  .........f..|...
    00000073f9b7ddf0 0000a6e8000086e0 0000000000000000  ................
    00000073f9b7de00 00000000001a0006 0000000000000020  ........ .......
    00000073f9b7de10 0005051600050494 0004fb6c00050504  ............l...

memory near x2:
    00000073f9b7dd20 0000000000000000 0000000000000000  ................
    00000073f9b7dd30 0000000000000000 0000000000000000  ................
    00000073f9b7dd40 0000000000000004 0000000000000000  ................
    00000073f9b7dd50 0000000000000000 0000000000000000  ................
    00000073f9b7dd60 0000000000000000 0000000000000000  ................
    00000073f9b7dd70 0000000000000000 0000000000000000  ................
    00000073f9b7dd80 00000000001a0006 0000000000000000  ................
    00000073f9b7dd90 0000887800008448 0000ae0c00004da0  H...x....M......
    00000073f9b7dda0 00006830000062f0 0000974800006bdc  .b..0h...k..H...
    00000073f9b7ddb0 00004cf000000d54 00004e1c00004464  T....L..dD...N..
    00000073f9b7ddc0 0000b14800000e20 0000668400008838   ...H...8....f..
    00000073f9b7ddd0 000087640000a938 00009490000066cc  8...d....f......
    00000073f9b7dde0 000088c00000b0fc 0000967c000066d4  .........f..|...
    00000073f9b7ddf0 0000a6e8000086e0 0000000000000000  ................
    00000073f9b7de00 00000000001a0006 0000000000000020  ........ .......
    00000073f9b7de10 0005051600050494 0004fb6c00050504  ............l...

memory near x3:
    000000701f290d28 00000071d104f6a0 000000701f290e90  ....q.....).p...
    000000701f290d38 002aba70a65c003c 00000070a6589501  <.\.p.*...X.p...
    000000701f290d48 0ada000000060106 0000000000000001  ................
    000000701f290d58 00000070a658592c 00000000000006fb  ,YX.p...........
    000000701f290d68 00000070a65860e1 0000000000000006  .`X.p...........
    000000701f290d78 0000000000000000 746f685f7369222c  ........,"is_hot
    000000701f290d88 5d7d657572743a22 2c2238332e34223a  ":true}]:"4.38",
    000000701f290d98 22746f685f736922 7b2c7d657572743a  "is_hot":true},{
    000000701f290da8 636e657272756322 72727563227b2c7d  "currenc},{"curr
    000000701f290db8 52223a2279636e65 747365222c224157  ency":"RWA","est
    000000701f290dc8 725f646574616d69 00000000ebad8076  imated_rv.......
    000000701f290dd8 0000000000000000 00000000ebad8077  ........w.......
    000000701f290de8 0000000000000000 0000000000000028  ........(.......
    000000701f290df8 b400007141020289 000000006746a99c  ...Aq.....Fg....
    000000701f290e08 0000000000000000 000000701f290ef0  ..........).p...
    000000701f290e18 000000701f290e10 000000701f290df0  ..).p.....).p...

memory near x8:
    00000070f61ab208 5045504105594444 4d06444552460445  DDY.APEPE.FRED.M
    00000070f61ab218 4c4c024946454d45 034b495352414206  EMEFI.LL.BARSIK.
    00000070f61ab228 034157520343525a 0b000000004b5348  ZRC.RWA.HSK.....
    00000070f61ab238 6c5f6e696772616d 76227b2a2f676e61  margin_lang/*{"v
    00000070f61ab248 2c657572743a226e 7572743a226e6522  n":true,"en":tru
    00000070f61ab258 743a226e63222c65 22726b222c657572  e,"cn":true,"kr"
    00000070f61ab268 007d65736c61663a 697665640c000000  :false}.....devi
    00000070f61ab278 6e656b6f745f6563 303736343736282d  ce_token-(674670
    00000070f61ab288 43374a346e743162 5a424b71646f7645  b1tn4J7CEvodqKBZ
    00000070f61ab298 576a63436a623938 4233614977627652  89bjCcjWRvbwIa3B
    00000070f61ab2a8 6b12000000003364 5f746f70735f7965  d3.....key_spot_
    00000070f61ab2b8 646f6e5f6d697061 3565646f4e060b65  apim_node..Node5
    00000070f61ab2c8 656b140000000037 6572757475665f79  7.....key_future
    00000070f61ab2d8 6f6e5f6d6970615f 6d6970610c116564  _apim_node..apim
    00000070f61ab2e8 37353165646f6e20 7361620800000000   node157.....bas
    00000070f61ab2f8 681f246c72755f65 612f2f3a73707474  e_url$.https://a

memory near x17:
    00000073f9890498 b0fffe8250e67101 528000a091217442  .q.P....Bt!....R
    00000073f98904a8 aa1403e4aa1503e3 17ffffe69401299d  .........)......
    00000073f98904b8 a9bf7bfdd503233f 90003988910003fd  ?#...{.......9..
    00000073f98904c8 c8dffd0891016108 90003989b4000140  [email protected]..
    00000073f98904d8 f9402529aa0003e1 92481d2b8a09200a  ....)%@.. ..+.H.
    00000073f98904e8 eb0b015f92481d4a 8a29402054000141  J.H._...A..T @).
    00000073f98904f8 a8c17bfdb5000088 140001ecd50323bf  .....{...#......
    00000073f9890508 a8c17bfdf9400510 d61f0200d50323bf  ..@..{...#......
    00000073f9890518 911b9400b0fffe60 9403051194012a37  `.......7*......
    00000073f9890528 90003989d503245f c8dffd2991016129  _$...9..)a..)...
    00000073f9890538 140001f5b5000049 d61f0200f9400930  I.......0.@.....
    00000073f9890548 90003988d503245f c8dffd0891016108  _$...9...a......
    00000073f9890558 1400021bb5000048 d61f0200f9403510  H........5@.....
    00000073f9890568 a9be7bfdd503233f 910003fda9014ff4  ?#...{...O......
    00000073f9890578 31032c1f2a0103f3 3103301f540001a0  ...*.,.1...T.0.1
    00000073f9890588 b00016f454000281 aa1403e0912df294  ...T......-.....

memory near x18:
    000000701f290d20 00000071d104f6a0 00000071d104f6a0  ....q.......q...
    000000701f290d30 000000701f290e90 002aba70a65c003c  ..).p...<.\.p.*.
    000000701f290d40 00000070a6589501 0ada000000060106  ..X.p...........
    000000701f290d50 0000000000000001 00000070a658592c  ........,YX.p...
    000000701f290d60 00000000000006fb 00000070a65860e1  .........`X.p...
    000000701f290d70 0000000000000006 0000000000000000  ................
    000000701f290d80 746f685f7369222c 5d7d657572743a22  ,"is_hot":true}]
    000000701f290d90 2c2238332e34223a 22746f685f736922  :"4.38","is_hot"
    000000701f290da0 7b2c7d657572743a 636e657272756322  :true},{"currenc
    000000701f290db0 72727563227b2c7d 52223a2279636e65  },{"currency":"R
    000000701f290dc0 747365222c224157 725f646574616d69  WA","estimated_r
    000000701f290dd0 00000000ebad8076 0000000000000000  v...............
    000000701f290de0 00000000ebad8077 0000000000000000  w...............
    000000701f290df0 0000000000000028 b400007141020289  (..........Aq...
    000000701f290e00 000000006746a99c 0000000000000000  ..Fg............
    000000701f290e10 000000701f290ef0 000000701f290e10  ..).p.....).p...

memory near x21:
    000000006746a978 0000000000000000 0000000000000000  ................
    000000006746a988 0000000000000000 0000000000000000  ................
    000000006746a998 0000000000000000 0000000000000000  ................
    000000006746a9a8 0000000000000000 0000000000000000  ................
    000000006746a9b8 0000000000000000 0000000000000000  ................
    000000006746a9c8 0000000000000000 0000000000000000  ................
    000000006746a9d8 0000000000000000 0000000000000000  ................
    000000006746a9e8 0000000000000000 0000000000000000  ................
    000000006746a9f8 0000000000000000 0000000000000000  ................
    000000006746aa08 0000000000000000 0000000000000000  ................
    000000006746aa18 0000000000000000 0000000000000000  ................
    000000006746aa28 0000000000000000 0000000000000000  ................
    000000006746aa38 0000000000000000 0000000000000000  ................
    000000006746aa48 0000000000000000 0000000000000000  ................
    000000006746aa58 0000000000000000 0000000000000000  ................
    000000006746aa68 0000000000000000 0000000000000000  ................

memory near x22:
    00000070f617ffe0 ---------------- ----------------  ................
    00000070f617fff0 ---------------- ----------------  ................
    00000070f6180000 63cb84df0007b344 6f745f656d6f6836  D......c6home_to
    00000070f6180010 72656e6e61625f70 645f6b63696c635f  p_banner_click_d
    00000070f6180020 735f79616c707369 69665f7375746174  isplay_status_fi
    00000070f6180030 3230325f7265646e 0532322d30312d34  nder_2024-10-22.
    00000070f6180040 656b200000000001 5f736e6172745f79  ..... key_trans_
    00000070f6180050 72665f6874706564 5f79636e65757165  depth_frequency_
    00000070f6180060 0005656369746f6e 6d6f683600000000  notice......6hom
    00000070f6180070 61625f706f745f65 696c635f72656e6e  e_top_banner_cli
    00000070f6180080 6c707369645f6b63 75746174735f7961  ck_display_statu
    00000070f6180090 7265646e69665f73 38302d343230325f  s_finder_2024-08
    00000070f61800a0 000000010534312d 745f656d6f683600  -14......6home_t
    00000070f61800b0 656e6e61625f706f 5f6b63696c635f72  op_banner_click_
    00000070f61800c0 5f79616c70736964 665f737574617473  display_status_f
    00000070f61800d0 30325f7265646e69 38322d30312d3432  inder_2024-10-28

memory near x23:
    000000701f291fe0 0000000000000000 0000000000000000  ................
    000000701f291ff0 0000000000000000 000000701f292040  ........@ ).p...
    000000701f292000 00000073f9865f68 000000701f291cb0  h_..s.....).p...
    000000701f292010 0000000000000000 0000000000000000  ................
    000000701f292020 0000000000000000 87e3fe8cc86e0888  ..........n.....
    000000701f292030 00000073f9b7dd40 b40000724117b0b0  @...s......Ar...
    000000701f292040 0000000000000000 0000000000000000  ................
    000000701f292050 0000000000000000 0000000000000000  ................
    000000701f292060 0000000000000000 0000000000000000  ................
    000000701f292070 0000000000000000 0000000000000000  ................
    000000701f292080 0000000000000001 b400007281474810  .........HG.r...
    000000701f292090 0000000000000001 0000000000000000  ................
    000000701f2920a0 0000000000000000 0000000000000000  ................
    000000701f2920b0 0000000000000000 0000000000000000  ................
    000000701f2920c0 0000000000000001 b4000072215b6610  .........f[!r...
    000000701f2920d0 0000000000000000 0000000000000000  ................

memory near x24:
    00000070a65860c0 6e61686320736168 5d73255b20646567  has changed [%s]
    00000070a65860d0 7a25206d6f726620 757a25206f742075   from %zu to %zu
    00000070a65860e0 457265746c696600 654b646572697078  .filterExpiredKe
    00000070a65860f0 7453646c6f007379 6175746341656c79  ys.oldStyleActua
    00000070a6586100 752520657a69536c 75716520746f6e20  lSize %u not equ
    00000070a6586110 656d206f74206c61 6175746361206174  al to meta actua
    00000070a6586120 2520657a6973206c 00564b4d4d00756c  l size %lu.MMKV.
    00000070a6586130 206f74206c696166 687361206e65706f  fail to open ash
    00000070a6586140 202c73253a6d656d 617265706f007325  mem:%s, %s.opera
    00000070a6586150 65706f002c726f74 003e2d726f746172  tor,.operator->.
    00000070a6586160 6573726150007454 6c706d65543e2d72  Tt.Parser->Templ
    00000070a6586170 6d61726150657461 2928657a69732e73  ateParams.size()
    00000070a6586180 4e646c4f203d3e20 616c706d65546d75   >= OldNumTempla
    00000070a6586190 4c6d617261506574 0043440073747369  teParamLists.DC.
    00000070a65861a0 726f707075736e75 366d726120646574  unsupported arm6
    00000070a65861b0 7473696765722034 7800313178007265  4 register.x11.x

memory near x25:
    00000070a6585908 6465686361632065 73255b766b6d6d20  e cached mmkv[%s
    00000070a6585918 5b206d6f7266205d 5b206f74205d7325  ] from [%s] to [
    00000070a6585928 564b4d4d005d7325 007070632e4f495f  %s].MMKV_IO.cpp.
    00000070a6585938 5761746144746567 544d74756f687469  getDataWithoutMT
    00000070a6585948 654b726f46656d69 206b636568630079  imeForKey.check 
    00000070a6585958 727265205d73255b 7473616c203a726f  [%s] error: last
    00000070a6585968 69536c6175746341 6c202c752520657a  ActualSize %u, l
    00000070a6585978 6175746341747361 007525204352436c  astActualCRC %u.
    00000070a6585988 7420796177206f6e 61206d697274206f  no way to trim a
    00000070a6585998 7325206d656d6873 7a25206d6f726620  shmem %s from %z
    00000070a65859a8 616d73206f742075 7a69732072656c6c  u to smaller siz
    00000070a65859b8 616600757a252065 736d206f74206c69  e %zu.fail to ms
    00000070a65859c8 5d73255b20636e79 207325007325202c  ync [%s], %s.%s 
    00000070a65859d8 664c25007325203a 675f6178635f5f00  : %s.%Lf.__cxa_g
    00000070a65859e8 7163615f64726175 7079740065726975  uard_acquire.typ
    00000070a65859f8 6f66206f666e6965 006f747561002072  einfo for .auto.

memory near x28:
    00000070a6588e18 7375206572757475 00757a253a656761  uture usage:%zu.
    00000070a6588e28 646e657070416f64 6874695761746144  doAppendDataWith
    00000070a6588e38 656c65640079654b 70786520676e6974  Key.deleting exp
    00000070a6588e48 79656b2064657269 64202c5d73255b20  ired key [%s], d
    00000070a6588e58 2065746164206575 6c62616e65007525  ue date %u.enabl
    00000070a6588e68 657261706d6f4365 655365726f666542  eCompareBeforeSe
    00000070a6588e78 255b20726f662074 0070616d6d005d73  t for [%s].mmap.
    00000070a6588e88 4d64657261685341 65675f79726f6d65  ASharedMemory_ge
    00000070a6588e98 616600657a695374 6567206f74206c69  tSize.fail to ge
    00000070a6588ea8 6d656d6873612074 64253a657a697320  t ashmem size:%d
    00000070a6588eb8 726574007325202c 676e6974616e696d  , %s.terminating
    00000070a6588ec8 206f742065756420 6965726f66207325   due to %s forei
    00000070a6588ed8 7065637865206e67 614c25006e6f6974  gn exception.%La
    00000070a6588ee8 656c62756f64004c 2120657361622800  L.double.(base !
    00000070a6588ef8 202626202930203d 505f48455f574422  = 0) && "DW_EH_P
    00000070a6588f08 6572617461645f45 766e69207369206c  E_datarel is inv

memory near x29:
    000000701f290f60 000000701f291028 007876711a504c74  (.).p...tLP.qvx.
    000000701f290f70 000000007b055000 87e3fe8cc86e0888  .P.{......n.....
    000000701f290f80 000000701f291040 00000070a65b6f58  @.).p...Xo[.p...
    000000701f290f90 b4000073210219d0 000000000000001a  ...!s...........
    000000701f290fa0 000000000000001a 000000701f291100  ..........).p...
    000000701f290fb0 0000000000008cea 0000000000000000  ................
    000000701f290fc0 000000701f291240 000000701f292000  @.).p.... ).p...
    000000701f290fd0 b400007141020270 0000000000008cea  p..Aq...........
    000000701f290fe0 6f1593e800000001 4117b0b000000001  .......o.......A
    000000701f290ff0 00000000b4000072 0000000000000003  r...............
    000000701f291000 00000000141b75a8 00000000709bd938  .u......8..p....
    000000701f291010 000000006f2d8848 87e3fe8cc86e0888  H.-o......n.....
    000000701f291020 000000701f291030 00556af3f98ce808  0.).p........jU.
    000000701f291030 000000701f291170 87e3fe8cc86e0888  p.).p.....n.....
    000000701f291040 000000701f2910a0 00000070a65ba074  ..).p...t.[.p...
    000000701f291050 000000701f291240 0000000000008ccc  @.).p...........

memory near sp:
    000000701f290ed0 000000701f291240 000000006746a99c  @.).p.....Fg....
    000000701f290ee0 b400007141020289 b400007141020270  ...Aq...p..Aq...
    000000701f290ef0 0000000000000002 b400007141020289  ...........Aq...
    000000701f290f00 b400007321021ed0 000000701f292000  ...!s.... ).p...
    000000701f290f10 000000701f292000 000000701f290f21  . ).p...!.).p...
    000000701f290f20 0000000000000001 0000000000000034  ........4.......
    000000701f290f30 b4000071f100e190 b40000724117b0b0  ....q......Ar...
    000000701f290f40 000000701f292000 0000000000000000  . ).p...........
    000000701f290f50 000000001f290f80 b400007321021ed0  ..)........!s...
    000000701f290f60 000000701f291028 007876711a504c74  (.).p...tLP.qvx.
    000000701f290f70 000000007b055000 87e3fe8cc86e0888  .P.{......n.....
    000000701f290f80 000000701f291040 00000070a65b6f58  @.).p...Xo[.p...
    000000701f290f90 b4000073210219d0 000000000000001a  ...!s...........
    000000701f290fa0 000000000000001a 000000701f291100  ..........).p...
    000000701f290fb0 0000000000008cea 0000000000000000  ................
    000000701f290fc0 000000701f291240 000000701f292000  @.).p.... ).p...

code around lr(00000070a65b7134):
    disassembly result:
    dump err: stdout: ./tools/aarch64-linux-android-objdump: --adjust-vma: bad number: 0x
 stderr: exit status 1

    00000070a65b7050 94003971910003e0 9400396f910083e0
    00000070a65b7060 f85f83a9f94016a8 54000061eb09011f
    00000070a65b7070 9400e383aa1303e0 d103c3ff9400f2d6
    00000070a65b7080 a90a6ffca9097bfd a90c5ff8a90b67fa
    00000070a65b7090 a90e4ff4a90d57f6 d53bd057910243fd
    00000070a65b70a0 f81f83a8f94016e8 3400140839434008
    00000070a65b70b0 f9405408aa0003f3 f9403668b4001348
    00000070a65b70c0 b4001348f9400d08 f81d83b8f9406278
    00000070a65b70d0 39403308b40000d8 f940030034000088
    00000070a65b70e0 94003955b9400b01 9400f345aa1f03e0
    00000070a65b70f0 aa0003f539406268 91006674f9401669
    00000070a65b7100 7200011fb940d667 d503201f9a890285
    00000070a65b7110 f0fffe6210e740e1 d0fffe8491038442
    00000070a65b7120 5280002091140484 2a1503e65280df63
    00000070a65b7130 f9403e6894002346 f9401908f9405669
    00000070a65b7140 b4000f8991001116 f940091af9403668

code around pc(00000070a65b7390):
    disassembly result:
    dump err: stdout: ./tools/aarch64-linux-android-objdump: --adjust-vma: bad number: 0x
 stderr: exit status 1

    00000070a65b72b0 f940134036000068 aa1a03e09400f256
    00000070a65b72c0 3940c3e89400f254 7200011ff94023e9
    00000070a65b72d0 9a890105f94017e8 aa1903e152800020
    00000070a65b72e0 5280e1e3aa1c03e2 9138f084b0fffe84
    00000070a65b72f0 940022d52a1b03e6 360000683940c3e8
    00000070a65b7300 9400f243f94023e0 aa1703fa91000694
    00000070a65b7310 940038c1d10103a0 14000065b5fff417
    00000070a65b7320 f9400d08f9403268 aa1f03f4b5ffed08
    00000070a65b7330 f940326814000079 b400107af940091a
    00000070a65b7340 a900e3f49100c3e8 b2400108aa1f03f4
    00000070a65b7350 10e72ed9d503201f 91038718f0fffe78
    00000070a65b7360 9138f39cb0fffe9c f90017e8f9000ff7
    00000070a65b7370 f940035a14000003 2945a349b40009da
    00000070a65b7380 8b0802c87940534a 8b0a010851001129
    00000070a65b7390 51000768b869491b 54fffec26b15011f
    00000070a65b73a0 3940010991004348 3dc00100370000c9

****** new tombstone parse success 2024-11-27 19:21:38(北京时间) ******

@lingol
Copy link
Collaborator

lingol commented Nov 27, 2024

According to your call stacks it crashed inside MMKV::filterExpiredKeys() which is weird. Can you provide a reproducible demo project or the relative MMKV files (including the *.crc file)?

#00 pc 000000000004d390 /data/app/~~T-JKFhIKj06ljqCd-jqv2Q==/com.xxxxxx.xxxxx-_eQ5My7wQ0SIDcPukAnTOw==/lib/arm64/libmmkv.so
    MMKV::filterExpiredKeys() at MMKV_IO.cpp:1822

@wuangruaingzua
Copy link
Author

MMKV files

mmkv.zip

@lingol
Copy link
Collaborator

lingol commented Nov 28, 2024

According to the logs, I guess it crashed on loading the default MMKV instance, right?
What exactly is your code to load the default MMKV instance?

@wuangruaingzua
Copy link
Author

wuangruaingzua commented Nov 28, 2024

private val defaultMMKV: MMKV by lazy { MMKV.defaultMMKV().apply { enableAutoKeyExpire(MMKV.ExpireNever) } }

@lingol
Copy link
Collaborator

lingol commented Nov 28, 2024

MMKV.cpp:423::checkFileCRCValid check crc [mmkv.default] fail, crc32:286753061, m_crcDigest:2247816363

The file is corrupted. It is not the original make.default & make.default.crc file when your crash happens.
Please provide exactly the same file when it happens.

@lingol
Copy link
Collaborator

lingol commented Nov 28, 2024

The root cause is that your metafile (mmkv.default.crc) has the flag that AutoKeyExpire is enabled, but the data file (mmkv.default) is not actually in the format. Enabling auto-key-expiration is a breaking change API, once you enable it, the data file's format will change completely.

  • Is it possible that there's an interruption when you enable it?
  • Is it possible that the metafile and the data file are not from the same place, for example from another device by some backup & restore tools, or by cloud sync?

Can you provide a demo project that reproduces this problem, starting from the very beginning when mmkv.default is not auto-key-expire, and then auto-key-expire is turned on, and then it's corrupted?

@wuangruaingzua
Copy link
Author

Thank you for your detailed explanation regarding the issue with the metafile and data file in MMKV.
It is indeed clear that the problem arises from enabling AutoKeyExpire, which leads to a breaking change in the data file format. Your suggestions regarding potential interruptions during this process and the possibility of mismatched files from different sources have been invaluable in our troubleshooting efforts.
At this time, we have not been able to reproduce the problem consistently. It appears that only a subset of our users is encountering this issue, which makes it a bit more challenging to diagnose.

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

2 participants