Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
527 views
in Technique[技术] by (71.8m points)

Realm .NET crashing when creating a new instance (Thread Pool Wor)

When trying to create a new Realm instance with Realm.GetInstance(realmConfig), in random contexts I get a native crash on libc supposedly during a mutex operation; Debug log is as follows:

mono-stdout: [Threads 6][Realm 15][Utils.TraceException:149] - W - Managed Exception in RealmProvider.GetRealm:55 -> Realms.Exceptions.RealmException: Cannot access realm that has been closed.
mono-stdout:   at Realms.NativeException.ThrowIfNecessary (System.Func`2[T,TResult] overrider) [0x00011] in <adbb920c027d4e04b3ca6a6920a44a1f>:0 
mono-stdout:   at Realms.SharedRealmHandle.Open (Realms.Native.Configuration configuration, 
Realms.Schema.RealmSchema schema, System.Byte[] encryptionKey) [0x00024] in <adbb920c027d4e04b3ca6a6920a44a1f>:0 
mono-stdout:   at Realms.RealmConfiguration.CreateRealm (Realms.Schema.RealmSchema schema) [0x00096] in <adbb920c027d4e04b3ca6a6920a44a1f>:0 
mono-stdout:   at Realms.Realm.GetInstance (Realms.RealmConfigurationBase config, 
Realms.Schema.RealmSchema schema) [0x0003c] in <adbb920c027d4e04b3ca6a6920a44a1f>:0 
mono-stdout:   at Realms.Realm.GetInstance (Realms.RealmConfigurationBase config) [0x0000a] in <adbb920c027d4e04b3ca6a6920a44a1f>:0 
mono-stdout:   at ByMeLib.Database.ByMeRealmProvider.GetRealm (System.Boolean isFirstInstanceMts) [0x00063] in <38bf14fccd7e41d98e9a214c80bed754>:0 
libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 7677 (Thread Pool Wor)
DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
DEBUG   : Build fingerprint: 'Android/a93/a93:5.1/LMY47D/build12111549:user/test-keys'
DEBUG   : Revision: '0'
DEBUG   : ABI: 'arm'
DEBUG   : pid: 4892, tid: 7677, name: Thread Pool Wor  >>> com.mtsbyme <<<
DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
DEBUG   :     r0 00000008  r1 8a0fad9c  r2 00000001  r3 00000000
DEBUG   :     r4 00000008  r5 00000000  r6 401a5dd4  r7 8a0fad70
DEBUG   :     r8 ffffffff  r9 ffffffff  sl 8a0faf88  fp 00000000
DEBUG   :     ip 6e49a170  sp 8a0fad58  lr 6e3321b9  pc 40160f3e  cpsr 600d0030
DEBUG   : 
DEBUG   : backtrace:
DEBUG   :     #00 pc 00016f3e  /system/lib/libc.so (pthread_mutex_lock+7)
DEBUG   :     #01 pc 004321b5  /data/app/com.mtsbyme-2/lib/arm/librealm-wrappers.so 
(std::__ndk1::recursive_mutex::lock()+4)
DEBUG   :     #02 pc 002dc877  /data/app/com.mtsbyme-2/lib/arm/librealm-wrappers.so
DEBUG   :     #03 pc 00104c2d  /data/app/com.mtsbyme-2/lib/arm/librealm-wrappers.so
DEBUG   :     #04 pc 000f4221  /data/app/com.mtsbyme-2/lib/arm/librealm-wrappers.so
DEBUG   :     #05 pc 000cd6b7  /data/app/com.mtsbyme-2/lib/arm/librealm-wrappers.so (shared_realm_open+350)
DEBUG   :     #06 pc 0016b900  <unknown>
NativeCrashListener: Exception dealing with report
NativeCrashListener: android.system.ErrnoException: read failed: EAGAIN (Try again)
NativeCrashListener:    at libcore.io.Posix.readBytes(Native Method)
NativeCrashListener:    at libcore.io.Posix.read(Posix.java:165)
NativeCrashListener:    at libcore.io.BlockGuardOs.read(BlockGuardOs.java:230)
NativeCrashListener:    at android.system.Os.read(Os.java:350)
NativeCrashListener:    at 
com.android.server.am.NativeCrashListener.consumeNativeCrashData(NativeCrashListener.java:240)
NativeCrashListener:    at com.android.server.am.NativeCrashListener.run(NativeCrashListener.java:138)

Does anyone have any clue why this would happen. Thanks in advance!

question from:https://stackoverflow.com/questions/65887372/realm-net-crashing-when-creating-a-new-instance-thread-pool-wor

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...